San Diego State University

ROHAN Web Server - File/Directory Creation

----------------------------------------------------------------------

Create your HTML and/or Graphics Files

  • Test your pages to make sure all the links are working. Check for any abnormalities in various browsers (Firefox, Explorer, Lynx, etc.) and platforms (PC, MAC & UNIX). Check for grammatical errors, misspelled words and graphic alignments.

  • To view your page from a browser before it has been FTP'd to the web server, go to the File Menu and select Open File. Find and select your file from your hard drive. Your file will then be displayed in the browser.

  • Once everything is working okay, you might want to optimize the graphics you're using, so that they will take up less space and can be loaded faster. Some .gif images may be converted to .jpg format to save disk space.

----------------------------------------------------------------------

Create your CGI Script Files

Your cgi-bin scripts can be either shell or PERL scripts, as well as C programs. To work properly, the scripts' naming scheme must end in .cgi and their permissions must be set so they are executable by everyone. Place the script in your rohan.sdsu.edu account. To set the permissions, at the rohan% prompt, enter:

chmod 755 *.cgi

To begin using the script, reference the .cgi file as a linked item on your web page.

To write from cgi scripts to a ROHAN account, users must make the following modifications in their account:

  1. This requires using URLs with ~username, so be sure to have a sub-directory named public_html in your home directory. For more information, see Create your public_html sub-directory. The ~username links to the index.html file in the public_html sub-directory in your home directory.

  2. Store your CGI scripts in your public_html sub-directory. Example directory path for myscript.cgi in the nash account would be:

    /home/co/nash/public_html/myscript.cgi

    The URL for this would be:

    http://www-rohan.sdsu.edu/~nash/myscript.cgi

If you are in need of assistance with CGI scripting, a good starting point is: Perl CGI Programming FAQ

To view several working CGI examples on things like chat, bbs, database, and calendars, go to URL - http://rohan.sdsu.edu/~tgeorge.

----------------------------------------------------------------------

Create your public_html Sub-directory

To use the ~username in your URL, create a sub-directory named public_html in your home directory. This can be done via FTP or directly on ROHAN.


To create a sub-directory via FTP:

Your public_html sub-directory can easily be created using FTP programs such as Fetch and SSH.

When creating a public_html sub-directory via FTP, the ROHAN permissions should aleady be set correctly for this sub-directory. You will still need to SSH to ROHAN and set the permissions for your home directory. For instructions, see the web handout Permissions for Files/Directories.


To create a sub-directory via ROHAN:

  1. To create a sub-directory on ROHAN, SSH to ROHAN. At the ROHAN% prompt, enter:

    • mkdir public_html

    This will create a sub-directory named public_html.

  2. Set the permissions for the public_html sub-directory. Also see ROHAN Web Server - Permissions for Files/Directories for additional permission settings necessary for your home directory and the files you place in the public_html sub-directory. At the ROHAN% prompt, enter:

    • chmod 711 ~/public_html


Move or FTP all web related files and sub-directories into the new public_html sub-directory. This includes your index.html file. Once this is done, the URL for the ROHAN account will be:

http://rohan.sdsu.edu/~username/

The above URL will open the index.html located in the /home/public_html/ directory path.

NOTE: If you were previously using the old style URL:

http://rohan.sdsu.edu/linkdir/username/

where /linkdir is either /home, /course, /faculty, /staff, or /dept, you may want to make a file called index.html in your home directory which will immediately forward the user to your new style URL. The coding for this index.html file should be as follows:

<html>
<head>
<META HTTP-EQUIV="refresh" CONTENT="0; url=http://www-rohan.sdsu.edu/~username">
</head>
</html>
where username is replaced with your username.

----------------------------------------------------------------------


BACK  Guide To Making a Home Page on ROHAN