You are not logged in.

#1 2019-04-17 12:55:59

mezcal
Member
From: Czech Republic
Registered: 2006-01-31
Posts: 67
Website

[SOLVED] PostfixAdmin apache setting

Hello,
I have upgraded my mail server. Postfixadmin has been changed. It needs to be run its user and group postfixadmin.
How to set up apache to run postfixdmin as postfixadmin:postfixadmin and the rest of webapps as http:http?
Thanks
Filip

Last edited by mezcal (2019-07-23 14:49:39)

Offline

#2 2019-05-10 18:42:33

brasas
Member
Registered: 2010-05-28
Posts: 25

Re: [SOLVED] PostfixAdmin apache setting

I ran into this also, and attempted various ways to resolve, including installing mpm-itk ( http://mpm-itk.sesse.net/ ) to no avail. This particular apache install runs another internal webapp, so changing the apache user from http to postfixadmin in the httpd.conf file made the other site not work. In the end, I got it working by adding the http user to the postfixadmin group, and chmodding the necessary files/folder permissions to allow the required read/write access. Pretty sure this is a hack. If anybody knows an official or better way to get apache to run different sites as different users, please chime in. Thanks!


May you live all the days of your life.
                                  - Jonathan Swift

Offline

#3 2019-07-23 14:48:43

mezcal
Member
From: Czech Republic
Registered: 2006-01-31
Posts: 67
Website

Re: [SOLVED] PostfixAdmin apache setting

I have tried using uwsgi. Unfortunatelly an implementation in apache is
not good. PHP files was working but css and images was not processed.
Without css the pages was not usable.

php-fpm is working like a charm.

It is written in wiki
Install php-fpm. Create pool for postfixadmin.

/etc/httpd/conf/postfixadmin.conf

Alias /postfixadmin "/usr/share/webapps/postfixadmin/public"
<Directory "/usr/share/webapps/postfixadmin/public">
    DirectoryIndex index.html index.php
    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php-fpm/postfixadmin.sock|fcgi://localhost/"
    </FilesMatch>
    AllowOverride All
    Options FollowSymlinks
    Require all granted
    SetEnv PHP_ADMIN_VALUE "open_basedir = /tmp/:/usr/share/webapps/postfixadmin:/etc/webapps/postfixadmin/:/var/cache/postfixadmin/templates_c"
</Directory>

/etc/php/php-fpm.d/postfixadmin.conf

[postfixadmin]
 user = postfixadmin
 group = postfixadmin
 listen = /run/php-fpm/postfixadmin.sock
 listen.owner = http
 listen.group = http
 pm = ondemand
 pm.max_children = 4

Last edited by mezcal (2019-07-23 15:02:34)

Offline

#4 2019-12-02 13:10:30

B3l3tte
Member
Registered: 2016-10-26
Posts: 14

Re: [SOLVED] PostfixAdmin apache setting

Due to the latest update of php, postfixadmin php-fpm pool causes the php-fpm service to fail :

$ sudo systemctl status php-fpm
* php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-12-02 13:54:24 CET; 10min ago
  Process: 447 ExecStart=/usr/bin/php-fpm --nodaemonize --fpm-config /etc/php/php-fpm.conf (code=exited, status=78)
 Main PID: 447 (code=exited, status=78)

Dec 02 13:54:20 rpi3 systemd[1]: Starting The PHP FastCGI Process Manager...
Dec 02 13:54:24 rpi3 php-fpm[447]: [ERROR] unable to bind listening socket for address '/run/postfixadmin/postfixadmin.sock': Permission denied (13)
Dec 02 13:54:24 rpi3 php-fpm[447]: [ERROR] FPM initialization failed
Dec 02 13:54:24 rpi3 php-fpm[447]: [ERROR] unable to bind listening socket for address '/run/postfixadmin/postfixadmin.sock': Permission denied (13)
Dec 02 13:54:24 rpi3 php-fpm[447]: [ERROR] FPM initialization failed
Dec 02 13:54:24 rpi3 systemd[1]: php-fpm.service: Main process exited, code=exited, status=78/CONFIG
Dec 02 13:54:24 rpi3 systemd[1]: php-fpm.service: Failed with result 'exit-code'.
Dec 02 13:54:24 rpi3 systemd[1]: Failed to start The PHP FastCGI Process Manager.

This is linked to the following bug. I have asked to re-open it as in the case of PostfixAdmin PHP-FPM pool, the change to ACL parameters (see following lines) is not sufficient to make it work.

/etc/php/php-fpm.d/postfixadmin.conf

[postfixadmin]
user = postfixadmin
group = postfixadmin
listen = /run/postfixadmin/postfixadmin.sock
;listen.owner = http
;listen.group = http
listen.acl_users = http
listen.acl_groups = http
pm = ondemand
pm.max_children = 4

Does anybody have an idea on that matter ?

Offline

#5 2019-12-02 15:33:51

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,772

Re: [SOLVED] PostfixAdmin apache setting

B3l3tte,

It appears your issue is related to this thread, but it is a separate issue.  As this is a fairly old thread that has been sagged as solved, I am going to go ahead and close this thread while inviting you to start a new thread that you will own.  If you feel this thread is appropriate, you can link back to it if you wish.

Thanks.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB