Web Publishing

How do I publish my web pages on the department WWW server? Do we sftp to compserv(N) or 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 servers called "Compute servers". The compute servers are a group of Sun Solaris machines called "compserv1" .. "compserv4" and Linux i386 machines called compute1 and compute2.

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 compserv.cs.sunysb.edu or 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
$ 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 'compserv.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 compserv
    • 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.stonybrook.edu/~login 
For example http://www.cs.stonybrook.edu/~foo
home directory/public_html 
For example /home/stufs1/foo/public_html
cgi pages http://www.cs.stonybrook.edu/login-cgi-bin 
For example http://www.cs.stonybrook.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 compserv
  • You may log into compserv 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. CGI access may be revoked if it may introduce a potential security vulnerability
  • 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.
  3. CGI is NOT enabled by default. You will need to make an RT request to have CGI enabled and justify the need for CGI to be enabled. Your CGI cannot produce a direct or indirect security vulnerability for WWW.