1. General
- 1.1) Why is the URL that I use different from the physical location of the file ?
- 1.2) I've changed my page, but when I look at it with my Browser it hasn't changed. Why ?
- 1.3) Some of my links don't work, yet on my PC it works fine. Why ?
- 1.4) How do I publish my work ?
- 1.5) Why do I need to put mt HTML files in a different directory from my CGI scripts ?
- 1.6) Everything was working perfectly, now seemingly without reason I can't modify or create any new files in my Webspace. Why ?
- 1.7) What other documents should I read ?
2. Java
3. Linux
- 3.1) How do I change my linux password ?
- 3.2) How can I access linux from outside JMU ?
- 3.3) Where can I get a copy of linux to install on my home PC ?
- 3.4) Can I access the java.cms.livjm.ac.uk webserver from outside JMU ?
- 3.5 ) How can I access my linux files from Windows ?
- 3.6) How can I print to a laser printer from linux ?
- 3.7) How can I access the floppy / CD / Pendrive ?
- 3.8) Where on linux do I put my CGI scripts and HTML files ?
- 3.9) What URL's do I use to access my linux website ?
- 3.10) Can I access the java.cms.livjm.ac.uk webserver from outside JMU ?
- 3.11) I've got a question that isn't covered here. What do I do ?
4. Databases
- 4.1) Do I need a separate account to use Oracle ?
- 4.2) How do I access Oracle ?
- 4.3) Where can I get a copy of Oracle to install on my home PC ?
- 4.4 )Is there any online documentation for Oracle ?
- 4.5) How do I change my Oracle password ?
- 4.6) How can I access Oracle from my java application ?
- 4.7) Do I need a separate account to use MySQL ?
- 4.8) How do I access MySQL?
- 4.9) Can I access MySQL from outside JMU ?
- 4.10) How do I change my MySQL password ?
- 4.11) How can I access MySQL from my PHP script ?
1. General
1.1) Why is the URL that I use different from the physical location of the file ?
All Webservers have configuration information that says where the top level or root of HTML documents & CGI scripts are:
| UNIX | PC | |
| DocumentRoot | /ftpserver/www | C:\myweb |
| ScriptAlias | /cgi-bin =>/usr/local/httpd/cgi-bin | /cgi-bin => C:\myweb\bin |
So the directories used in a URL are virtual in that they only point to the real physical directory.
1.2 I've changed my page, but when I look at it with my Browser it hasn't changed. Why ?
This is almost certainly down to Browser caching. Most Browsers hold a copy of recently accessed pages in memory to save having to reload them every time you access them. Try <Shift Refresh> ( Internet Explorer ) or Reload ( Firefox ). Failing that close down your Browser completely & restart.
1.3) Some of my links don't work, yet on my PC it works fine. Why ?
In most cases this is due to the fact that Windows is not case sensitive & UNIX is.
1.4) How do I publish my work ?
See the Publishing section.
1.5)> Why do I need to put my HTML files in a different directory from my CGI scripts ?
This is due to the way the Webserver is configured. Basically all files in your CGI directory are assumed to be CGI scripts. Similarly all files in your Webspace are assumed to be HTML or PHP.
1.6) Everything was working perfectly, now seemingly without reason I can't modify or create any new files in my Webspace. Why ?
The first thing to look at is your disk quota. You are allowed a certain amount of physical disk space to publish your work, but if you exceed this then you will encounter problems. Logon to any UNIX machine and type:
quota -v
in any terminal window.
1.7) What other documents should I read ?
| W3Schools | Good beginners guide |
| University of Toronto | Excellent and packed with features |
| Bare Bones Guide | References to all the tags in HTML 3. Available in languages other than English. |
2. Java
2.1) What additional material should I look at ?
| Applets from JavaSoft Gamelan | Examples |
| Java Tutorial | Tutorial |
| Java in a Nutshell | Book. |
3. Linux
3.1) How do I change my linux password ?
You can’t, linux uses your Windows password now. You will still need a linux account setting up if you don’t have one, but only one password is used for both Windows and linux.
3.2) How can I access linux from outside JMU ?
To transfer files you need a program that supports Secure File Transfer ( SFTP ). FileZilla is recommended.
To use linux commands you need a program that supports Secure Shell ( SSH ). SSH Client is recommended. This will only give you a text based interface.
The windows based interface is available using NX Client.
When transferring text files (such as C programs, Perl scripts ) you should always set the Transfer Type to ASCII.
Use nano as a text editor if you don't like vi.
3.3) Where can I get a copy of linux to install on my home PC ?
There are various CD burning machines on the 6th and 7th floors of the James Parsons building. One such machine is located on the immediate left as you enter Lab A. Instructions on how to burn your CD are printed on a poster on the wall next to the PC.
Using Virtual PC you can install linux so that it runs like any other Windows application. To download this product you'll need a MSDNAA account.
3.4) How do I reboot a linux PC ?
On the login screen click the System button then
then Restart Computer.
Or when logging out select the Restart Computer option.
3.5) How can I access my linux files from Windows ?
There are 3 areas where linux stores your files:
\\lister.cms.livjm.ac.uk\homes |
Coursework. C programs, shell scripts etc |
\\lister.cms.livjm.ac.uk\studweb |
Web area. HTML or PHP files |
\\lister.cms.livjm.ac.uk\cgispace |
CGI area. Perl scripts |
Using My Computer -> Tools -> Map Network Drive, you can map to any of these areas.
Because Windows and linux use different text file format you should avoid dragging and dropping text files onto your cgispace area.
3.6) How can I print to a laser printer from linux ?
Currently uou can't. use the mappings above & print from Windows.
Again because Windows and linux use different text file formats you should use TextPad ( not Notepad ) to view / print text files.
3.7) How can I access the floppy / CD / Pendrive ?
Click on My Computer then click on the device you want.
Pendrives may appear as USB Hard Disk
3.8) Where on linux do I put my CGI scripts and HTML files ?
| /ftpserver/cgispace/username | CGI scripts |
| /ftpserver/www/homepage/student/username | HTML or PHP files |
One of the most common mistakes is to transfer Web related files to linux using a program like FileZilla without specifying a Remote Directory. The default is to put your files in your linux home directory, but the webserver is not configured to look for them there.
3.9) What URL's do I use to access my linux website ?
| http://java.cms.livjm.ac.uk/cgi-bin/cgiwrap/username/scriptname | CGI scripts |
| http://java.cms.livjm.ac.uk/homepage/student/username/filename | HTML or PHP files |
In your homepage area If you don't want a Directory Listing to appear then call one of your files index.html, index.htm , or index.php
3.10) Can I access the java.cms.livjm.ac.uk webserver from outside JMU ?
Yes.
3.11) I've got a question that isn't covered here. What do I do ?
E-Mail D.Wynne@ljmu.ac.uk
4. Databases
4.1) Do I need a separate account to use Oracle ?
Yes. Oracle has it's own username / password system, separate from Windows. Your Oracle username should be the same as your Windows username but the initial password will be different.
4.2) How do I access Oracle ?
On a Windows PC on the 7th floor James Parsons building:
Start -> Programs -> Databases and SQL -> SQL Plus Worksheet
| Username | your-oracle-username/ |
| Password | your-oracle-password |
| Service | oracle |
Don't close down the black command window that appears with SQL Plus Worksheet - iconify it instead.
You must delete the first line in SQL Plus Worksheet before typing in any SQL statements. The line looks like this:
Connect cmsdwynn/****@oracle
4.3) Where can I get a copy of Oracle to install on my home PC ?
There are various CD burning machines on the 6th and 7th floors of the James Parsons building. One such machine is located on the immediate left as you enter Lab A. Instructions on how to burn your CD are printed on a poster on the wall next to the PC.
Only the Oracle Client is supplied on the CD. You'll need an ISP/Broadband connection to the internet to access Oracle. On your CD is a file called README.htm, this file contains vital installation and configuration instructions for Oracle.
4.4) Is there any online documentation for Oracle ?
See the Documentation section.
4.5) How do I change my Oracle password ?
In SQL Plus Worksheet type in the following SQL statement:
alter user your-oracle-username identified by xxxxxxxx;Substitute what you want your new password to be for xxxxxxxx. Oracle passwords must begin with a letter.
To execute and SQL statement click on the
icon.
4.6) How can I access Oracle from my java application ?
import oracle.jdbc.*; String serverName = "java.cms.livjm.ac.uk"; String portNumber = "1521"; String service = "o11g"; String username = "your-oracle-username"; String password = "your-oracle-password"; String url = "jdbc:oracle:thin:" + username + "/" + password + "@//"; url = url + serverName + ":" + portNumber + "/" + service; // DriverManager will return a Connection from the loaded driver // The connection string is passed as the only argument connection = DriverManager.getConnection(url);
4.7) Do I need a separate account to use MySQL ?
Yes it’s like Oracle in that way.
4.8) How do I access MySQL?
On a Windows PC on the 7th floor James Parsons building:
Start -> Programs -> Databases and SQL -> SQLyog
| MySQL Host Address | mysql.cms.livjm.ac.uk |
| User Name | your-mysql-username |
| Password | your-mysql-password |
| Database | your-mysql-username |
In MySQL each user has their own database, which for convenience is named the same as the username. You do not have the priveledges to create databases of your own.
4.9) Can I access MySQL from outside JMU ?
See the At Home section.
4.10) How do I change my MySQL password ?
In SQLyog type in the following into the window which has a 1 in it:
set password=password('xxxxx');
Substitute what you want your new password to be for xxxxx. Press F5 to run the SQL statement.
4.11) How can I access MySQL from my PHP script ?
There are 2 ways, the first is to use PHP's built in mysql_* functions.
<?php $conn = mysql_connect('mysql', 'cmpjblog', 'Your MySQL password'); if (!$conn) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_select_db("cmpjblog"); $query = "SELECT * FROM customers"; $result = mysql_query($query); // Check result // This shows the actual query sent to MySQL, and the error. Useful for debugging. if (!$result) { $message = 'Invalid query: ' . mysql_error() . "<BR>"; $message .= 'Whole query: ' . $query; die($message); } // Use result // Attempting to print $result won't allow access to information in the resource // One of the mysql result functions must be used // See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc. while ($row = mysql_fetch_assoc($result)) { echo $row['firstname']; echo $row['lastname']; echo $row['address']; echo $row['age']; } mysql_close($conn); ?>
The second uses PEAR functions. The PEAR way has the advantage in that the database API is the same no matter whether you use MySQL, Microsoft SQL Server, or several other database engines.
<?php include_once('DB.php') $dbtype = 'mysql'; // the type of database $dbhost = 'mysql.cms.livjm.ac.uk'; // hostname // You need to change the following to reflect your MySQL account details $dbuser = 'cmsdwynn'; // the username $dbpass = 'ithinknot'; // password $dbname = 'cmsdwynn'; // database // $dsn = "$dbtype://$dbuser:$dbpass@$dbhost/$dbname"; // Connect to database or die with an appropriate error message $db = DB::connect($dsn); if(DB::isError($db)) { die($db->getMessage()); } // // Change tablename to the name of your table $resultset = $db->query("SELECT * FROM tablename"); // // Make sure resultset is valid or die with an appropriate error message if(DB::isError($resultset)) { die($resultset->getMessage()); } // // Display the results as a table echo "<TABLE>"; // For each row of returned data while($row = $resultset->fetchRow(DB_FETCHMODE_ASSOC)) { echo "<TR>"; // This assumes you have fields called firstname and lastname in tablename echo "<TD>" . $row["firstname"] . "</TD>"; echo "<TD>" . $row["lastname"] . "</TD>"; echo "</TR>"; } echo "</TABLE>"; $db->disconnect(); ?>
Please contact a member of the Technical Staff if you have further questions
Last modified: 14-Mar-08