<ADDRESS>Apache/1.3.34 Server at localhost Port 80</ADDRESS>
En modifiant dans votre httpd.conf
ServerSignature Off
Remplacer :
API_EXPORT(const char *) ap_get_server_version(void) { return (server_version ? server_version : SERVER_BASEVERSION); }
par :
API_EXPORT(const char *) ap_get_server_version(void) { return ""; }
Cacher l'OS :
Dans configure.in, remplacez :
*) PHP_UNAME=`uname -a | xargs` AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output]) PHP_OS=`uname | xargs` AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output]) ;; esac
En :
*) dnl PHP_UNAME=`uname -a | xargs` PHP_UNAME="Unix" AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output]) dnl PHP_OS=`uname | xargs` PHP_OS="Unix" AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output]) ;; esac
Dans ext/standard/info.c, remplacez :
#ifdef HAVE_SYS_UTSNAME_H ... #else php_uname = PHP_UNAME; #endif
par :
/*#ifdef HAVE_SYS_UTSNAME_H ... #else*/ php_uname = PHP_UNAME; /*#endif*/
Compilation :
./configure \ --prefix=/usr/local/apache \ --enable-module=unique_id \ --enable-module=rewrite \ --enable-module=speling \ --enable-module=expires \ --enable-module=info \ --enable-module=log_agent \ --enable-module=log_referer \ --enable-module=usertrack \ --enable-module=proxy \ --enable-module=userdir \ --enable-module=so \ --enable-suexec=shared \ # suExec compilé en tant que module dynamique (permet de le désactiver/supprimer en cas de problème) --suexec-caller=nobody \ # Utilisateur sous lequel tourne Apache (il aurait fallu recréer un compte pour Apache) --suexec-docroot=/usr/local/apache/htdocs \ # La racine web --suexec-logfile=/var/log/apache_suexec \ # Le fichier de log dédié à ce module --suexec-userdir=www \ # Nom du répertoire utilisateur (défaut public_html) --suexec-uidmin=1000 \ # UID minimum requis --suexec-gidmin=1000 \ # GID minimum requis --suexec-umask=077 \ # ? --suexec-safepath="/usr/local/bin:/usr/bin:/bin" # Défini le PATH (ici la valeur par défaut)
cd wget http://www.suphp.org/... tar xzf suphp-<version>.tar.gz -C /usr/local/src cd /usr/local/src/suphp-<version> ./configure \ --prefix=/usr/local/suphp \ --disable-checkpath \ # Les alias et userdir ne fonctionnent plus sans --with-apxs=/usr/local/apache/bin/apxs \ --with-min-uid=1000 \ --with-min-gid=1000 \ --with-apache-user=nobody \ --with-logfile=/var/log/suphp \ --with-setid-mode=paranoid # Debian utilise : ./configure \ --prefix=/usr \ --sysconfdir=/etc/suphp \ --with-apxs=/usr/bin/apxs2 \ --with-apache-user=www-data \ --with-php=/usr/bin/php5-cgi \ --sbindir=/usr/lib/suphp \ --with-setid-mode=owner \ --with-logfile=/var/log/suphp/suphp.log make make install
Dans le fichier httpd.conf :
LoadModule suphp_module libexec/mod_suphp.so
AddHandler x-httpd-php .php suPHP_AddHandler x-httpd-php suPHP_Engine on
Configurer suPHP (fichier /usr/local/suphp/etc/suphp.conf) :
[global] ;Path to logfile logfile=/var/log/suphp.log ;Loglevel loglevel=warn ;User Apache is running as webserver_user=nobody ;Path all scripts have to be in ;docroot=/usr/local/apache/htdocs ; Security options allow_file_group_writeable=true allow_file_others_writeable=false allow_directory_group_writeable=false allow_directory_others_writeable=false ;Check wheter script is within DOCUMENT_ROOT ;check_vhost_docroot=true check_vhost_docroot=false ;Send minor error messages to browser ;errors_to_browser=false errors_to_browser=true ;PATH environment variable env_path=/bin:/usr/bin ;Umask to set, specify in octal notation umask=0077 ; Minimum UID min_uid=1000 ; Minimum GID min_gid=1000 [handlers] ;Handler for php-scripts x-httpd-php=php:/usr/local/php5/bin/php ;Handler for CGI-scripts ;x-suphp-cgi=execute:!self
cd wget URL_DU_PATCH gunzip suhosin-patch-versionPHP-versionPatch.patch cd /usr/local/src/php-<version> patch -p1 < /root/suhosin-patch-versionPHP-versionPatch.patch
Pas de changement si le module suhosin est compilé dynamiquement !!!
cd /usr/local/src/php-<version> ./configure [toutes vos options ici] make make install
L'extension suhosin compilée après :
cd wget URL_EXTENSION tar xzf suhosin-<version>.tgz cd suhosin-<version> phpize ./configure make make install
cd wget URL_EXTENSION tar xzf suhosin-<version>.tgz -C /usr/local/src/php-<version>/ext/ ln -s /usr/local/src/php-<version>/ext/suhosin-<version> /usr/local/src/php-<version>/ext/suhosin cd /usr/local/src/php-<version> ./buildconf --force ./configure [toutes vos options ici] --enable-suhosin make make install