Jump to content
Sign in to follow this  
diarex

Aiuto configurazione VPS

Recommended Posts

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

 

 

  1. Desktop - Updater
  2. Seleziono la versione di Plaek (è in giallo)
  3. Scelgo FastCGI quindi in alto Install
  4. .... attendo ...

Configurazione Apache

 

Uno dei problemi incontrati è il msg di errore "too much process", ho risolto con:

 

# 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ì:

 

# 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:

 

# chmod 777 /var/lib/php/session/

esagero lo so, qualcuno magari mi può consigliare qualcos'altro...

 

Abilitare il FastCGI nei siti - VERSIONE A

 

Per prima cosa copio il file necessario:

 

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:

 

#vi /var/www/vhosts/{DOMINIO}/conf/httpd.include

      ....

      Include /var/www/vhosts/{DOMINIO}/conf/vhost.conf

Quindi edito il .conf:

 

#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:

 

#/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:

 

vim /var/www/vhosts/{DOMINIO}/bin/php-cgi.fcgi

   #!/bin/sh
   # Set desired PHP_FCGI_* environment variables.
   # Example:
   # PHP FastCGI processes exit after 500 requests by default.
   PHP_FCGI_MAX_REQUESTS=10000
   export PHP_FCGI_MAX_REQUESTS

   # Replace with the path to your FastCGI-enabled PHP executable
   exec /var/www/vhosts/{DOMINIO}/bin/php-cgi

Copio quindi il binario ed assegno i permessi corretti:

 

    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:

 

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

 

vi /var/www/vhosts/{DOMINIO}/conf/httpd.include

....
Include /var/www/vhosts/{DOMINIO}/conf/vhost.conf

ed un restart:

 

#/etc/init.d/httpd restart

Problemi Ottenuti

 

Ecco cosa appare una volta al giorno:

 

# 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?

Share this post


Link to post
Share on other sites

Dovrebbe essere un "Internal Server Error", io personalmente non ho avuto la fortuna di vederlo mai, però dalle segnalazioni degli amministratori dei vari siti, confrontando gli orari nei log, pare che sia proprio un errore 500.

 

La pagina bianca invece veniva mostrata quando c'erano problemi di "too much process".

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×