Apache en PHP-FPM op CentOS 7

Pagina: 1
Acties:

Vraag


  • Hipska
  • Registratie: Mei 2008
  • Laatst online: 30-09 14:57
Ik zit met het vreemde probleem dat mijn Apache php files wel naar php-fpm doorverwijst maar die lijkt op zijn beurt niet de file te parsen?

code:
1
2
3
<FilesMatch "\.php$">
        SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>


PHP-FPM draait wel degelijk op poort 9000. SELinux is Permissive.
De volgende modules zijn geïnstalleerd: yum install httpd rh-php71-php-fpm.

Ik probeer in de browser naar een info.php te surfen en ik krijg gewoon de inhoud van dat bestand terug, waar kan er nog iets fout zitten?

[EDIT]: Oeps, dit moest een topic van het type "vraag" zijn..

[ Voor 5% gewijzigd door Hipska op 22-02-2018 16:54 ]

Alle reacties


  • Hero of Time
  • Registratie: Oktober 2004
  • Laatst online: 30-09 22:30

Hero of Time

Moderator LNX

There is only one Legend

:? Het is toch type vraag? O-)

Commandline FTW | Tweakt met mate


  • DJMaze
  • Registratie: Juni 2002
  • Niet online
code:
1
$ service php-fpm start

Maak je niet druk, dat doet de compressor maar


Acties:
  • 0 Henk 'm!

  • Barreljan
  • Registratie: December 2001
  • Laatst online: 30-09 13:10

Barreljan

...Zoom-Zoom...

Wel even netjes doen op Centos7 he ;)

code:
1
systemctl start php-fpm


Draai je ook virtual hosts? Staat je proxy stukje dan wel goed in de httpd conf? Je 'FilesMatch' stukje zelf klopt als een bus dus dat is het niet.

Dubbelchecks:

systemctl status php-fpm
netstat -tlpn | grep 9000

En je php-fpm config bestand, hoe staat die? Dat is als je de default gebruikt: /etc/php-fpm.d/www.conf. Niets in getweaked?

[ Voor 12% gewijzigd door Barreljan op 23-02-2018 09:11 ]

Time Attacker met de Mazda 323F 2.5 V6 J-spec | PV output


Acties:
  • 0 Henk 'm!

  • Hipska
  • Registratie: Mei 2008
  • Laatst online: 30-09 14:57
php-fpm draait inderdaad wel, anders krijg je andere foutmeldingen van apache.

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# systemctl status rh-php71-php-fpm
&#9679; rh-php71-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/rh-php71-php-fpm.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-02-22 15:28:20 UTC; 17h ago
 Main PID: 17623 (php-fpm)
   Status: "Processes active: 0, idle: 5, Requests: 4, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/rh-php71-php-fpm.service
           &#9500;&#9472;17623 php-fpm: master process (/etc/opt/rh/rh-php71/php-fpm.conf)
           &#9500;&#9472;17624 php-fpm: pool www
           &#9500;&#9472;17625 php-fpm: pool www
           &#9500;&#9472;17626 php-fpm: pool www
           &#9500;&#9472;17627 php-fpm: pool www
           &#9492;&#9472;17628 php-fpm: pool www

Feb 22 15:28:20 s003.super-visions.com systemd[1]: Starting The PHP FastCGI Process Manager...
Feb 22 15:28:20 s003.super-visions.com systemd[1]: Started The PHP FastCGI Process Manager.

# netstat -tlpn | grep 9000
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      17623/php-fpm: mast


Ik vermoed ook niet dat het aan apache config ligt, want als ik dat stukje weghaal dan served apache het als text/plain en met php het als text/html.

Aan www.conf heb ik niets veranderd..

[ Voor 53% gewijzigd door Hipska op 23-02-2018 09:29 ]


Acties:
  • 0 Henk 'm!

  • Barreljan
  • Registratie: December 2001
  • Laatst online: 30-09 13:10

Barreljan

...Zoom-Zoom...

Hipska schreef op vrijdag 23 februari 2018 @ 09:27:
php-fpm draait inderdaad wel, anders krijg je andere foutmeldingen van apache.

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# systemctl status rh-php71-php-fpm
&#9679; rh-php71-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/rh-php71-php-fpm.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-02-22 15:28:20 UTC; 17h ago
 Main PID: 17623 (php-fpm)
   Status: "Processes active: 0, idle: 5, Requests: 4, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/rh-php71-php-fpm.service
           &#9500;&#9472;17623 php-fpm: master process (/etc/opt/rh/rh-php71/php-fpm.conf)
           &#9500;&#9472;17624 php-fpm: pool www
           &#9500;&#9472;17625 php-fpm: pool www
           &#9500;&#9472;17626 php-fpm: pool www
           &#9500;&#9472;17627 php-fpm: pool www
           &#9492;&#9472;17628 php-fpm: pool www

Feb 22 15:28:20 s003.super-visions.com systemd[1]: Starting The PHP FastCGI Process Manager...
Feb 22 15:28:20 s003.super-visions.com systemd[1]: Started The PHP FastCGI Process Manager.

# netstat -tlpn | grep 9000
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      17623/php-fpm: mast


Ik vermoed ook niet dat het aan apache config ligt, want als ik dat stukje weghaal dan served apache het als text/plain en met php het als text/html.

Aan www.conf heb ik niets veranderd..
Als ik je install (yum) zo nog terug lees, dan klopt het ook

yum install rh-php71-php -y

php-fpm is nog niet de processor, die mist :) Niet zo gek dus

Time Attacker met de Mazda 323F 2.5 V6 J-spec | PV output


Acties:
  • 0 Henk 'm!

  • Hipska
  • Registratie: Mei 2008
  • Laatst online: 30-09 14:57
Dat lijkt het probleem ook niet te zijn, rh-ph71-php is wel degelijk geïnstalleerd :-(

Acties:
  • 0 Henk 'm!

  • DPLuS
  • Registratie: April 2000
  • Niet online

DPLuS

 

Welke httpd versie is dat die je daar geinstalleerd hebt?
Je moet wel versie 2.4 hebben, dat is in RHSCL httpd24-httpd.

Zie ook: https://access.redhat.com/solutions/1322993
Pagina: 1