NextStep HTTP Server Configuration Page

I've seen several people ask 'How do I setup a HTTP server on my NS machine?'. Well, since I've done this with machines using NetInfo, I'd thought a page was in order. If you follow the instructions that come with your package and these instructions, things should work just fine. I'm no unix expert, but got things up and running. Thanks go to Christian Neuss for his article in the summer 1995 volume of Next In Line.

Preliminaries

First of course is to obtain the server software. The two packages I've loader were NCSA 1.4.2 from ftp://ftp.ncsa.uiuc.edu and Apache 1.1.1 from www.apache.org. www.apache.org

In both packages you make some minor changes to one of two files.

Now type make in the source directory. From here on use the root account.

Setting up the production directories

You should have ended up with an executable file called httpd in your source directory. The default directory location for this file is /usr/local/etc/httpd. The path to the executable would then be /usr/local/etc/httpd/httpd. You may have to create some of these directories. Several directories now in your source location should also be copied to the /usr/local/etc/httpd directory. They are /conf, /icons, /logs, and /cgi-bin. If they are not there to be copied, then create them. The /cgi-src directory with NCSA contains extra tools that may be handy to compile and add to the new /cgi-bin directory. One recommended tool is imagemap.

Setting up INETD

There are two modes to run the HTTP servers in. The first is called standalone and is normally used if you expect to have a high server load. The second mode uses inetd to start up the server when ever a request comes in to use it. We will use the second mode here.

1)
In order for the inetd daemon to accomplish this task, we must add a line at the end of the /etc/inetd.conf file. It is one big line with tabs (may not matter) where you see spaces here. The -f <filename> causes the appropriate httpd.config file to be used.
Here is what I entered. The first is a comment:

# HTTP Web server
www stream tcp nowait uucp /usr/local/etc/httpd/httpd httpd -f /usr/local/etc/httpd/conf/httpd.conf

2a)
If you run with NetInfo, use NetInfoManager to select servcies, then create a subdirectory with the following contents:

	name		www
	port		80
	protocal	tcp
	

2b)
I have not confirmed the following; If you run with NIS (network information service) then add the following line to /etc/services:

www 80/tcp # HTTP service (World Wide Web)

3)
Now reboot your machine and see where you stand in this process.
OR
At the unix command line type: kill -HUP <the PID for inetd>
To get the PID first type: ps -x | grep inetd
The number on the left is the PID.

Configuring your new Server

There are three main files to configure. From here on in, just follow the installation instructions from your package. They tend to explain, very well, what to do next.

Extra Notes Before You Start

The path that the httpd code sits in is hard coded in the Apache release and likely is hard coded in the NCSA package also. If you wish to run two HTTP copies then you'll need two locations (or unique executable names) to contain them in. I choose /usr/local/etc/HTTP/Apache and /usr/local/etc/HTTP/NCSA. These paths are reflected in my /etc/inetd.conf file. To have two usable copies, requires that each copy have it's own port setting. The first is usually 80 and the second is usually 8080.