6. Installing Apache

mod_perl.  FotoBilder requires Apache 1.x with mod_perl 1.x installed; we recommend using mod_perl statically linked to your Apache binary, as in our experience the mod_perl DSO is less than stable[3]. In Debian, the package that provides mod_perl and Apache together is apache-perl; for other systems, consult the “ mod_perl Installation Guide ”.

Apache suEXEC Support.  If you want the FotoBilder code to run as a user other than what your webserver runs as, then you'll need suEXEC[4] support in Apache. You're free to figure that out yourself – we'll assume your webserver is running as user www-data.

Virtual Hosts.  You can run the FotoBilder code inside or outside of a <VirtualHost> section in Apache's httpd.conf file. However, make note that you can't (yet) have two VirtualHosts running parallel copies of the code. In the future we'll fix that, but for now if you really need two installations on the same machine, you'll need to run two sets of Apache processes, listening on different ports.

6.1. Example httpd.conf

ServerType standalone
ServerRoot "/etc/apache-perl" 
PidFile /var/run/apache-perl.pid
ScoreBoardFile /var/run/apache-perl.scoreboard
Timeout 30
KeepAlive Off

MinSpareServers 5
MaxSpareServers 40
StartServers 10
MaxClients 20
MaxRequestsPerChild 500

LoadModule mime_module        /usr/lib/apache/1.3/mod_mime.so
LoadModule autoindex_module   /usr/lib/apache/1.3/mod_autoindex.so
LoadModule dir_module         /usr/lib/apache/1.3/mod_dir.so

Port 80
User www-data
Group www-data

SendBufferSize 131072

ServerName   fb.example.com
PerlSetEnv   FBHOME /home/fb
PerlRequire  /home/fb/lib/startup.pl

Note

This will work by itself (assuming mod_perl statically linked), or you can just tack on parts to your existing config.

/home/fb is only an example directory. You'll want to use the same directory used in (FIXME: link).

If you'd like, you can put those last three lines in a VirtualHost block.



[3] Consult “ mod_perl Installation User Guide: When DSO Can Be Used” for more information.