Hosting Web Pages

Our primary Unix system is configured to serve web pages to the world. You can get it to serve your own web pages if you set them up properly. The following outline gives you the highlights of what you have to do.

Brief Outline

  1. Make a directory named public_html right under your home directory.
  2. Make sure your home directory and the public_html directory have world read and world execute permissions.
  3. Make sure other directories in your account are not world readable.
  4. Put the web pages you want in your public_html directory.
  5. Visit these pages on the web at http://cs.baylor.edu/~your_login_name.

We also run a web server on our Windows NT server. If you prefer to work under NT, you may want to put your web pages here instead. Baylor even has a university-wide web server if you would like to use that.

Common Questions


Detailed Outline

  1. Make a directory named public_html right under your home directory.

    The following command should make the required directory for you.

      mkdir $HOME/public_html
    

    The web browser is configured to look in a public_html directory for each user account. This way, each user can serve their own html files without having to put them in some other place in the filesystem. Since all of our Unix machines share the same filesystem, you can build your web pages on any of our Unix hosts and the primary host will still serve them.

  2. Make sure your home directory and the public_html directory have world read and world execute permissions.
  3. Make sure other directories in your account are not world readable.

    As long you don't want any other files or directories in your home directory to be world readable, the following commands should set permissions appropriately.

      chmod 700 $HOME/*
      chmod 755 $HOME
      chmod 755 $HOME/public_html
    

    The first line makes it so that files and directories inside your home directory can't be ready by anyone other than yourself. This is probably a good idea since you don't want other students to look at things like copies of your homework assignments.

    The second line makes your home directory itself readable by everyone. The last line does the same thing for your public_html directory. This is necessary because the web server does not run with any special permissions. If regular users can't read your web pages, then the web server won't be able to read them either.

  4. Put the web pages you want in your public_html directory.

    You can edit your web pages with a regular text editor like vi or emacs. You can even make subdirectories under public_html to organize your website in a way that makes sense.

    Although we don't enforce any absolute restrictions on the amount of disk space you can use for web pages, we ask that you don't abuse this resource. If you take too much space, we may have to ask you to get rid of some things.

  5. Visit these pages on the web at http://cs.baylor.edu/~your_login_name.

    If you put a file named index.html in a directory, the server will use this file as the default when a browser visits that file's directory. A common trick is to make $HOME/public_html/index.html a symbolic link to your home page (say, $HOME/public_html/home.html), then users will get your home page whenever they visit http://cs.baylor.edu/~your_login_name.