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:

mkdir -p ~/WWW The only files that viewers will be able to see in your area are those within the WWW directory or in any sub-directories that you create.


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.html
assuming 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.html
or link it:
ln -s yourhomepage.html index.html
If 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


Problems and Questions

  1. How do I set up a counter to count the number of times people have accessed one of my web pages? Is there a way to put the current date and time on my Web page?

    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.

  2. "I've created a web page and viewed it with a browser. I made a change, then I look at it with the browser again -- but none of my changes have taken effect. Why?"

    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.

  3. "I created a .html file, but when I type in the URL, the Web browser tells me that the file isn't there or that I don't have permission to view it. What's wrong?"

    Here are the things you should check:

  4. I don't want to keep my Web pages at Nevis. But a lot of people start looking for my Web site at Nevis because they know my user id. Can I set up an automated process to refer them to my actual Web site?

    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:

    # cp ~seligman/WWW/transfer.html .

    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.

  5. I've created a php script for my web site, but it doesn't work. What's wrong?

    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.

  6. How do I "password protect" a directory so that only people with a password can access the directory with a web browser?

    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:

    # echo $HOME on the Linux cluster to see this path.


Back to the Nevis Computing Page.

Up to the Nevis Home Page.

E-mail: Send any comments or questions to the webmaster.