Apache
Uit DeVliegendeWiki
Dit artikel gaat alleen over Apache2.
De systeemconfiguratie staat in /etc/apache2/apache2.conf. Eigen aanpassingen zou je het beste kunnen plaatsen in /etc/apache2/httpd.conf. Dit bestand is tegenwoordig standaard leeg.
CleanURLs configureren
CleanURLs werkt via de ModRewrite-module. Gebruik commando
apache2ctl -M
om te zien of deze module al is geïnstalleerd. Indien dat niet het geval is, voeg 'm toe middels
a2enmod rewrite
en configueer 'm door in /etc/apache2/httpd.conf toe te voegen:
<Directory /var/www>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
Indien je een multisite hebt, dus een mappenstructuur met daarin verschillende Drupal-sites, dan moet je voor elke Drupal-installatie bovenstaande code toepassen. Voorbeeld:
<Directory /var/www>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
<Directory /var/www/slangenboren>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
Herstart Apache middels
/etc/init.d/apache2 restart
Deze procedure heeft voor mij gewerkt op een eigen ontwikkelmachine, juni 2010. Bron: http://drupal.org/node/15365
Overzicht van geïnstalleerde modules
root@gyor:~# apache2ctl -M
Voorbeeld van output van een installatie middels apt-get install lamp^:
Loaded Modules: core_module (static) log_config_module (static) logio_module (static) mpm_prefork_module (static) http_module (static) so_module (static) alias_module (shared) auth_basic_module (shared) authn_file_module (shared) authz_default_module (shared) authz_groupfile_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) cgi_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) mime_module (shared) negotiation_module (shared) php5_module (shared) reqtimeout_module (shared) setenvif_module (shared) status_module (shared)
