Using the wwwsrv collection to set up a web serverSCS Facilities maintains a "wwwsrv" misc collection that contains the files needed to set up an Apache web server (version 1.3.x) on a Facilitized Unix/Linux host.
- You are responsible for making sure that your web server does not serve any information that is not intended to be publicly available. In particular, you should not make arbitrary directories in AFS publicly available. Keep in mind that your workstation is probably a member of some AFS special as "system:friendlyhost") to which the main SCS web servers do not belong.
- If you will be writing or installing CGI scripts, be aware of the security issues with those scripts. See the CGI security FAQ [offsite link, will open in a new window] for details about some of the security issues with such scripts. Also, it's recommended that you use "IncludesNOEXEC" if you enable server-side includes.
Server installation and setup
To install the wwwsrv collection, you will need to perform the following steps as root. If you have not used root privileges on a Facilitized Unix/Linux host before, please see our documentation on local administration of Facilitized Unix/Linux hosts before proceeding.
- Subscribe to the wwwsrv collection. To subscribe to the wwwsrv collection, edit or create the file /etc/quirk.local. Either add a new line:
services=wwwsrvto the file, or add "wwwsrv" to the comma-separated list of existing services. Note: there can only be one "services" line. Adding a second line will not work.
- Make sure that you are using the right SUP distribution host. In order to use services collections, your SUP host must be dist.fac.cs.cmu.edu. To switch to this SUP host, create (or modify) the file /etc/disthost so that the contents of the file consist of the single line:
- Run dosupdepot. After you modify /etc/quirk.local, run /usr/local/bin/dosupdepot. Notes: You will need to run this command twice, since there are some interdependencies among files.
- Start the server. The web server runs under nanny, a "server babysitter" (run "man nanny" for more information). To start the server, you should run the following two commands:
/usr/local/etc/nanny -reconfigure /etc/nanny.confto have nanny recognize the new server, and
/usr/local/etc/nanny -restart httpdto have nanny start httpd.
Your web server is now ready to go.
As part of installation process, an entry for a "wwwsrv" user will be added to /etc/passwd if such an entry does not already exist. Some directories and files of note:
- This directory contains the configuration files for httpd
- This file contains a sample default configuration. It will automatically be copied to /etc/httpd/httpd.conf, which is the working configuration file, if that file does not exist. httpd.conf.example also contains extensive comments describing the web server configuration.
- This directory contains included configuration files for varius web server features.
- /usr/wwwsrv/htdocs/ & /usr/wwwsrv/cgi-bin
- Where the served documents and CGI scripts, respectively, are served from by default. The initial configuration script may attempt to symlink /usr/wwwsrv to /usr0/wwwsrv depending on whether or not these directories already exist.
- This directory is where the web server logs are stored by default
If you need to configure your server, you should edit /etc/httpd.conf to suit your needs. If your server needs to support SSL, you will need a web server certificate. To generate a certificate signing request (CSR) and request a signed certificate, see our instructions for generating a CSR.
The following off-site links will open in a new browser window: