====== Apache (httpd) ====== Sur les serveurs web en général: [[/informatique/httpd|/informatique/httpd]] [[http://www.apachefrance.com/Manuels/Apache_1.3/|Manuel en français]]. [[:informatique:apache:installation|Installer Mod_SSL/Apache/Php]]. Le module [[/informatique/apache/mod_ssl|Mod_SSL]]. Une bonne présentationFR des modules mod_cache, mod_disk_cache, mod_mem_cache, mod_file_cache : [[http://www.lephpfacile.com/manuel-apache/caching.php|Guide de la mise en cache]]. ===== Sécurité ===== ==== Apache en Chroot ==== [[http://www.zdnet.fr/builder/programmation/technologies_web/0,39021000,39138765,00.htm|Combiner Apache et la commande chroot]] [[http://www.faqs.org/docs/securing/chap29sec254.html|Apache in a chroot jail]] from "[[http://www.faqs.org/docs/securing/index.html|Securing and Optimizing Linux: RedHat Edition - A Hands on Guide]]" Une série sur www.cyberciti.biz: * [[http://www.cyberciti.biz/tips/chroot-apache-under-rhel-fedora-centos-linux.html|Red Hat / CentOS: Chroot Apache 2 Web Server]] * [[http://www.cyberciti.biz/tips/rhel-centos-apache-chrootjail-virtual-hosting.html|Apache Chroot Jail: Virtual Hosting]] * [[http://www.cyberciti.biz/tips/howto-setup-lighttpd-php-mysql-chrooted-jail.html|Lighttpd FasCGI PHP, MySQL chroot jail installation under Debian Linux]] ==== Slowloris ==== [[http://www.securityvibes.com/slowloris-apache-ddos-consultants-securite-jsaiz-news-3003269.html|Slowloris, l'attaque du paresseux]] Rédigé par Jerome Saiz (SecurityVibes) (2009-06-22). Le point sur l'outil d'attaque Apache Slowloris avec les consultants de HSC et XMCO, et les premiers retours d'expérience pour s'en protéger. [[http://www.howtoforge.com/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny|How To Defend slowloris DDoS With mod_qos (Apache2) ]] MarcusSpiegel (2009-07-15) ===== PHP App Server ===== ==== mod_php ==== ==== PHP-FPM (FastCGI Process Manager) ==== http://php.net/manual/fr/install.fpm.php http://php-fpm.org ==== mod_fcgid ==== [[http://httpd.apache.org/mod_fcgid|mod_fcgid]] is a high performance alternative to mod_cgi or mod_cgid, which starts a sufficient number instances of the CGI program to handle concurrent requests, and these programs remain running to handle further incoming requests. It is favored by the PHP developers, for example, as **a preferred alternative to running mod_php in-process, delivering very similar performance**.\\ mod_fcgid was **created as a new FastCGI implementation**, and was granted to the ASF as an Apache HTTP Server subproject in 2009. The [[http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html|Apache Module mod_fcgid]] reference page. === Articles === * [[http://dotclear.placeoweb.com/post/mod_fcgid|PlaceOWeb partage son expérience]] sur mod_fcgid. * [[http://2bits.com/articles/apache-fcgid-acceptable-performance-and-better-resource-utilization.html|Apache with fcgid: acceptable performance and better resource utilization]] ==== FastCGI et APC ==== [[http://www.magentocommerce.com/boards/viewthread/29264/|FastCGI + APC]] [[http://stackoverflow.com/questions/598444/how-to-share-apc-cache-between-several-php-processes-when-running-under-fastcgi|How to share APC cache between several PHP processes when running under FastCGI?]] ===== Tips ===== ==== Don't log ==== Si c'est pour un log apache, essayes un truc dans ce style ( à mettre dans la la conf du site apache où tu veux gérer les fichiers à ne pas stocker ) là, dans l'exemple, ça ne stocke pas les .gif , .css .js .jpg & .swf SetEnvIf Request_URI ".gif$" dontlog SetEnvIf Request_URI ".css$" dontlog SetEnvIf Request_URI ".js$" dontlog SetEnvIf Request_URI ".jpg$" dontlog SetEnvIF Request_URI ".swf$" dontlog CustomLog /var/log/httpd/www.domaine.tld-access_log "combined" env=!dontlog ==== PATH_INFO et Rewrite ==== RewriteEngine on #RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php5/$1 [L] RewriteRule ^$ index.php5/ [L] ==== Rediriger toutes les requêtes ==== How to redirect an entire server or directory to a single URL ? The best option is to use the standard Apache module mod_rewrite. If that module is compiled in, the following lines RewriteEngine On RewriteRule (.*) http://httpd.apache.org/$1 [R] will send an HTTP 302 Redirect back to the client, and no matter what they gave in the original URL, they'll be sent to "http://www.apache.org/". Voir [[http://httpd.apache.org/docs/1.3/misc/howto.html#redirect]] pour tous les détails. ==== VHost dynamique ==== Configuration de vhost apache dynamique: * [[http://httpd.apache.org/docs/2.0/vhosts/mass.html|Dynamically Configured Mass Virtual Hosting]] * [[http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html|Apache Module mod_vhost_alias]] : This module creates dynamically configured virtual hosts, by allowing the IP address and/or the Host: header of the HTTP request to be used as part of the pathname to determine what files to serve. This allows for easy use of a huge number of virtual hosts with similar configurations. ====Upload progress==== Modules pour le reporting progressif d'un upload (upload progress): * Extension PECL pour PHP : [[/informatique/php#php_uploadprogress|php_uploadprogress]] * Entension HttpModule pour .Net : [[/informatique/dotnet#NeatUpload]] * NGinx module : [[http://wiki.nginx.org/NginxHttpUploadProgressModule|NginxHttpUploadProgressModule]] * Apache module : [[http://github.com/drogus/apache-upload-progress-module|apache-upload-progress-module]]