SuPHP sur Fedora 7 ou CentOS 5 avec ISPConfig
Ce document décrit comment configurer suPHP sur Fedora 7 ou CentOS 5 avec ISPConfig. Il repose sur des parties du guide HowTo Set Up suPHP On A Debian Etch Based ISPConfig Server de Hans.
Le système résultant prendra en charge suPHP avec ISPConfig.
Ce guide est conçu comme un guide pratique ; il ne couvre pas les arrière-plans théoriques. Ils sont traités dans de nombreux autres documents sur le Web.
Ce document est fourni sans garantie d'aucune sorte ! Je veux dire que ce n'est pas la seule façon de mettre en place un tel système. Il existe de nombreuses façons d'atteindre cet objectif, mais c'est la voie que je prends. Je n'émets aucune garantie que cela fonctionnera pour vous !
1 Configurer le système de base
Configurez un système de base comme base.
Si vous souhaitez utiliser Fedora 7, suivez le Howto ThePerfect Server - Fedora 7 de Falko Timme.
Sinon, si vous souhaitez utiliser CentOS 5, suivez le Howto ThePerfect Setup - CentOS 5.0 (32-bit) de Falko Timme.
Après cela, configurez ISPConfig.
Téléchargez-le sur http://www.ispconfig.org. Une documentation détaillée y est bien sûr disponible.
2 Désactiver le module PHP
vi /etc/httpd/conf.d/php.conf
Commentez "LoadModule php5_module modules/libphp5.so"
3 Installer PHP en tant que Cgi
yum install php-cli
4 Obtenir et personnaliser SuPHP
cd /tmp
wget http://www.suphp.org/download/suphp-0.6.2.tar.gz
tar xvfz suphp-0.6.2.tar.gz
vi suphp -0.6.2/src/apache2/mod_suphp.c
Remplacez les lignes 324/325 par ces deux lignes ci-dessous (si vous utilisez une version différente de suPHP, les numéros de ligne peuvent être différents) :
AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler,NULL, RSRC_CONF | ACCESS_CONF, "Dit à mod_suphp de gérer ces types MIME"),
AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler,NULL, RSRC_CONF | ACCESS_CONF, "Dit à mod_suphp de ne pas gérer ces types MIME"),
Maintenant, nous préparons et installons suphp :
cd suphp-0.6.2/
./configure --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config--with-apxs=/usr/sbin/apxs --with-apache-user =apache --with-setid-mode=paranoid--with-php=/usr/bin/php-cgi --with-logfile=/var/log/httpd/suphp_log --enable-SUPHP_USE_USERGROUP=yes
faire
faire installer
5 Configuration de Suphp
vi /etc/suphp.conf
Devrait ressembler à ceci :
[global] ;Path to logfile logfile=/var/log/httpd/suphp_log ;Loglevel loglevel=info ;User Apache is running as webserver_user=apache ;Path all scripts have to be in docroot=/ ;Path to chroot() to before executing script ;chroot=/mychroot ;Security options allow_file_group_writeable=true allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false ;Check wheter script is within DOCUMENT_ROOT check_vhost_docroot=true ;Send minor error messages to browser errors_to_browser=false ;PATH environment variable env_path=/bin:/usr/bin ;Umask to set, specify in octal notation umask=0077 ;Minimum UID min_uid=100 ;Minimum GID min_gid=100 [handlers] ;Handler for php-scripts x-httpd-php=php:/usr/bin/php-cgi ;Handler for CGI-scripts x-suphp-cgi=execute:!self
6 Configuration d'Apache
vi /etc/httpd/conf.d/suphp.conf
Insérez la ligne suivante :
LoadModule suphp_module modules/mod_suphp.so
7 Configuration ISPConfig
vi /home/admispconfig/ispconfig/lib/config.inc.php
Modifier :
$go_info["server"]["apache2_php"] = 'both';
À :
$go_info["server"]["apache2_php"] = 'suphp';
Après cela, redémarrez le serveur Web Apache :
/etc/init.d/httpd restart
Vous devez maintenant modifier un site Web dans ISPConfig.
Cela initiera ISPConfig pour écrire un nouveau fichier vhost avec le support suPHP.
Après cela, ISPConfig devrait fonctionner correctement avec suphp.
8 liens
- Le serveur parfait - Fedora 7 :http://www.howtoforge.org/perfect_server_fedora7
- La configuration parfaite - CentOS 5.0 (32 bits) :http://www.howtoforge.org/perfect_setup_centos5.0
- ISPConfig :http://www.ispconfig.org
- suPHP :http://www.suphp.org