Project

General

Profile

Actions

action #179705

open

[qe-core] add test module for Apache FastCGI and PHP-FPM

Added by zluo 2 months ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
New test
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
medium
Tags:

Description

Apache FastCGI and PHP-FPM

At moment we don't test Apache FastCGI and PHP-FPM together on openQA. This is a real life scenarios.
The implementation should include following:

 install and configure Apache FastCGI and PHP-FPM based on SLES 15 SP7/SLES 16 and openSUSE Tumbleweed
 check that Apache server is working with php-fmp.service

Please read reference at: https://en.opensuse.org/SDB:Apache_FastCGI_and_PHP-FPM_configuration and create a test module 'apache2-php-fpm.pm'.
It can be scheduled as extra test under console tests.

Some aspects are relevant to the implementation:
firewall open ports for http and https,
guarantee required access to directories /srv/www/htdocs,
add apparmor policy or set selinux as passive mode or add policy (SLES 16, Tumbleweed) if required.

Here example configurations:

php-fpm configuration:

   [www]
   user = wwwrun
   group = www
   listen = /run/php-fpm/php-fpm.sock
   listen.owner = wwwrun
   listen.group = www
   listen.mode = 0660

run systemctl restart php-fpm.service later.

create php-fpm.conf and save as /etc/apache2/conf.d/php-fpm.conf

 <FilesMatch \.php$>
     SetHandler "proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost"
 </FilesMatch>

create test file 'test.php' and verify it can be accessed/displayed in browser:

<?php phpinfo(); ?>
Actions

Also available in: Atom PDF