| Nevis Web Setup Guide | This is a guide on to set up your web site at Nevis Labs. Enough information is provided to get you started. |
Note that in addition to the "personal web site" approach described below, there is also a Nevis Wiki available, if you need a shared web site or you just prefer the Wiki approach to website development.
| Setting up your account |
You need an account on the Linux cluster in order to have a web site at Nevis. All of your web pages must be put within a specific sub-directory of your account. The name of that sub-directory must be "WWW". If you don't already have such a directory, use the following command to create it:
| Creating your first web page |
Web pages are created using a language called "HTML" (Hyper-Text Markup Language). There is a wealth of information available on-line to teach you HTML. Some useful links are:
Anyone with experience with a document-design language such as LaTeX will have little trouble mastering HTML. In fact, you usually create your first HTML document the same way you create your first LaTeX document: copy someone else's and edit it. For your convenience, two sample files are provided. The first, template.html, is heavily commented and teaches some basic HTML syntax. The second, sample.html, shows the layout of a simple home page that was produced by editing template.html.To copy these files into your own area, use the following commands:
cd ~/WWW cp ~seligman/WWW/template.html . cp ~seligman/WWW/sample.html .Edit these files with your favorite text editor. Emacs has a special HTML mode that is invoked automatically when you edit any file that ends in ".html". If you type C-h m while editing an HTML file, you'll see a description of the special features of this mode.
| Viewing your web pages |
You can use your favorite Web browser to examine the contents of your HTML files. For example, after you've copied template.html to your area, you can see how it looks by telling your browser to look at the URL:
http://www.nevis.columbia.edu/~jsmith/template.htmlassuming that your login ID is jsmith. Note that you do not type in the directory name WWW -- the Nevis Web server supplies this automatically.
By default, if a Web browser accesses a directory at Nevis but is not supplied with a file name, it will look for a file named index.html. Once you've created the file that you plan to use for your home page, you should either rename it:
mv yourhomepage.html index.htmlor link it:
ln -s yourhomepage.html index.htmlIf you do so, then you can omit the file name when you tell other people the URL of your home page:
http://www.nevis.columbia.edu/~jsmith/If you're having problems creating or changing your web pages, check out the questions below.
| Additional tips |
cp ~zajc/WWW/index.html ~/WWW/zajc.html
However, not all web pages can be usefully viewed in this way. Many web pages are created using advanced Web server techniques, such as SSI, CGI programs, and Java. If a Web page is frame-based, you can view the HTML code that generated the frame itself, but you have to use "Frame Source" to view the HTML that generated the contents within the frame. Some Web pages were created with utilities (such as Microsoft's FrontPage) that don't format the HTML code so that it can be easily read by human beings.
At Nevis, we have a partial solution to this problem. A typical way to include an e-mail address in HTML is:
Send e-mail to <a href="mailto://jsmith@nevis.columbia.edu">jsmith@nevis.columbia.edu</a>Instead, use this:
Send e-mail to <a href="http://www.nevis.columbia.edu/cgi-bin/ewarn.pl?jsmith&nevis.columbia.edu">John Smith</a>On your web page, this will look like: "Send e-mail to John Smith." If you click on this link, it will display a warning page stating that the e-mail address is not to be used for advertising. Also, your e-mail address is less likely to be picked up by an automated program.
<a href="http://www.nevis.columbia.edu/cgi-bin/man.sh?man=gv">gv</a>This can be handy if you're writing a set of instructions to your students on how to do something in UNIX. Note that this only works for man pages that are available on the web server.
| Problems and Questions |
For an example of how to place a counter on a Web page, see Bill Seligman's home page at ~seligman/WWW/index.html. Documentation is available for the Counter program, which includes the ability to display the current date and time.
To make use of this feature, a systems administrator will have to create a file in directory ada:/home/www/etc/Counter/data with a name like jsmith_counter.dat.
The answer is the browser cache. To save time, Web browsers store copies of the most recently-accessed Web pages in a local disk cache. A new version of the same Web page is only reloaded when you explicitly tell the browser to do so. At the top of the browser window is button labeled "Reload". Click this button with the mouse, and the newest version of your Web page will be loaded.
Here are the things you should check:
The file index.html did not have read permission for all users, so the Web browser could not see it. Adding read permission to the file fixes the problem.
The URL for "stuff.html" would be http://www.nevis.columbia.edu/~jsmith/descript/stuff.html. In this situation, although the Web browser can display index.html and even display the contents of folder "descript", it will return an error when trying to access descript/stuff.html. This problem can be fixed as follows:
Now the Web browser will be able to access the contents of the "descript" directory.
Yes, you can. The following line, when placed as the first line of an HTML file, will cause the browser to automatically go forward to a new web page:
<meta http-equiv=refresh content=10;URL="http://www.nevis.columbia.edu/">The value after "content=" is the number of seconds that the browser should pause before automatically going to the Web address following "URL=". The above example will cause the browser to go to the Nevis Home Page after a ten-second delay. The delay allows you to display a message to the user (such as "Please update your browser bookmarks to this new URL..."). You can copy an example of a "forwarding" web page with the command:
If you want to see this in action, use the following URL: http://www.nevis.columbia.edu/webguide/transfer.html. Note that if you use a forwarding page, the "Back" button on your browser will take you back to the fowarding page, which will automatically forward you again. You can prevent an "infinite loop" by using the "Go" menu of your browser.
In Sep-2005 the Nevis web server was hacked due to a user's php script that did not check its inputs carefully enough. Since then, the policy has been to prevent php scripts from running from any user's directory.
This policy also applies to any executable scripts in a user's web site, whether in PHP, Perl, Python, Ruby, Java, or any other form of CGI programming. When properly written, such scripts are secure and highly useful in providing dynamic web content. Unfortunately, there's no easy way for us to guarantee that all users will write secure scripts, and we've made the choice of security over user convenience.
The trick is to set up a .htaccess and .htpasswd file in the directory that you wish to be protected. You can find instructions here.
It's possible that the htpasswd is not available on your machine. If not, let me know and I'll install it. (It's normally not part of a Redhat installation unless the machine is going to host a web server.)
Also, as you create your .htaccess file, bear in mind that your home directory is not in /home; it's your home directory as seen by the Linux cluster. Use the command:
to the Nevis Home Page.
Send any comments or questions to the
webmaster.