( Latest revision 02/08/2013 )

How To Publish A Web Page on The CS Lab Server


  1. In your home directory on one of the Computer Science Department Mac OS X computers, create a sub-directory named
    public_html
  2. Make it world-readable:
    chmod 755 public_html
  3. Put your web page in the directory:
    mv blahblah.html public_html
  4. Make your web page world-readable:
    chmod 644 public_html/blahblah.html
  5. (If your web stuff includes many pages and files you have to make them all world-readable.)

  6. Look around in your home directory and figure out which files and directories there should be private. Use the
    ls -l
    command to see the permissions on your files and directories.

  7. If you have files or directories in your home directory that contain information that should be kept private then make sure now that the permissions on those files allow access only to you. A file that needs to be private should have permission bits that look like one of these:
    -r--------
    -rw-------
    -rwx------
    A directory that needs to be private should have permission bits that look like this:
    drwx------
    To make changes that are needed use commands such as these:
    chmod go-rxw myPrivateLetterToMyFriend.txt
    chmod go-rxw myDirectoryOfClassProjects
    chmod go-rxw myPrivateInfoDirectory
    
    The commands above prevent people in your group (students) and others from gaining access to myPrivateLetterToMyFriend.txt, myDirectoryOfClassProjects, and myPrivateInfoDirectory.

  8. You now have to make your home directory world-readable, because your home directory is on the path from the root of the file system to your public_html directory. By now you have protected your private files according to the directions in the previous step, so the risk of opening up your home directory is minimal. Execute this command:
    chmod go+rx ~
    (The tilde: ~ is important - it means "my home directory".)

  9. Open a web browser on any host connected to the Internet.

  10. Suppose that your username is joeuser and you want to access (via the web) a file inside your public_html directory named blahblah.html. You do that by opening the following URL in your browser:
    http://hopper.csustan.edu/~joeuser/blahblah.html
    This works because a web server runs on the host hopper.csustan.edu and it maps the path ~joeuser/blahblah.html to ~joeuser/public_html/blahblah.html.

  11. If joeuser has a file named index.html in his public_html directory, we can just use a URL like this to access it:
    http://hopper.csustan.edu/~joeuser