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):

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
        exit 0

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

1. 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 the portal's security settings page to get ProxiedServer 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

2. 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:

<IfModule mod_python.c>
    PythonPath "sys.path + ['/afs/hcoop.net/WHEREVER_MOD_PYTHON_IS_INSTALLED']"