Web Publishing

Back to Technical FAQ
How do I publish my web pages on the department WWW server? Should we ftp to the compute(N) or directly to the web server?

The Web content located in /home/[fs2..fs9, facfs1, stufs1, courses, cou etc.] is available by logging on the server called "Compute server". Compute server is a cluster of various old servers called "compservs" and the newer compute servers.

You can edit the web content using ssh or any website editing tool like Dreamweaver. To edit your Web content, using ssh, you should log into compute.cs.sunysb.edu on port 130. You will now be in your home directory. The location of your Web content is your home directory prefixed by "www" (/www/$HOME/public_html). For example, after a faculty member 'foo' successfully connects to the server, they can edit their home page as follows:

$ echo $HOME
/home/facfs1/foo
$ cd /www$HOME/public_html
$ vi index.html

Copying from your desktop to /www/$HOME/public_html should be done using sftp (not ftp).

If you choose to publish using tools like Dreamweaver, you must first set up a site in Dreamweaver. Using the above "foo" user example, set up a Dreamweaver site as follows:

  1. Select Site > Manage Sites. The Manage Sites dialog box appears.
  2. Click the New button and select Site. The Site Definition dialog box appears.
  3. Do one of the following:
    • Click the Basic tab to use the Site Definition Wizard, which steps you through the setup process. You will specify any name for your site and the URL for your site (e.g. http://cs.sunysb.edu/~foo)
    • Click the Advanced tab to use the Advanced settings, which enable you to set up local, remote, and testing folders individually
  4. Advanced tab to use the Advanced settings, which enable you to set up local, remote, and testing folders individually, as necessary.
    • Select "FTP" to connect to your remote server
    • Host name of your web server will be 'compute.cs.sunysb.edu:130'
    • Folder on the server, where your files are stored will be (eg: /www/home/facfs1/foo/public_html)
    • Your FTP login is your userid for the compute server
    • Use secure FTP (SFTP) box must be checked.
  5. Complete the Dreamweaver site setup process

Below are some directory settings to note for your Web Page:

  • Make a directory called public_html in your home directory. Make sure that you have world readable on this directory and its contents otherwise you will not be able to view your files.
  • Within your 'public_html' directory an 'index.html' file will be the starting point for your web pages.
  • In addition, ensure that the user's home directory is searchable, and that their 'public_html' dir is readable:
    $ chmod a+rx /www$HOME /www/HOME/public_html
  • Your cgi scripts go in your home directory under a directory called cgi-bin (eg: www/home/stufs1/name/cgi-bin). The directory and its contents have to be world readable (not world writable). If your cgi-bin is not in the specified location, then create a symlink called "cgi-bin" in your home directory to point to the location of your cgi-bin.
  • At this point the process is: edit your stuff (html or cgi on any departmental machine) and point your browser at /~<your login> to verify the results.
Servers / Machines www.cs.sunysb.edu compute servers
html pages http://www.cs.sunysb.edu/~login
For example http://www.cs.sunysb.edu/~foo
home directory/public_html
For example /home/stufs1/foo/public_html
cgi pages http://www.cs.sunysb.edu/login-cgi-bin
For example http://www.cs.sunysb.edu/foo-cgi-bin
home directory/cgi-bin
For example /home/stufs1/foo/cgi-bin

Publishing on www (copying files, cgi script changes)
  • You may work on your desktop local folders and publish using tools like Dreamweaver to upload the files using SFTP to your home directory on compute
  • You may log into Compute and edit your web pages directly in your home folder
  • You should write and test your html pages or cgi files on www2 server. CGI access on www is not for the purpose of running experiments. www is the department production web server
  • Review your web pages by pointing your browser at www.cs.sunysb.edu Hopefully, at this point all is well and you're done.

CGI Tips

  1. The path for perl is /usr/bin/perl. The very first line of your cgi script must begin with #!/usr/bin/perl
  2. Make sure that the directories have 755 permission, so that the webserver can read and execute them. You can keep the upper level directories as 711 for additional protection.


Department of Computer Science • Stony Brook University, Stony Brook, NY 11794-4400 • 631-632-8470 or 631-632-8471