This page describes how to run your own apache HTTP daemon, for example if you have special needs regarding apache modules etc. ## Every page should have a table of contents <> In the following example an individual apache setup with [[http://www.modpython.org/|mod_python]] is described (as BenjaminHell does it for http://www.siebengang.net/). = Apache setup and startup = Get a working apache/mod_python installation (in your home dir), and set up a startup procedure, so that cron starts your daemon when mire reboots. In case the webserver process should crash, apache should be started again, too. The following shell script checks if apache is running and starts it if not (adjust the environment variables in the beginning accordingly): {{{ #!/bin/sh HOME=/afs/hcoop.net/user/...path to your home dir... # Adjust this!!! SERVERROOT=$HOME/apache2 # The server root directory PIDFILE=$SERVERROOT/logs/httpd.pid # Process PID gets stored here HTTPD=$SERVERROOT/bin/httpd # The httpd executable K5START="k5start -qtU -f /etc/keytabs/user.daemon/USER" # Adjust this!!! # This is needed for mod_python export PYTHONPATH="/afs/hcoop.net/user/b/be/beni/python" if (test -f $PIDFILE); then #if ($K5START -- test `ls $PIDFILE`); then PID=`cat $PIDFILE 2> /dev/null` kill -0 $PID 2> /dev/null if (test $? -ne 0); then $K5START -b -- $HTTPD -d $SERVERROOT -DFOREGROUND else exit 0 fi else $K5START -b -- $HTTPD -d $SERVERROOT -DFOREGROUND fi exit 0 }}} Save the script in a place like {{{$HOME/bin}}} and use cron to execute this script after reboots and every now and then to check if apache is still up and running (adjust capitalized parts): {{{ @reboot k5start -qtU -f /etc/keytabs/user.daemon/USER -- PATH_TO_SCRIPT 0-59/5 * * * * k5start -qtU -f /etc/keytabs/user.daemon/USER -- PATH_TO_SCRIPT }}} == Port issues == Your httpd must be configured so that it listens on a dedicated port. The standard port 80 won't work. We use a firewall to keep track of which ports members are using. Submit a firewall rule request on [[https://members.hcoop.net/portal/sec|the portal's security settings page]] to get Proxied``Server ports. Put a line like this into {{{httpd.conf}}} to configure apache so that it listens on this port only: {{{ Listen 8880 # Whatever port number you got }}} == mod_python specials == Apache needs to know where in the Python path to look for mod_python. You need to add the mod_python location to your PythonPath in {{{httpd.conf}}}: {{{ PythonPath "sys.path + ['/afs/hcoop.net/WHEREVER_MOD_PYTHON_IS_INSTALLED']"