Tomcat and mysql
Technically, courselist is a platform, database type and J2EE container neutralized web application. The
released package is a J2EE compliant war file. However I have not test it on each kind of web container
and database so far. Therefore to make the process simple, let's install it on Apache Tomcat 4.1 and
MySQL 4.1.
Deploy courselist sql
The released sql file (courselist-mysql-data-versionnumber.sql) that you just downloaded contains the
sql to create tables and insert data. You need to create a mysql database called "courselist" and import
data into it.
$> mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database courselist;
Query OK, 1 row affected (0.00 sec)
mysql> quit
Bye
$> mysql -u root courselist < courselist-mysql-data-1.0-b2.sql
Now the data is imported. If you have a password for root user, don't forget to add -p for mysql command
propertly.
By default, courselist is talking to local mysql though a mysql user called "dev" whose password is
"dev". So you need to create this user for mysql before start running the application. To do this, you
can open the mysql administrator, create user "dev" with password "dev" and assign all permission of
database "courselist" to this user.
Once you can login mysql with user "dev" and see all the tables, that means your database is ready to
go.
$> mysql -u dev -p courselist
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show tables;
+--------------------------+
| Tables_in_courselist |
+--------------------------+
| c_cl_course |
| c_cl_course_prerequisite |
| c_cl_student_course |
| c_cl_teacher |
| c_t_group |
| c_t_group_role |
| c_t_role |
| c_t_role_dependency |
| c_t_role_permission |
| c_t_user |
| c_t_user_group |
| c_t_user_preference |
| c_t_user_role |
+--------------------------+
13 rows in set (0.00 sec)
mysql> quit
Bye
$>
Deploy courselist war
Last step, rename to downloaded war file into courselist.war and copy it to the webapps directory of
tomcat. So under TOMCAT_INSTALL_DIR/webapps, there should be courselist.war file.
Go to TOMCAT_INSTALL_DIR/bin and start tomcat server, wait for some messages coming out.
Nov 22, 2005 11:14:34 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-7080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.31
[INFO] Loading on start [role]: [com.cyclopsgroup.courselist.CourseListComponents]
...
...
Nov 22, 2005 11:14:42 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-7080
Now you can visit
http://localhost:8080/courselist
to see the home page.
|