Apache is a central component of the DISChosting system since it's administration and use is practically entirely web-based. But the setup of Apache does not require overly much customization.
We are using Apache 1.3.x. There is much to say for switching to Apache 2, because Apache 2 can store its configuration in LDAP. But several crucial components in PHP are still not working under Apache 2 now, so we will have to wait on that.
Instead of making Apache LDAP-aware, we decided to dump our virtual host information from LDAP to files. The files are stored in /var/apache/virtual.conf.d. If you want to know more about what we store in LDAP for virtual hosts, read this
On debian sarge, the cruxial packages to have installed are:
General apache configuration:
Include /etc/apache/httpd.namevirtualhosts Include /etc/apache/conf.d Include /var/apache/virtual.conf.d Include /etc/apache/httpd.redir |
/etc/apache/namevirtualhosts should contain:
NameVirtualHost 1.2.3.4:80 NameVirtualHost 1.2.3.5:80 |
Since your administration interface gives (almost) root access to your machine, setting it up through SSL is important. In the /examples directory, there is an example file to put in /etc/apache/conf.d for the admin SSL host. You will need to make SSL certificated yourself, as described here
To create a catchall for domain names that point to your server but are not configured, at this to /etc/apache/httpd.redir:
# do this for all ip numbers! |
Now apache is up and running. If not, read the stories below for more information!
(You can skip this if the installation above works for you)
To run DISC on your platform, you need to install Apache 1.3 (you can get it here. Of course - since DISCadmin is written in PHP, you need to install the Apache PHP4 modules (available here). Take care to include LDAP support when building PHP. You also need SSL support, so install mod_ssl (downloadable here). Since we want to pass on authentication information to LDAP, you also need the auth_ldap_module which is available here. Information on how to install and configure these modules can be found on the developer's pages, please refer to them for specifics. As always, we are only covering DISC specific settings. Using Debian you can simply install apache, php4, php4-ldap, libapache-mod-ssl and libapache-auth-ldap.
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so LoadModule ssl_module /usr/lib/apache/1.3/mod_ssl.so LoadModule auth_ldap_module /usr/lib/apache/1.3/auth_ldap.so |
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps |
Include /etc/apache/conf.d Include /var/apache/virtual.conf.d |
ServerAdmin webmaster@example.com DocumentRoot /var/www/ <Directory /var/www/webalizer> AddType application/x-httpd-php .html AllowOverride All php_flag register_globals off php_value include_path /usr/local/discadmin/php php_value auto_prepend_file /usr/local/discadmin/php/session.php </Directory> Alias /discadmin /usr/local/discadmin/php Alias /mail /usr/share/squirrelmail ServerName www.example.com ScriptAlias /cgi-bin/ /usr/local/apache/share/htdocs/cgi-bin/ SSLEngine on SSLCertificateFile /etc/apache/dischosting.nl.crt SSLCertificateKeyFile /etc/apache/dischosting.nl.key SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown CustomLog /var/log/apache/ssl_request.log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" </VirtualHost> |
<virtualhost 000.000.000.000:80> servername example.org serveralias www.example.org serveradmin webmaster@example.org documentroot /hosting/example.org/www/ customlog /hosting/example.org/logs/example.org-access.log combined errorlog /hosting/example.org/logs/example.org-error.log scriptalias /wws /usr/lib/cgi-bin/sympa/wwsympa.fcgi scriptalias /mailinglists /usr/lib/cgi-bin/sympa/wwsympa.fcgi alias /mail /usr/share/squirrelmail <directory /hosting/example.org/www/> allowoverride authconfig </directory> </virtualhost> |
attributetype ( 1.3.6.1.4.1.14287.1.1.2 NAME 'apacheServerName' SUP name DESC 'mod_cfg_ldap: Apache ServerName' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.14287.1.1.3 NAME 'apacheServerAlias' SUP name DESC 'mod_cfg_ldap: Apache ServerAlias' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) attributetype ( 1.3.6.1.4.1.14287.1.1.4 NAME 'apacheDocumentRoot' SUP name DESC 'mod_cfg_ldap: Apache DocumentRoot' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.14287.1.1.5 NAME 'apacheServerAdmin' SUP name DESC 'mod_cfg_ldap: Apache ServerAdmin' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.14287.1.1.6 NAME 'apacheVirtualHostIP' DESC 'IP address for Apache VirtualHost' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.14287.1.1.7 NAME 'apacheVirtualHostPort' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.14287.1.1.8 NAME 'apacheCustomLog' DESC 'The absolute path to the CustomLog file' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.14287.1.1.9 NAME 'apacheErrorLog' DESC 'The absolute path to the ErrorLog file EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) objectclass ( 1.3.6.1.4.1.14287.1.2.1 NAME 'apacheConfig' SUP 'top' AUXILIARY MUST ( apacheServerName $ apacheDocumentRoot $ apacheVirtualHostIP ) MAY ( apacheServerAlias $ apacheServerAdmin $ apacheCustomLog $ apacheErrorLog $ apacheVirtualHostPort ) ) |