Customizing Apache Services

MPDL This page will show you how to customize certain aspects of Apache Services.

Server Defaults
Putting the the following into file /etc/apache2/vhosts.d/default.conf will cause Apache to redirect all improper or non-handled requests to a single page or script:


 * 1) /etc/apache2/vhosts.d/default.conf
 * 2) default service
 * 1) default service
 * 1) default service

 Deny from all 
 * 1) default access

 CustomLog /var/log/apache2/default-access.log combined ErrorLog /var/log/apache2/default-error.log
 * 1) default service

DocumentRoot /srv/web/default

RewriteEngine On RewriteCond   %{REQUEST_URI} !^/$ RewriteRule  ^(.*)$ / [R=301,L]

 Allow from all   

Then /srv/web/default/index.php may give an error or warning message:

   

Be sure to have the appropriate apache modules loaded to make this simple task work.