0

I'm installing sympa 6.2.42 on a ubuntu server 18.04 with php 7.2 and fpm and apache 2.4.29 (installed with official packages) Sympa is installed from the source.

My virtual host under apache should normally run a fcgi script with fpm.

The problem is that my script is displayed in clear on my web page. The fcgi is therefore not executed, just displayed.

No errors in the logs (fpm/apache/syslog). The fpm/apache/sympa services runs normally.

I have change my script to a simple 'hello world', result is the same.

This is my virtual host:

<VirtualHost *:80>
    Servername    mycomputer.mydomain.com
    Serveradmin   step@mydomain.com

    Documentroot /var/www/sympa.mydomain.com

    <Location /sympa>
    SetHandler "proxy:unix:/var/run/php/php7.2-fpm.sock|fcgi://"
        Options +ExecCGI
        Require all granted
   </Location>

    <Location /static-sympa>
        Require all granted
    </Location>

    alias /static-sympa /appli/sympa/static-content
    ScriptAlias /sympa /appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi

    RewriteEngine on
    RewriteRule ^/$ /sympa [R,L]
</VirtualHost>

The output is the content of the wwsympa-wrapper.fcgi. wwsympa-wrapper is not execute.

Update 1

My apache log:

[Thu May 23 08:41:53.760226 2019] [authz_core:debug] [pid 17536:tid 139860299998976] mod_authz_core.c(809): [client XX.XX.XX.X:53422] AH01626: authorization result of Require all granted: granted
[Thu May 23 08:41:53.760287 2019] [authz_core:debug] [pid 17536:tid 139860299998976] mod_authz_core.c(809): [client XX.XX.XX.X:53422] AH01626: authorization result of <RequireAny>: granted
[Thu May 23 08:41:53.760309 2019] [proxy:debug] [pid 17536:tid 139860299998976] mod_proxy.c(1228): [client XX.XX.XX.X:53422] AH01143: Running scheme unix handler (attempt 0)
[Thu May 23 08:41:53.760323 2019] [proxy_fcgi:debug] [pid 17536:tid 139860299998976] mod_proxy_fcgi.c(995): [client XX.XX.XX.X:53422] AH01076: url: fcgi:///appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi proxyname: (null) proxyport: 0
[Thu May 23 08:41:53.760331 2019] [proxy_fcgi:debug] [pid 17536:tid 139860299998976] mod_proxy_fcgi.c(1002): [client XX.XX.XX.X:53422] AH01078: serving URL fcgi:///appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi
[Thu May 23 08:41:53.760336 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2162): AH00942: FCGI: has acquired connection for (*)
[Thu May 23 08:41:53.760345 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2215): [client XX.XX.XX.X:53422] AH00944: connecting fcgi:///appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi to :8000
[Thu May 23 08:41:53.760349 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2252): [client XX.XX.XX.X:53422] AH02545: fcgi: has determined UDS as /var/run/php/php7.2-fpm.sock
[Thu May 23 08:41:53.760398 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2424): [client XX.XX.XX.X:53422] AH00947: connected /appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi to httpd-UDS:0
[Thu May 23 08:41:53.760432 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2795): AH02823: FCGI: connection established with Unix domain socket /var/run/php/php7.2-fpm.sock (*)
[Thu May 23 08:41:53.761132 2019] [proxy:debug] [pid 17536:tid 139860299998976] proxy_util.c(2177): AH00943: FCGI: has released connection for (*)
[Thu May 23 08:41:53.761265 2019] [deflate:debug] [pid 17536:tid 139860299998976] mod_deflate.c(853): [client XX.XX.XX.X:53422] AH01384: Zlib: Compressed 10632 to 3341 : URL /sympa
philippe lhardy
  • 3,096
  • 29
  • 36
  • Has the `php-fpm` process been started? https://wiki.apache.org/httpd/PHP-FPM#php-fpm – Loek May 22 '19 at 12:31
  • yes, php7.2-fpm service is running (sympa / apache services are also running) –  May 22 '19 at 12:34

1 Answers1

0

This is not php-fpm who is returning the script. This behavior is generated because your configuration is wrong.

php-fpm work as a CGI gateway and you need to tell Apache to send .php file to it in order to be executed.

In your case, Apache does not know where to send this .php file and return simply the page as text.

I suggest to go here for install php-fpm properly with Apache

EDIT :

The configuration in Sympa documentation look like this :

<Location /sympa>
    SetHandler "proxy:unix:$PIDDIR/wwsympa.socket|fcgi://"
    Require all granted
</Location>

<Location /static-sympa>
    Require all granted
</Location>
P0pR0cK5
  • 107
  • 2
  • If i create a simple php file to display 'hello world' and change ScriptAlias /sympa /appli/sympa/lib/sympa/cgi/wwsympa-wrapper.fcgi to ScriptAlias /sympa /appli/sympa/lib/sympa/cgi/hello.php it works. Problem is precisely with the wwsympa-wrapper.fcgi file. –  May 22 '19 at 13:52
  • Is the service fpm started ? Is sympa running ? Is this doc helping ? : https://sympa-community.github.io/manual/install/configure-http-server-spawnfcgi.html Could you give us the complete config of apache ? – P0pR0cK5 May 22 '19 at 14:10
  • I edited my question with my full apache vhost. fpm/sympa/apache service is runnning normally –  May 22 '19 at 14:17
  • How do you have installed Sympa ? on the doc the apache configuration is different and include PID – P0pR0cK5 May 22 '19 at 14:26
  • Sympa is installed from the source by following the official document as much as possible –  May 22 '19 at 14:27
  • I've added a config from the doc in my answer. could you try ? – P0pR0cK5 May 22 '19 at 15:18
  • With your config, i have a 503 error, service unavailable. I updated my question with my apache log. Socket communication seems to be OK with my conf. –  May 23 '19 at 06:46