Student Project Server Documentation
Note: You may not be using all of the following options for your course. These instructions are listed for any courses requiring them.
- Using the Linux System
- Accessing the MySQL Database
- Using Java and MySQL
- Using JSP
- Using PHP
- Using RMI
The Linux System
Accessing the MySQL Database
- A database has been created, which has the same name as your login and home directory. Type
mysql -p databasename
to use the mysql command line monitor (where databasename is your database (login) name). You will be prompted for your password.
- Once you are in your MySQL database, type \h (for HELP) to get the basic command list. \q is the command to quit. The other commands can be found in the MySQL Reference Manual below.
- MySQL Reference Manual
- To create tables and table entries, follow the instructions given in your course materials and in the reference materials above.
- You are the only one who can read or write to your database from the command line.
- Note: Due to connection issues, we no longer recommend using a graphical client to connect to your database, such as MySQL CC, via SSH tunneling.
Warning: Do not attempt to change either your MySQL password or your user configuration in the mysql database. These have been set to enable access from both the Web and the command line and changes made can result in loss of that access. If you feel that permissions need to be changed, please contact the SCIS technical team.
Using Java and MySQL
- To compile your Java programs, you should no longer need to set your PATH to java or CLASSPATH to servlet.jar and the jdbc connector. This should be set for you. If you encounter problems with this, email the SCIS Programmers.
- The driver used is MM.MySQL, which is a Type-4 JDBC driver. It allows Java developers to make connections to MySQL servers from both Java applications and applets. On IO, you will be making your connections using Java servlets.
- Servlets run on the Apache Tomcat 5 module, which is an implementation of the Java Servlet 2.2 and JavaServer Pages 1.1 Specifications.
- The servlet development and production zone is under the path
/usr/local/etc/httpd/htdocs/WEB-INF/classes/LOGIN (where LOGIN is your login name).
The URL for servlets in this zone is http://student.athabascau.ca/servlet/SERVLETNAME.
You have your own subdirectory under this path, which has the same name as your login name. This requires that you start your program referencing your code as a package. For example, the demo code is in a subdirectory called 'db'. The program code starts out with:
The servlet is referenced using that package name as: http://student.athabascau.ca/servlet/db.ConnMySQL
In your home directory /home/LOGIN (where LOGIN is your login name) there is a symbolic link WEB_INF_classes_LOGIN which can be used to navigate to /usr/local/etc/httpd/htdocs/WEB-INF/classes/LOGIN directory.
- MySQL Java Database Connect Demo
- For more help and information, check out the following links. Note that most of these reference a different MySQL driver than the one on the IO server.
- JDBCtm Guide: Getting Started
- Sun Tutorial - Lesson: JDBC Basics
- Sun Tutorial - Servlets
- Writing JDBC Applications with MySQL
Using JSP on the Server
- JSP will not work from your home directory because the Tomcat server does not recognize your directory as a context. You need to request a directory be created in the path /usr/local/etc/httpd/htdocs/html/LOGIN where you must run all JSP files from. The URL will be http://student.athabascau.ca/html/LOGIN/file.jsp. (Contact the SCIS technical team.)
- JSP-MySQL Connect Demo
- JavaServer Pages Fundamentals
Using PHP on the Server
- You will place any PHP files in the 'public_html' subdirectory of your home directory (/home/login/public_html). To access these from the Web, the URL will be http://student.athabascau.ca/~login/filename.php. Note: Substitute your login name and the filename you wish to access.
- PHP Basic and MySQL Connect Demos
- PHP Tutorial
- Because you must use RMI through the AU firewall, you will need to specify the ports for both the client and the server.
- Contact the SCIS technical team to request the port numbers.
- Note that the rmiregistry processes on student.athabascau.ca will be periodically stopped. You may need to restart yours again.
- RMI Through a Firewall
Updated January 07 2014 by FST Technical Staff