MultiformeIngegno

  • Posts: 1,337
Re: Help with apache2
« Reply #60, on June 6th, 2012, 09:27 PM »Last edited on June 6th, 2012, 09:33 PM
What if I add:
      AddHandler php5-fcgi .php
      Action php5-fcgi /usr/lib/cgi-bin/php5.external

      <Location "/usr/lib/cgi-bin/php5.external">
         Order deny,allow
         Deny from all
         Allow from env=REDIRECT_STATUS
      </Location>

to fastcgi.conf (as explained here)?

EDIT: No, I get a 500 Server error..

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Help with apache2
« Reply #61, on June 6th, 2012, 09:36 PM »
So what happens in the error log for that?
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

MultiformeIngegno

  • Posts: 1,337
Re: Help with apache2
« Reply #62, on June 6th, 2012, 09:36 PM »
Uhm.. now I'm getting a:
Syntax error on line 24 of /etc/apache2/sites-enabled/heystella.it:
FastCgiExternalServer: redefinition of previously defined class "/home/www/php5.external"
Action 'configtest' failed.
Re: Help with apache2
« Reply #63, on June 6th, 2012, 09:45 PM »
Here's happening something strange.. 1 website works, others don't.. if I attach:

        FastCgiExternalServer /home/www/php5.external -host 127.0.0.1:9000
        AddHandler php5-fcgi .php
        Action php5-fcgi /usr/lib/cgi-bin/php5.external
        Alias /usr/lib/cgi-bin/ /home/www/

to more than 1 site I get the error:
Syntax error on line 24 of /etc/apache2/sites-enabled/SITENAME:
FastCgiExternalServer: redefinition of previously defined class "/home/www/php5.external"
Action 'configtest' failed.

I'm thinking that this method maybe works only if you have 1 website and not multiple..
This seems to tell I'm right..:
http://redmine.froxlor.org/issues/1048

In apache log:
[Wed Jun 06 21:41:19 2012] [alert] FastCGI: read() from pipe failed (0)
[Wed Jun 06 21:41:19 2012] [alert] FastCGI: the PM is shutting down, Apache seems to have disappeared - bye

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Help with apache2
« Reply #64, on June 6th, 2012, 09:54 PM »
Those aren't per-host declarations, they're for the entire server. You don't declare .php files for each virtual host, for example.

Add it to the main httpd.conf or similar.

MultiformeIngegno

  • Posts: 1,337
Re: Help with apache2
« Reply #65, on June 6th, 2012, 10:01 PM »
Quote from Arantor on June 6th, 2012, 09:54 PM
Those aren't per-host declarations, they're for the entire server. You don't declare .php files for each virtual host, for example.

Add it to the main httpd.conf or similar.
In httpd.conf was ok!!!!! :D
http://heystella.it/test.php
Posted: June 6th, 2012, 09:56 PM

Does the use of sockets instead of TCP/IP connections help? :)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Help with apache2
« Reply #66, on June 6th, 2012, 10:14 PM »
Yes, using sockets should be slightly faster than TCP/IP.

MultiformeIngegno

  • Posts: 1,337
Re: Help with apache2
« Reply #67, on June 6th, 2012, 10:20 PM »
Ok, I pointed my websites back to my VPS.. Let's see if now it handles RAM better. :)
Posted: June 6th, 2012, 10:18 PM

After a few minutes...


Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Help with apache2
« Reply #68, on June 6th, 2012, 10:26 PM »
That seems reasonable at the moment, there's a healthy amount of cache.

MultiformeIngegno

  • Posts: 1,337

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Help with apache2
« Reply #70, on June 7th, 2012, 12:30 AM »
You must have a lot of traffic on your server?

MultiformeIngegno

  • Posts: 1,337
Re: Help with apache2
« Reply #71, on June 7th, 2012, 12:40 AM »
Quote from Arantor on June 7th, 2012, 12:30 AM
You must have a lot of traffic on your server?
Uhm.. I don't know.. I'm hosting these websites (data are for the last 7 days, anyway they're on the VPS from 2 days with interruptions caused by server "collapsing" :P):

piloalbertelli.it:
49,649 total requests - 2.5 GB total bandwidth - 1,555 Unique visitors - 7,928 Page views

compagniaoltreconfine.com:
1,256 total requests - 16.7 MB total bandwidth - 29 Unique visitors - 205 Page views

danielamandolini.it:
2,746 total requests - 8.3 MB total bandwidth - 19   Unique visitors - 281 Page views

heystella.it:
4,973 total requests - 100.3 MB total bandwidth - 163 Unique visitors - 377 Page views

lorenzoraffio.com:
7,573 total requests - 34.9 MB total bandwidth - 454 Unique visitors - 1,566 Page views

multiformeingegno.it:
40,954 total requests - 677.3 MB total bandwidth - 2,070 Unique visitors - 8,311 Page views

rockciclopedia.com:
175,211 total requests - 2.0 GB total bandwidth - 4,591 Unique visitors - 34,670 Page views

studioassociatogema.it:
57 total requests - 750.0 KB total bandwidth - 4 Unique visitors - 8 Page views

As you can see there are 3 or 4 websites with "important" load but the others are semi-insignificant..
Re: Help with apache2
« Reply #72, on June 7th, 2012, 05:00 PM »
Quote from ziycon on June 6th, 2012, 05:45 PM
Quote from MultiformeIngegno on June 5th, 2012, 08:43 PM
I restarted the server and now I'm getting this mail every 10 min ~:
Subject:
Cron <smmsp@ts100561> test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp

Text:
/usr/share/sendmail/sendmail: 899: /usr/share/sendmail/sendmail: /usr/sbin/sendmail-msp: not found
I've experienced a similar issue before with POSTFIX. It turned out that apt did not remove the old sendmail files (just the sendmail-bin). To fix this I did the below:
Code: [Select]
sudo apt-get --purge remove sendmail-base sendmail-cf sendmail-doc

This removed any leftover files form the old sendmail install (including /etc/cron.d/sendmail which causes this error message).
Thanks ziycon, that solved the problem. :)

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Help with apache2
« Reply #73, on June 7th, 2012, 05:08 PM »
Which processes are taking the max. amount of memory? Observe top for a while.
The way it's meant to be

MultiformeIngegno

  • Posts: 1,337
Re: Help with apache2
« Reply #74, on June 7th, 2012, 07:52 PM »
Code: [Select]
top - 19:44:28 up 1 day,  3:46,  1 user,  load average: 0.12, 0.16, 0.11
Tasks:  71 total,   1 running,  70 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.6%us,  0.2%sy,  0.0%ni, 96.1%id,  2.0%wa,  0.0%hi,  0.0%si,  0.1%st
Mem:    502992k total,   353164k used,   149828k free,     1548k buffers
Swap:  1048572k total,   120556k used,   928016k free,    38220k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                   
11125 root      20   0 17336 1176  892 R  2.0  0.2   0:00.01 top                                                                                                       
    1 root      20   0 24316    0    0 S  0.0  0.0   0:00.40 init                                                                                                       
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd                                                                                                   
    3 root      20   0     0    0    0 S  0.0  0.0   0:03.06 ksoftirqd/0                                                                                               
    4 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kworker/0:0                                                                                               
    5 root      20   0     0    0    0 S  0.0  0.0   0:00.05 kworker/u:0                                                                                               
    6 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0                                                                                               
    7 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 cpuset                                                                                                     
    8 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 khelper                                                                                                   
    9 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 netns                                                                                                     
   10 root      20   0     0    0    0 S  0.0  0.0   0:00.00 xenwatch                                                                                                   
   11 root      20   0     0    0    0 S  0.0  0.0   0:00.02 xenbus                                                                                                     
   12 root      20   0     0    0    0 S  0.0  0.0   0:00.23 sync_supers                                                                                               
   13 root      20   0     0    0    0 S  0.0  0.0   0:00.00 bdi-default                                                                                               
   14 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 kintegrityd                                                                                               
   15 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 kblockd                                                                                                   
   16 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 ata_sff                                                                                                   
   17 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khubd                                                                                                     
   18 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 md                                                                                                         
   19 root      20   0     0    0    0 S  0.0  0.0   0:00.02 khungtaskd                                                                                                 
   20 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kworker/u:1                                                                                               
   21 root      20   0     0    0    0 S  0.0  0.0   0:15.76 kworker/0:1                                                                                               
   22 root      20   0     0    0    0 S  0.0  0.0   0:17.43 kswapd0                                                                                                   
   23 root      25   5     0    0    0 S  0.0  0.0   0:00.00 ksmd                                                                                                       
   24 root      20   0     0    0    0 S  0.0  0.0   0:00.00 fsnotify_mark                                                                                             
   25 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ecryptfs-kthrea                                                                                           
   26 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 crypto                                                                                                     
   34 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 kthrotld                                                                                                   
   35 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khvcd                                                                                                     
  159 root      20   0     0    0    0 S  0.0  0.0   0:01.78 kjournald                                                                                                 
  253 root      20   0 17224    0    0 S  0.0  0.0   0:00.05 upstart-udev-br                                                                                           
  256 root      20   0 21460   16   16 S  0.0  0.0   0:00.06 udevd                                                                                                     
  322 messageb  20   0 23808    0    0 S  0.0  0.0   0:00.02 dbus-daemon                                                                                               
  326 syslog    20   0  243m  168    0 S  0.0  0.0   0:10.09 rsyslogd                                                                                                   
  395 root      20   0 21456   16   12 S  0.0  0.0   0:00.00 udevd                                                                                                     
  419 root      20   0 23344    4    0 S  0.0  0.0   0:00.00 vsftpd                                                                                                     
  438 root      20   0 21456   16   12 S  0.0  0.0   0:00.00 udevd                                                                                                     
  485 root      20   0 49948   64    0 S  0.0  0.0   0:00.41 sshd                                                                                                       
  494 root      20   0 15180    4    0 S  0.0  0.0   0:00.01 upstart-socket-                                                                                           
  541 root      20   0 14500   20   16 S  0.0  0.0   0:00.00 getty                                                                                                     
  547 root      20   0 14500   20   16 S  0.0  0.0   0:00.00 getty                                                                                                     
  555 root      20   0 14500   20   16 S  0.0  0.0   0:00.00 getty                                                                                                     
  558 root      20   0 14500   20   16 S  0.0  0.0   0:00.00 getty                                                                                                     
  564 root      20   0 14500   20   16 S  0.0  0.0   0:00.00 getty                                                                                                     
  571 root      20   0  4352    4    0 S  0.0  0.0   0:00.00 acpid                                                                                                     
  572 root      20   0 19104  248  156 S  0.0  0.0   0:00.35 cron                                                                                                       
  573 daemon    20   0 16900    0    0 S  0.0  0.0   0:00.00 atd                                                                                                       
  612 mysql     20   0  850m  50m 2752 S  0.0 10.4   2:08.66 mysqld                                                                                                     
  873 Debian-e  20   0 45372   68    0 S  0.0  0.0   0:00.06 exim4                                                                                                     
 1010 root      20   0     0    0    0 S  0.0  0.0   0:01.30 flush-202:0                                                                                               
 1504 root      20   0 12744   16   12 S  0.0  0.0   0:00.00 getty                                                                                                     
 1506 root      20   0 14500   20   16 S  0.0  0.0   0:00.00 getty                                                                                                     
 7577 root      20   0 98812  760  100 S  0.0  0.2   0:04.24 apache2                                                                                                   
 7581 www-data  20   0 98048  568    8 S  0.0  0.1   0:00.00 apache2                                                                                                   
 7582 www-data  20   0 98040  584    0 S  0.0  0.1   0:00.02 apache2                                                                                                   
 7583 www-data  20   0  830m 4896  860 S  0.0  1.0   0:09.15 apache2                                                                                                   
 7585 www-data  20   0  830m 4940  848 S  0.0  1.0   0:09.11 apache2                                                                                                   
 7892 root      20   0  240m  920  292 S  0.0  0.2   0:03.46 php5-fpm                                                                                                   
 9813 www-data  20   0  829m 4936 1008 S  0.0  1.0   0:02.79 apache2                                                                                                   
10204 root      20   0 73352  688  404 S  0.0  0.1   0:00.22 sshd                                                                                                       
10222 root      20   0 19700 1352  648 S  0.0  0.3   0:00.24 bash                                                                                                       
10236 root      20   0 73352  392  132 S  0.0  0.1   0:00.08 sshd                                                                                                       
10254 root      20   0 12904   20   16 S  0.0  0.0   0:00.02 sftp-server                                                                                               
10293 root      20   0 73352  412  184 S  0.0  0.1   0:00.06 sshd                                                                                                       
10311 root      20   0 12768   12   12 S  0.0  0.0   0:00.00 sftp-server                                                                                               
10800 www-data  20   0  294m  58m 4732 S  0.0 12.0   0:30.21 php5-fpm                                                                                                   
10804 www-data  20   0  293m  51m 4716 S  0.0 10.4   0:27.01 php5-fpm                                                                                                   
11021 www-data  20   0  271m  36m 5756 S  0.0  7.5   0:02.30 php5-fpm                                                                                                   
11041 www-data  20   0  255m  18m 4460 S  0.0  3.8   0:01.28 php5-fpm                                                                                                   
11065 www-data  20   0  263m  28m 3968 S  0.0  5.8   0:01.96 php5-fpm                                                                                                   
11082 www-data  20   0  273m  38m 4032 S  0.0  7.8   0:01.66 php5-fpm                                                                                                   

Now it seems acceptable: