#! /bin/csh # # Install HTTP daemon # # This script works for regular BSD unix systems. It will not # necessarily work with fancy bells and whistles. # Check all the places where BSD is mentioned for differences for sys V # If your inted doesn't support running a daemon under other than root, # change the format of the inted.conf entry near the bottom # Tested on: NeXT_3.0 # # Supposed to work with NeXT netinfo. # Supposed to work with yp on the master yp server, NOT ON A SLAVE # On a slave. # # Read first then run it as root # Assumes binaries are in WWW_MACH directories parallel with Implementation/ # Running it more than once won't harm anything. # You can run it if the server is already partially installed, # and it will try to fix up what is missing. set prod = httpd set service = www set port = 80 set yes = 1 set no = 0 set signal_inetd = $no # Copy over daemon if ( "$WWW_MACH" == "" ) then echo You must first setenv WWW_MACH to give your machine type exit endif if ( -e ../$WWW_MACH/$prod ) then cp ../$WWW_MACH/$prod /usr/etc/$prod else echo There is no ../$WWW_MACH/$prod daemon executable file for $WWW_MACH echo Try making it first. exit 2 endif # Make home page if ( ! -r /Public ) mkdir /Public if ( -r /Public/welcome.html ) then echo /Public/welcome.html already exists .. not overwritten. else echo "
Server Manager EOF endif endif # Put $service into netinfo or /etc/service if necessary # netinfo services: if ( -d /etc/netinfo ) then echo You have netinfo, so we will use that. niutil -read . services/$service >/dev/null if ($status == 0) then echo Service $service defined already else niutil -create . services/$service signal_inetd = $yes endif niutil -createprop . services/$service port 80 niutil -createprop . services/$service protocol tcp else # real /etc/services file grep "^[^ \t]*[ \t]*$port/tcp" /etc/services >/dev/null if ($status == 0) then set service = ( `grep "^[^ \t]*[ \t]*$port/tcp" /etc/services` ) set service = $service[1] echo " Port 80 service is already defined as" $service else echo "Adding service $service on port $port" echo "$service $port/tcp # World-Wide Web information service" / >> /etc/services if ( -r /var/yp ) then echo You seem to have yellow pages. Rebuilding yp for services ( cd /var/yp; make ) echo If this doesn't work, try a reboot :-) endif endif endif # Put httpd into inetd.conf if not in already grep "^${service}" /etc/inetd.conf > /dev/null if ($status == 0) then set server = ( `grep "^${service}" /etc/inetd.conf` ) # check the index 6 below if not bsd echo $service daemon already defined to be $server[6] else cat <