Apache2 / Worker / Fcgid / PHP5 on Debian Linux
Quando il tuo web server non riescie piu’ a gestire le numerose richieste che gli arrivano da tutto il mondo, e’ ora di pensare di cambiare gestione di Apache2 per qualcosa che richieda meno risorse e risulti piu’ performante.
La soluzione di usare Apache in modalita’ “worker” (multi-threaded) invece di quella tradizionale “prefork” e’ il compromesso giusto per ottenere un ottimo web server.
il problema con il modulo “worker” e’ che quest’ultimo non supporta il modulo nativo per Apache di PHP, per questo bisogna usare php5-cgi e fastcgi (fcgid).
Pochi semplici step vi aiuteranno a installare questa nuova modalita’.
iniziamo con installare i pacchetti giusti:
sudo apt-get install apache2-mpm-worker libapache2-mod-fcgid
sudo apt-get install php5-cgi php5-curl php5-gd php5-ldap php5-mysql php5-sqlite php5-xsl
Ora disabilitiamo i vecchi moduli e abilitiamo i nuovi:
sudo a2dismod php5
sudo a2enmod actions
sudo a2enmod fcgid
Non resta che dare le giuste direttive ad Apache, in apache2.conf:
<Directory /var/www>
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php
</Directory>
E per ogni virtualhost dovrete aggiungere:
Options +ExecCGI
Ci sono diversi modi di configurare queste direttive potete trovarne altri ancora in giro per la rete cercando su Google.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.
16:31 on October 16th, 2012
Grazie Michele per l’articolo su Apache che hai scritto.
Provato e funziona tutto, tra l’altro l’hai spiegato in modo molto chiaro. Grazie!
12:46 on August 20th, 2012
I agree with your statement. Thank You very much.
14:11 on December 6th, 2011
A lot of interesting component here, very good direction, great thanks.
06:07 on September 29th, 2011
Great goods from you, man. I have be aware your stuff prior to and you are simply extremely excellent. I really like what you have got here, certainly like what you are stating and the way in which in which you say it. You make it entertaining and you continue to care for to keep it smart. I cant wait to read far more from you. This is actually a great web site.
16:06 on September 26th, 2011
The way that we maintain Apache on Solaris 10 is not to drop in new releases as they happen, rather we take the fixes mentioned and backport them to our 2.0.63 codebase.
10:54 on September 26th, 2011
whoah this blog is fantastic i love reading your posts. Stay up the good work! You already know, lots of individuals are looking round for this information, you can help them greatly.
10:21 on June 3rd, 2011
after girls Abercrombie is the best online cheapest abercrombie and fitch shop where you can
buy the discount abercrombie clothes,Hoodies, Jeans, T-Shirts,Free .
Abercrombie & Fitch
Abercrombie Fitch
Abercrombie
an online store specializing in Abercrombie and Fitch Clothing, jacket, Shirts, Hollister,
Buy Cheap Abercrombie
17:15 on May 23rd, 2011
Multi-Store eCommerce Solution — a product by Ydeveloper — is a unique, centralized multi-store ecommerce management system that is an SEO-friendly ecommerce platform for facilitating the management of several eCommerce stores from a single admin panel. This admin panel helps webmasters add and modify products on separate sites. The store owner can update necessary changes to reflect on all those sites using this powerful admin panel. The solution is developed using ASP.NET, PHP, and Java.
12:42 on February 17th, 2011
[…] […]
15:47 on September 25th, 2010
Con questa configurazione come si calcola il numero massimo di connessioni? Cioè, si continua a considerare un carico di 15 Mb per connessione (presupponendo che con Php siamo in presenza di contenuto dinamico) che incide sulla RAM del server o cambia qualcosa?
Grazie per i vostri commenti
10:08 on July 19th, 2010
Ho seguito i tuoi passi e funziona tutto perfettamente!
17:55 on May 9th, 2010
Grande. Ho cercato in lungo ed in largo delle guide e tutte avevano una valanga di configurazioni e mi sembravano complicate. Ho seguito i tuoi passi e funziona tutto perfettamente!
16:56 on March 1st, 2010
[…] Apache2 / Worker / Fcgid / PHP5 on Debian Linux – Quando il tuo web server non riescie piu’ a gestire le numerose richieste che gli arrivano da tutto il mondo, e’ ora di pensare di cambiare gestione di Apache2 per qualcosa che richieda meno risorse e risulti piu’ performante […]