apache-perl

Running apache-perl as two independent processes

cp -av /etc/apache-perl /etc/apache-perl-other

modify the following lines in /etc/apache-perl-other/httpd.conf

ServerRoot /etc/apache-perl
ResourceConfig /etc/apache-perl/srm.conf
AccessConfig /etc/apache-perl/access.conf
LockFile /var/lock/apache-perl.lock
PidFile /var/run/apache-perl.pid

Listen 8485

NameVirtualHost localhost:8485

<VirtualHost localhost:8485>
    ServerName localhost
    DocumentRoot /home/fek/public_html/
    ErrorLog /var/log/apache-perl/error.log
 </VirtualHost>
     <Directory /home/fek/public_html>
        <Files ~ "\.xhtml$">
            PerlRequire /home/fek/public_html/InfoPM/startup.pl
            SetHandler              perl-script
            PerlInitHandler         Apache::Reload
            PerlHandler             InfoPM::Page
        </Files>
    </Directory>

Some configurations can probably be shared between the processes:

Include /etc/apache-perl/conf.d
Include /etc/apache-perl/modules.conf

Copy and modify the start/stop script

cp /etc/init.d/apache-perl /etc/init.d/apache-perl-other

The /etc/init.d/apache-perl script in Debian etch has a bug, it does not use $CONF when starting the server, only when it tests the configuration files. So, in addition to the following two lines:

NAME=apache-perl-other
DAEMON=/usr/sbin/apache-perl

I also had to modify all lines like this one (for start, restart and reload).

if $ENV $SSD --start --pidfile $PIDFILE --exec $DAEMON --oknodo > /dev/null; then

to read

if $ENV $SSD --start --pidfile $PIDFILE --exec $DAEMON --oknodo -- -f $CONF > /dev/null; then

Now I had two processes listening at different ports.

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: oktober 17, 2019