Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Multiple PHP-FPM + Apache2 for VestaCP

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
9 posts • Page 1 of 1
Lesiu
Posts: 7
Joined: Thu Jul 27, 2017 10:20 am

Multiple PHP-FPM + Apache2 for VestaCP
  • Quote

Post by Lesiu » Thu Jul 27, 2017 11:14 am

I have Debian 8.8. Fresh install. VestaCP 0.9.8-17. I'am able to install multiple versions of PHP (5.6, 7.0, 7.1) with OpCache and they run as FastCGI (mod_fcgid). So I have 3 additional templates for Apache2. If anyone needs them - let me know and I will provide exact how to. PHP's run as FastCGI work fine, no problems with privileges.

However I wanted to install PHP-FPM version. So right now I have multiple versions of PHP (5.6, 7.0, 7.1) with appropriate templates. PHP files execute fine and phpinfo(); shows FPM/FastCGI. But I have problems with privileges/ownership the same as with HHVM. After I installed PHP-FPM the processes are run by www-data, not by admin. So I can't upload any files. I know that chmod -R www-data:www-data would help, but I still want to have access to these files via FTP as admin user. So I need to run all those PHP-FPM processes as admin user. How to do it? How to make it work after reboot?
Top

Lesiu
Posts: 7
Joined: Thu Jul 27, 2017 10:20 am

Re: Multiple PHP-FPM + Apache2 for VestaCP
  • Quote

Post by Lesiu » Thu Jul 27, 2017 12:17 pm

Never mind. I did it. I had to create pools for user admin.

BTW. I'm preparing a comprehensive tutorial based on Debian 8 (jesse) and VestaCP. It contains:
- root password change
- SSH port change
- newer OpenSSL (1.0.2)
- newer fail2ban (0.9.7)
- nginx with newer OpenSSL (HTTP/2 support with ALPN support) (with template)
- HHVM (with template)
- PHP 5.6, PHP 7.0, PHP 7.1 run as FastCGI (with templates)
- PHP 5.6, PHP 7.0, PHP 7.1 run as PHP-FPM (with templates)
- MariaDB instead of MySQL (probably)
- newer Apache2 (probably)
- CSF (probably)
Top

hassaan
Posts: 5
Joined: Thu Jun 28, 2018 9:17 am

Os: CentOS 6x
Web: apache + nginx
Re: Multiple PHP-FPM + Apache2 for VestaCP
  • Quote

Post by hassaan » Wed Jul 18, 2018 4:14 pm

Lesiu wrote: ↑
Thu Jul 27, 2017 12:17 pm
Never mind. I did it. I had to create pools for user admin.

BTW. I'm preparing a comprehensive tutorial based on Debian 8 (jesse) and VestaCP. It contains:
- root password change
- SSH port change
- newer OpenSSL (1.0.2)
- newer fail2ban (0.9.7)
- nginx with newer OpenSSL (HTTP/2 support with ALPN support) (with template)
- HHVM (with template)
- PHP 5.6, PHP 7.0, PHP 7.1 run as FastCGI (with templates)
- PHP 5.6, PHP 7.0, PHP 7.1 run as PHP-FPM (with templates)
- MariaDB instead of MySQL (probably)
- newer Apache2 (probably)
- CSF (probably)

Can you please share this one with us?
Top

mp2017
Posts: 2
Joined: Fri Jul 20, 2018 12:40 pm

Os: Debian 7x
Web: apache + nginx
Re: Multiple PHP-FPM + Apache2 for VestaCP
  • Quote

Post by mp2017 » Fri Jul 20, 2018 12:43 pm

yes! please) .. this guide is very needed.
thank you
Top

tamerhassan
Posts: 1
Joined: Sat Sep 08, 2018 12:41 pm

Os: Ubuntu 16x
Web: nginx + php-fpm
Re: Multiple PHP-FPM + Apache2 for VestaCP
  • Quote

Post by tamerhassan » Sat Sep 08, 2018 12:43 pm

coming soon? at least these two I'm very much interested to see with latest vestacp:
- nginx with newer OpenSSL (HTTP/2 support with ALPN support) (with template)
- PHP 5.6, PHP 7.0, PHP 7.1 run as PHP-FPM (with templates)
Top

Lesiu
Posts: 7
Joined: Thu Jul 27, 2017 10:20 am

Re: Multiple PHP-FPM + Apache2 for VestaCP
  • Quote

Post by Lesiu » Mon Feb 04, 2019 8:29 pm

https://www.lesiu.eu/konfiguracja-serwe ... nel-vesta/

Comprehensive tutorial based on Debian 9 Stretch. Several PHP versions (7.0, 7.1, 7.2 and 7.3). Every of them working as fcgid and PHP-FPM as well (you can choose per website). You can also choose between original MySQL and Percona Server (version 8).
Top

Felix
Posts: 134
Joined: Tue Aug 04, 2015 7:15 pm

Os: Ubuntu 15x
Web: apache + nginx
Re: Multiple PHP-FPM + Apache2 for VestaCP
  • Quote

Post by Felix » Mon Feb 11, 2019 5:18 pm

Lesiu wrote: ↑
Mon Feb 04, 2019 8:29 pm
https://www.lesiu.eu/konfiguracja-serwe ... nel-vesta/

Comprehensive tutorial based on Debian 9 Stretch. Several PHP versions (7.0, 7.1, 7.2 and 7.3). Every of them working as fcgid and PHP-FPM as well (you can choose per website). You can also choose between original MySQL and Percona Server (version 8).
Hey Lesiu! Thank you for the tutorial, which looks nice and promising. Can't wait to try it on a new server. Quick questions for now:
1. Would you consider moving your code to Github or other version control system?
2. Do you think VESTA updates might break your code or cause other problems?
Top

Lesiu
Posts: 7
Joined: Thu Jul 27, 2017 10:20 am

Re: Multiple PHP-FPM + Apache2 for VestaCP
  • Quote

Post by Lesiu » Wed Feb 13, 2019 9:49 am

Hey Felix. I already know there must be a quick fix applied if you choose Percona Server (version 8) as creating user and granting privileges is a bit different in MySQL 8. It will work, but roundcube user is not created, so roundcube won't work out of the box. It's very simple to fix this as roundcube database is being created successfully.

1. I have no knowledge regarding Github.
2. There may be some minor issues after update but they are related to php-fpm and new users only. My version is just a modified installer with several new templates. So templates won't be overwritten, services won't be removed. A minor issue is related to creation of new spool for php-fpm. I will write a short how-to fix. It's just one line of code to be added to /bin/v-add-user and one line to /bin/v-delete-user - there must be a line that executes additional /bin/v-add-user-fpm and /bin/v-delete-user-fpm. That's it.

Some other enhancements may be done, that I recommend. I have rainloop as an alternative to roundcube. I also have squid proxy server configured as elite proxy, but they are not related to vesta.

There is also one thing to be modified if you want to use longer database names. Vesta limits database names when being created to 16 characters. However MySQL 8 and probably 5.7 allow 32 characters. And I use those bigger limit, because remember that vesta adds user_ prefix to every database name, so if you have user michael, then you have michael_ prefix and you have only 8 characters left. That's not enough for me.
Top

hazoi77
Posts: 1
Joined: Fri Apr 05, 2019 11:35 am

Os: Debian 8x
Web: nginx + php-fpm
Re: Multiple PHP-FPM + Apache2 for VestaCP
  • Quote

Post by hazoi77 » Fri Apr 05, 2019 11:58 am

Lesiu wrote: ↑
Wed Feb 13, 2019 9:49 am
Hey Felix. I already know there must be a quick fix applied if you choose Percona Server (version 8) as creating user and granting privileges is a bit different in MySQL 8. It will work, but roundcube user is not created, so roundcube won't work out of the box. It's very simple to fix this as roundcube database is being created successfully.

1. I have no knowledge regarding Github.
2. There may be some minor issues after update but they are related to php-fpm and new users only. My version is just a modified installer with several new templates. So templates won't be overwritten, services won't be removed. A minor issue is related to creation of new spool for php-fpm. I will write a short how-to fix. It's just one line of code to be added to /bin/v-add-user and one line to /bin/v-delete-user - there must be a line that executes additional /bin/v-add-user-fpm and /bin/v-delete-user-fpm. That's it.

Some other enhancements may be done, that I recommend. I have rainloop as an alternative to roundcube. I also have squid proxy server configured as elite proxy, but they are not related to vesta.

There is also one thing to be modified if you want to use longer database names. Vesta limits database names when being created to 16 characters. However MySQL 8 and probably 5.7 allow 32 characters. And I use those bigger limit, because remember that vesta adds user_ prefix to every database name, so if you have user michael, then you have michael_ prefix and you have only 8 characters left. That's not enough for me.
Hello Lesiu, I know I'm going to ask for something that is for convenience, but I had to do it, do you plan to do a translation of the guide?
The last changes you commented about PHP-FPM, did you make them?

Thank you and by the way, good guide.
Top


Post Reply
  • Print view

9 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password