welcome: please sign in

The following 255 words could not be found in the dictionary of 7 words (including 7 LocalSpellingWords) and are highlighted below:
about   accordingly   add   addresses   adjust   Adjust   afs   after   again   all   an   and   Apache   apache   apache2   are   as   backgrounding   be   beginning   beni   Benjamin   bin   bog   bug   Bugzilla   bugzilla   but   can   capitalized   care   case   cat   Category   cgi   check   checks   completed   conf   config   configure   configured   consider   Contents   crash   cron   daemon   dedicated   default   denied   described   describes   detaches   dev   dir   directory   do   does   doing   domain   domtool   don   else   end   environment   etc   every   example   executable   execute   exit   export   fi   file   firewall   following   for   forwarding   from   get   Get   gets   got   has   have   hcoop   Hell   here   home   how   However   html   http   httpd   https   id   if   If   impossible   in   In   index   individual   installation   instead   into   is   issues   it   its   K5   k5start   keep   keytabs   kill   know   like   line   Listen   listens   location   logs   look   looks   Mail   make   Manual   mapped   may   Member   members   mire   mod   modpython   Module   modules   must   ne   need   needs   net   Next   not   now   null   number   Of   of   omitted   on   only   option   org   our   own   page   parent   parts   Pass   Path   path   permission   permissions   pid   place   port   Port   portal   ports   Possible   prevents   problems   procedure   Process   process   Proxied   proxy   Put   python   qt   reboot   reboots   regarding   renew   request   requests   Reverse   right   root   rule   run   running   Save   script   sec   security   see   server   Server   set   settings   setup   shell   should   show   siebengang   so   special   specials   standard   started   starts   startup   still   stored   stuff   Submit   sys   Table   take   test   That   that   The   the   then   This   this   through   tickets   to   too   track   up   use   user   using   variables   We   web   webserver   Whatever   when   where   which   with   won   work   working   would   www   You   you   Your   your  

Clear message


This page describes how to run your own apache HTTP daemon, for example if you have special needs regarding apache modules etc.

In the following example an individual apache setup with mod_python is described (as BenjaminHell does it for http://www.siebengang.net/).

1. 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.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

1.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']"

2. domtool config

Next you need "port forwarding" of http requests for your domain to your own httpd (so that you don't need to use addresses like http://www.siebengang.net:8880/index.html, but http://www.siebengang.net/index.html gets "mapped" to port 8880). In the domtool setup for http://www.siebengang.net/ this looks like

domain "siebengang.net" with
  (* NS/DNS/Mail stuff omitted *)
  web "www" with
    proxyPass "/" "http://bog:8880/";
    proxyPassReverse "/" "http://bog:8880/";

That should be about all you need...

3. Possible AFS problems

In our AFS environment apache has to be started through k5start to get the right file permissions. However, as a default, httpd detaches from its parent process after the completed startup. This would make it impossible for k5start to renew AFS tickets for the process. The -DFOREGROUND option prevents apache from doing so, and with -b k5start can take care of the backgrounding instead.

If you do not consider this, you may run into "permission denied" problems (see Bugzilla bug 291).


RunningYourOwnApache (last edited 2013-01-14 07:25:26 by ClintonEbadi)