Ciao,
ancora problemi, ho deciso di postare quindi la configurazione completa effettuata per capire l'errore dove sta.
La VPS ha 1.6 GByte di RAM, 15 GByte di HD, Plesk 8.3.1. Aruba VPS Professional per gli altri dettagli.
Uso FastCGI per poter avere lo stesso utente sia via FTP che quando gira il Php.
FastCGI
- Desktop - Updater
- Seleziono la versione di Plaek (è in giallo)
- Scelgo FastCGI quindi in alto Install
- .... attendo ...
Configurazione Apache
Uno dei problemi incontrati è il msg di errore "too much process", ho risolto con:
Codice:
# vi /etc/httpd/conf/httpd.conf
...
<IfModule prefork.c>
StartServers 10
MinSpareServers 5
MaxSpareServers 75
ServerLimit 512
MaxClients 512
MaxRequestsPerChild 0
</IfModule>
...
Configurare il FastCGI
Assieme al precedente ho operato così:
Codice:
# vi /etc/httpd/conf.d/fcgid.conf
# added by psa-mod-fcgid-configurator
LoadModule fcgid_module /usr/lib/httpd/modules/mod_fcgid.so
<IfModule mod_fcgid.c>
SocketPath /var/lib/httpd/fcgid/sock
</IfModule>
# added by psa-mod-fcgid-configurator
<IfModule mod_fcgid.c>
IdleTimeout 3600
ProcessLifeTime 7200
MaxProcessCount 256
DefaultMaxClassProcessCount 32
IPCConnectTimeout 30
IPCCommTimeout 45
DefaultInitEnv RAILS_ENV production
</IfModule>
In effetti l'errore "too much process" non è più comparso.
Sessioni
Devo rendere la sessione scrivibile a tutti:
Codice:
# vim /etc/php.ini
...
session.save_path = "/tmp/"
....
esagero lo so, qualcuno magari mi può consigliare qualcos'altro...
Abilitare il FastCGI nei siti - VERSIONE A
Per prima cosa copio il file necessario:
Codice:
cp /usr/bin/php-cgi /var/www/vhosts/{DOMINIO}/bin/
chown -R {UTENTEFTP}:psacln /var/www/vhosts/{DOMINIO}/bin/
Impongo la lettura un un .conf personale:
Codice:
#vi /var/www/vhosts/{DOMINIO}/conf/httpd.include
....
Include /var/www/vhosts/{DOMINIO}/conf/vhost.conf
Quindi edito il .conf:
Codice:
#vi /var/www/vhosts/{DOMINIO}/conf/vhost.conf
AddHandler fcgid-script .php
SuexecUserGroup {UTENTEFTP} psacln
<Directory /var/www/vhosts/{DOMINIO}/httpdocs>
FCGIWrapper /var/www/vhosts/{DOMINIO}/bin/php-cgi .php
Options +ExecCGI +FollowSymLinks
</Directory>
ed un restart:
Codice:
#/etc/init.d/httpd restart
Abilitare il FastCGI nei siti - VERSIONE B
In questa configurazione uso un wrapper non composto dal semplice binario, ma da uno script:
Codice:
vim /var/www/vhosts/{DOMINIO}/bin/php-cgi.fcgi
#!/bin/sh
PHP_FCGI_MAX_REQUESTS=10000
export PHP_FCGI_MAX_REQUESTS
exec /var/www/vhosts/{DOMINIO}/bin/php-cgi
Copio quindi il binario ed assegno i permessi corretti:
Codice:
cp /usr/bin/php-cgi /var/www/vhosts/{DOMINIO}/bin/
chown -R {UTENTEFTP}:psacln /var/www/vhosts/{DOMINIO}/bin/
chmod 755 /var/www/vhosts/{DOMINIO}/bin/php-cgi.fcgi
Imposto il file di configurazione del vhost come segue:
Codice:
vim /var/www/vhosts/{DOMINIO}/conf/vhost.conf
SuexecUserGroup {UTENTEFTP} psacln
<Directory /var/www/vhosts/{DOMINIO}/httpdocs>
AddHandler fcgid-script .php
FCGIWrapper /var/www/vhosts/{DOMINIO}/bin/php-cgi.fcgi .php
Options +ExecCGI +FollowSymLinks
</Directory>
Ed infine impongo la lettura del mio conf esattamente come prima
Codice:
vi /var/www/vhosts/{DOMINIO}/conf/httpd.include
....
Include /var/www/vhosts/{DOMINIO}/conf/vhost.conf
ed un restart:
Codice:
#/etc/init.d/httpd restart
Problemi Ottenuti
Ecco cosa appare una volta al giorno:
Codice:
# cat /var/log/httpd/error_log | grep "get" | more
[Sun Apr 17 08:54:59 2011] [notice] mod_fcgid: process /var/www/vhosts/kimere.com/httpdocs/index.php(7295) exit(communication error), get stop signal 9
[Sun Apr 17 08:55:09 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(21691) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:15 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(17509) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:29 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11535) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:34 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11551) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:34 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11550) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:34 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11547) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:34 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11542) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:34 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11539) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:40 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11558) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:45 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11564) exit(communication error), get stop
signal 9
[Sun Apr 17 08:55:55 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11575) exit(communication error), get stop
signal 9
[Sun Apr 17 08:56:01 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11610) exit(communication error), get stop
signal 9
[Sun Apr 17 08:56:15 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11621) exit(communication error), get stop
signal 9
[Sun Apr 17 08:56:19 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11638) exit(communication error), get stop
signal 9
[Sun Apr 17 08:56:19 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11632) exit(communication error), get stop
signal 9
[Sun Apr 17 08:56:19 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11629) exit(communication error), get stop
signal 9
[Sun Apr 17 08:56:19 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11624) exit(communication error), get stop
signal 9
[Sun Apr 17 08:56:23 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11642) exit(communication error), get stop
signal 9
[Sun Apr 17 08:56:29 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11646) exit(communication error), get stop
signal 9
[Sun Apr 17 08:56:47 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11651) exit(communication error), get stop
signal 9
[Sun Apr 17 08:57:02 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11692) exit(communication error), get stop
signal 9
[Sun Apr 17 08:57:02 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11688) exit(communication error), get stop
signal 9
[Sun Apr 17 08:57:06 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11708) exit(communication error), get stop
signal 9
[Sun Apr 17 08:57:06 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11704) exit(communication error), get stop
signal 9
[Sun Apr 17 08:57:06 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11701) exit(communication error), get stop
signal 9
[Sun Apr 17 08:57:06 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11695) exit(communication error), get stop
signal 9
[Sun Apr 17 08:57:11 2011] [notice] mod_fcgid: process /var/www/vhosts/bottega.avalonceltic.com/httpdocs/index.php(11713) exit(communication error), get stop
signal 9
Ovvero i processi cadono uno dietro l'altro, dopo pochi minuti la situazione torna normale.
idee?
Segnalibri