Table of Contents
Configurer Apache pour les sites hébergés
Installation de mod_hash
- créer le fichier:
/etc/apache2/mods-available/vhost_hash_alias.conf
- Copier cet exemple de fichier dans vhost_hash_alias.conf
# mod_vhost_hash_alias have to be enabled for each virtual host (catch-all) # HashEnable On # # Digest algorithm to use: # CRC32, ADLER32, MD5, SHA1, SHA256, or other types # supported by the module and libmhash # HashType md5 # # The output encoding (rfc3548) of hash result # hexa, base16_low, base16_up, base32_low, base32_up, base64_ufs, # HashEncoding hexa # # Number of characters to use to build the document root # The hash string is truncated to this length # HashLimit 6 # # Splitting scheme # Specify the size of each chunk of the digest string # The last count is taken until the end of string is reached # HashSplit 2 2 2 # # The base directory used to build the document root # (mandatory) # HashDocumentRootPrefix /data/web # # A directory added to the final built root # (optionnal) # HashDocumentRootSuffix htdocs # # A list of host prefix to strip # eg: this handle basic web aliasing # http://www.example.com/ # will point on the same document root than # http://example.com/ # # (optionnal) # HashAddAliasPrefix www ftp
- charger le module dans apache2
a2enmod vhost_hash_alias
puis recharger apache2
/etc/init.d/apache2 reload
Configuration d'un site hors Vhffs
Pour configurer un hôte virtuel dont l’url ne doit pas être “hashée” par le module vhost hash alias, il faut dans la configuration du vhost:
<VirtualHost *:80>
[...]
HashEnable Off
[...]
</VirtualHost>
Installation de suphp
Site de référence: http://www.suphp.org/
Le fichier de configuration de suphp se trouve dans
/etc/suphp/suphp.conf
Les principales modifications à faire sont:
docroot=/data/web allow_file_group_writeable=true allow_directory_group_writeable=true check_vhost_docroot=false min_uid=10000 min_gid=10000
Dans la config du virtual host par défaut, placer
<IfModule mod_suphp.c>
AddHandler x-httpd-php .php .php3 .php4 .php5 .phtml
suPHP_AddHandler x-httpd-php
suPHP_Engine on
</IfModule>
N’oubliez pas d’activer le mode suphp:
a2enmod suphp