Jump to content
Froxlor Forum
  • 0

fastcgi not loading php5 on new php-fpm installation


mosesjohann

Question

Hello guys,

 

I enabled PHP-FPM in froxlor because it sounded good and then I realised, that I have to do more for it to get it work. No problem, because the hassle with user and group in web and ftp was always bad and so I decided to run the installation as described http://redmine.froxlor.org/projects/froxlor/wiki/FPM_-_handbook

 

I found, that I didn't get all of it at first time so I deactivated the php_mod after the installation.

 

Now I worked through the docu many times but I don't get it work. The issue is, that with enabled mpm_worker and fastcgi no php is executed. When I disable it and enable mpm_prefork and php_mod (a2dismod mpm_worker | service apache2 restart | a2enmod php5 mpm_prefork) I can access the froxlor page. Then phpinfo() shows this.

 

Now I disable mod_php and mpm_prefork and enable mpm_worker again. The Webserver ist now running but it doesn't execute php (for example user.php with <?php system('id'); ?> in it - got this from here).

 

The next problem is, that I'm always getting on the root-directory /var/www/html - even when I open a customer-url. The configs are:

Test if nscd is working - OK

/etc/apache2/mods-enabled/fastcgi.conf

 

logs:

Apache-Loglevel set to debug. checked files:

/var/log/syslog

/var/log/php-fpm.log (just writing [19-Apr-2015 10:11:11] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful)

Interesting but don't know what it wants to say: /var/log/apache2/error.log

 

files and directories:

ls /etc/apache2/mods-enabled

ls /etc/apaches/sites-enabled

   22_froxlor_normal_vhost_wanderritt.net.conf

ls /etc/php5/fpm/pool.d

    wanderritt.net.conf

ps -aux - pools running

ls /var/lib/apache2/fastcgi

 

System-Info: Fresh installed Ubuntu 14.04.2. Installed froxlor from reps with wheezy-parameter (deb http://debian.froxlor.orgwheezy main) because jessie was not availible.

 

Tryied to install new from scratch (remove with purge)

 

Please help me, don't know what I can do and don't know where the error is. If you need further information please ask for it!

 

Thanks

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

This,

 

<IfModule mod_fastcgi.c>
    FastCgiIpcDir /var/lib/apache2/fastcgi

    <Location "/fastcgiphp">
        Require all granted
        Require env REDIRECT_STATUS
    </Location>
</IfModule>

 along 

a2dismod php5

Got me up and running in Ubuntu 14.04

 

 

PS> Not this thread problem, but maybe someone haves the same problem in the future... I had previously installed apache2-mpm-itk... if you did so, REMOVE IT.

 

EDIT: sorry for the resurrection.. but it was worth it :)

Link to comment
Share on other sites

no chance for a solution? "push"

 

EDIT:

What I forgot:

 

When I open http://111.11.11.11/froxlorphp is not executed but displayed:

(2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt* @package Panel * */ define('AREA', 'login'); require './lib/init.php'; if ($action == '') { $action = 'login'; } if ($action == 'login') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $loginname = validate($_POST['loginname'], 'loginname'); $pa....

Link to comment
Share on other sites

I think the problem is your that your post is kind of hard to read. Your Problem seems to be that you switched to php-fpm and it does not work, correct? Maybe this youtube video will help you find the problem: 

 

Link to comment
Share on other sites

Yes, you're right. Sry, wanted to post all information you could need.

 

I now purged froxlor, deleted the sources.list-entry, removed the database and the froxlor-dir and reinstalled froxlor and followed the video exactly step-by-step. The only problem was, that I can't select php-fpm for Ubuntu 14.04 - i had to take the code from Debian - maybe thats the problem?

 

It stopts working at the same point: When disabling php5 with a2dismod php5 the handler is not switched to php-fpm so php is not executed. I also tried to continue the video to the end but no success. As I can see it, the process is not correctly running because ps -aux |grep php-fpm results in:

 

root     15488  0.0  0.1  11748  2208 pts/2    S+   20:59   0:00 grep --color=auto php-fpm

 

May you can tell me what info you need so you can please help me. I think its may not possible to enable it via froxlor because the setup here looks a bit different.

 

Thanks!

Link to comment
Share on other sites

Hi d00p,

 

thanks for reply. When I try to start:

 

php5-fpm

 

it throws:

[09-May-2015 17:55:06.555953] ERROR: pid 50360, fpm_sockets_new_listening_socket(), line 185: An another FPM instance seems to already listen on /var/lib/apache2/fastcgi/froxlor.panel-srv1.at-php-fpm.socket
[09-May-2015 17:55:06.555979] ERROR: pid 50360, fpm_init(), line 72: FPM initialization failed
 

so it should already be started. If I try what you suggested:

 

php5-fpm -t -y /etc/php5/fpm/php-fpm.conf

 

it says:

 

[09-May-2015 17:56:46] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
 

Link to comment
Share on other sites

So, php-fpm is running. Are the configs generated correctly by froxlor? Did you double check config, paths, etc.? What's the current error-message when you try to open a website?

 

This time: please answer briefly, state the problem, tell what you did.

Link to comment
Share on other sites

The configs are generated. As I mentioned, there are not all options for Ubuntu 14.04 like for Debian 7. I checked the configs and paths 3 times. There is no error message - the php-code is displayed. Its only interpreted, when I enable the php5-mod (a2enmod php5). When I disable it, like I should do, the code is displayed. I thinks I have to say apache in Ubuntu 14.04 anywhere else to use php-fpm...

Link to comment
Share on other sites

New event: When I a2dismod php5 and try to open froxlor Webpage: 403 Forbidden You don't have permission to access /php5-fcgi/froxlor/index.php on this server. (FYI: There is no such directory in /var/www/html but a php-fpm in /var/www )

 

LOGs:

/var/log/php5-fpm.log: empty

 

/var/log/apache2/:


[Thu May 21 06:51:11.981749 2015] [mpm_prefork:notice] [pid 2040] AH00169: caught SIGTERM, shutting down
[Thu May 21 06:51:13.044724 2015] [suexec:notice] [pid 38572] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Thu May 21 06:51:13.058227 2015] [:notice] [pid 38576] FastCGI: process manager initialized (pid 38576)
[Thu May 21 06:51:13.077698 2015] [mpm_prefork:notice] [pid 38573] AH00163: Apache/2.4.7 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_fcgid/2.3.9 PHP/5.5.9-1ubuntu4.9 configured -- resuming normal operations
[Thu May 21 06:51:13.077729 2015] [core:notice] [pid 38573] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 21 06:51:36.304477 2015] [mpm_prefork:notice] [pid 38573] AH00169: caught SIGTERM, shutting down
[Thu May 21 06:51:37.282543 2015] [suexec:notice] [pid 38643] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Thu May 21 06:51:37.291544 2015] [mpm_prefork:notice] [pid 38644] AH00163: Apache/2.4.7 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_fcgid/2.3.9 configured -- resuming normal operations
[Thu May 21 06:51:37.291594 2015] [core:notice] [pid 38644] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 21 06:51:37.291789 2015] [:notice] [pid 38647] FastCGI: process manager initialized (pid 38647)
[Thu May 21 06:51:40.674020 2015] [authz_core:error] [pid 38650] [client 185.71.166.4:53929] AH01630: client denied by server configuration: /usr/lib/cgi-bin/php5-fcgi, referer: http://199.99.99.99/froxlor/admin_index.php?s=40a974e885c28cb5c8a592d84c8428ac


/var/log/syslog:

May 21 06:39:01 KD674COM01 CRON[38349]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/lib/php5 ] && /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime))
May 21 06:40:01 KD674COM01 CRON[38365]: (root) CMD (/usr/bin/nice -n 5 /usr/bin/php5 -q /var/www/html/froxlor/scripts/froxlor_master_cronjob.php --tasks 1> /dev/null)
May 21 06:45:01 KD674COM01 CRON[38510]: (root) CMD (/usr/bin/nice -n 5 /usr/bin/php5 -q /var/www/html/froxlor/scripts/froxlor_master_cronjob.php --tasks 1> /dev/null)
May 21 06:50:01 KD674COM01 CRON[38518]: (root) CMD (/usr/bin/nice -n 5 /usr/bin/php5 -q /var/www/html/froxlor/scripts/froxlor_master_cronjob.php --tasks 1> /dev/null)
May 21 06:55:01 KD674COM01 CRON[38663]: (root) CMD (/usr/bin/nice -n 5 /usr/bin/php5 -q /var/www/html/froxlor/scripts/froxlor_master_cronjob.php --tasks 1> /dev/null)

 

 

not others during the whole day.

 

CONFIGS: (/etc/apache2/sites-enabled/)

 

000-default.conf:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
 

10_froxlor_ipandport_199.99.99.99.99.conf

NameVirtualHost 199.99.99.99:80
<VirtualHost 199.99.99.99:80>
DocumentRoot "/var/www/html/"
 ServerName example.com
  FastCgiExternalServer /var/www/php-fpm/froxlor.panel/example.com/21bb.fpm.external -socket /var/lib/apache2/fastcgi/froxlor.panel-example.com-php-fpm.socket -idle-timeout 30
  <Directory "/var/www/html/">
   <FilesMatch "\.(php)$">
     AddHandler php5-fastcgi .php
     Action php5-fastcgi /fastcgiphp
      Options +ExecCGI
    </FilesMatch>
    Order allow,deny
    allow from all
  </Directory>
  Alias /fastcgiphp /var/www/php-fpm/froxlor.panel/example.com/21bb.fpm.external
</VirtualHost>

 

20_froxlor_normal_vhost_wanderritt.example.com.conf

<VirtualHost 199.99.99.99:80>
  ServerName wanderritt.example.com
  ServerAlias *.wanderritt.example.com
  ServerAdmin glumpad@gmail.com
  DocumentRoot "/var/customers/webs/wanderritt/"
  FastCgiExternalServer /var/www/php-fpm/wanderritt/wanderritt.example.com/fpm.external -socket /var/lib/apache2/fastcgi/wanderritt-wanderritt.example.com-php-fpm.socket -idle-timeout 30
  <Directory "/var/customers/webs/wanderritt/">
    <FilesMatch "\.php$">
      SetHandler php5-fastcgi
      Action php5-fastcgi /fastcgiphp
      Options +ExecCGI
    </FilesMatch>
    Order allow,deny
    allow from all
  </Directory>
  Alias /fastcgiphp /var/www/php-fpm/wanderritt/wanderritt.example.com/fpm.external
  ErrorLog "/var/customers/logs/wanderritt-error.log"
  CustomLog "/var/customers/logs/wanderritt-access.log" combined
</VirtualHost>

 

22_froxlor_normal_vhost_wanderritt.net.conf:

# 22_froxlor_normal_vhost_wanderritt.net.conf
# Created 03.05.2015 20:54
# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.

# Domain ID: 2 - CustomerID: 1 - CustomerLogin: wanderritt
<VirtualHost 199.99.99.99:80>
  ServerName wanderritt.net
  ServerAlias *.wanderritt.net
  ServerAdmin glumpad@gmail.com
  DocumentRoot "/var/customers/webs/wanderritt/"
  FastCgiExternalServer /var/www/php-fpm/wanderritt/wanderritt.net/fpm.external -socket /var/lib/apache2/fastcgi/wanderritt-wanderritt.net-php-fpm.socket -idle-timeout 30
  <Directory "/var/customers/webs/wanderritt/">
    <FilesMatch "\.php$">
      SetHandler php5-fastcgi
      Action php5-fastcgi /fastcgiphp
      Options +ExecCGI
    </FilesMatch>
    Order allow,deny
    allow from all
  </Directory>
  Alias /fastcgiphp /var/www/php-fpm/wanderritt/wanderritt.net/fpm.external
  ErrorLog "/var/customers/logs/wanderritt-error.log"
  CustomLog "/var/customers/logs/wanderritt-access.log" combined
</VirtualHost>

 

40_froxlor_diroption_613d2a820e2d9a7a94bdcc75f88f3a44.conf:

# 40_froxlor_diroption_613d2a820e2d9a7a94bdcc75f88f3a44.conf
# Created 03.05.2015 20:54
# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.

<Directory "/var/customers/webs/wanderritt/webalizer/">
  AuthType Basic
  AuthName "Restricted Area"
  AuthUserFile /etc/apache2/htpasswd/1-613d2a820e2d9a7a94bdcc75f88f3a44.htpasswd
  require valid-user
</Directory>
 

Video-Tutorial:

 

Yes, twice second for second....

 

Maybe I should start with a new image of the server because of the many tries don't exactly now whats configured and running. There is nothing other on It so I could do that if that helps. Is there anyone who can approve that froxlor-config was working with Ubuntu 14.04?
 

Link to comment
Share on other sites

id -u wanderritt
10000

 

ls -al /var/customers/webs/

total 12
drwxr-xr-x 3 root       root       4096 May 24 14:01 .
drwxr-xr-x 6 root       root       4096 Apr 18 21:29 ..
drwxr-x--- 3 wanderritt wanderritt 4096 May  3 20:50 wanderritt

getent passwd

...
froxlorlocal:x:9999:9999:,,,:/home/froxlorlocal:/bin/false
wanderritt:x:10000:10000:MySQL User:/var/customers/webs/wanderritt/:/bin/false

where wanderritt is not a local user. Think this is what libnss has to do, or are there other commands that I can try?

 

 

 

I need help by finding the error to the log-line in /var/log/apache2/error.log (error generated when try to open php-page, html does nothing):

[Sun May 24 14:03:31.241903 2015] [mpm_prefork:notice] [pid 11849] AH00169: caught SIGTERM, shutting down
[Sun May 24 14:03:32.280742 2015] [suexec:notice] [pid 12045] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Sun May 24 14:03:32.289934 2015] [:notice] [pid 12049] FastCGI: process manager initialized (pid 12049)
[Sun May 24 14:03:32.290931 2015] [mpm_prefork:notice] [pid 12046] AH00163: Apache/2.4.7 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_fcgid/2.3.9 configured -- resuming normal operations
[Sun May 24 14:03:32.290956 2015] [core:notice] [pid 12046] AH00094: Command line: '/usr/sbin/apache2'
[Sun May 24 14:08:50.429065 2015] [authz_core:error] [pid 12051] [client 185.71.166.4:41869] AH01630: client denied by server configuration: /usr/lib/cgi-bin/php5-fcgi, referer: http://195.4.130.15/froxlor/admin_index.php?s=324cf7f40c79b6a697566aeddb1d84b5

/var/logs/php5-fpm.log: nothing but

[24-May-2015 13:23:42] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

 /usr/lib/cgi-bin/php5-fcgi ist listed in

/etc/apache2/conf-enabled/php5-fpm.conf and linked to socket /var/run/php5-fpm.sock but this file does not exist! Why? I don't know

 

Link to comment
Share on other sites

<IfModule mod_fastcgi.c>
    FastCgiIpcDir /var/lib/apache2/fastcgi/

    <Location "/fastcgiphp">
        Order Deny,Allow
        Deny from All
        # Prevent accessing this path directly
        Allow from env=REDIRECT_STATUS
    </Location>
</IfModule>

since Apache 2.4 it has to be ( http://httpd.apache.org/docs/2.4/upgrading.html):

<IfModule mod_fastcgi.c>
    FastCgiIpcDir /var/lib/apache2/fastcgi

    <Location "/fastcgiphp">
        Require all granted
        Require env REDIRECT_STATUS
    </Location>
</IfModule>

I checked the Apache 2.4 Checkbox and thats the same config for Ubuntu 12.04 and 14.04. Will there be an update or can I also config 2.4 with 2.2-options?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...