Vesta Control Panel - Forum
Community Forum
https://forum.vestacp.com/
Community Forum
https://forum.vestacp.com/
https://forum.vestacp.com/
TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1, 7.2, 7.3 for Debian and Ubuntu (and optionally directly nginx-PHP-FPM)
Page 1 of 8
Page 1 of 8
TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1, 7.2, 7.3 for Debian and Ubuntu (and optionally directly nginx-PHP-FPM)
Posted: Fri Jun 15, 2018 11:28 am
by dpeca
This tutorial will enable PHP 5.6, 7.0, 7.1, 7.2 and 7.3 to specific/desired domains.
Tutorial is for Debian and Ubuntu (but probably can give you a good direction for CentOS).
PHP will run through PHP-FPM, which is much more faster solution than other existent PHP-switcher that uses only old phpfcgid solution (because with PHP-FPM you can use opcache).
Communication to PHP-FPM will goes through Unix-sockets, which is also the fastest communication between daemons.
Second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
First pre-required step for Debian 9:
apt-get update
apt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list'
First pre-required step for Debian 8:
apt-get update
apt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ jessie main" > /etc/apt/sources.list.d/php.list'
First pre-required step for Ubuntu:
apt-get update
apt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
Then in your browser go to https://launchpad.net/~ondrej/+archive/ubuntu/php/
Under Adding this PPA to your system click Technical details about this PPA, select your Ubuntu version, and two lines that you get from field box below add to /etc/apt/sources.list.d/php.list
Second pre-required step for both Debian and Ubuntu:
apt-get update
a2enmod proxy_fcgi setenvif
For PHP 5.6
apt-get install php5.6-apcu php5.6-mbstring php5.6-bcmath php5.6-cli php5.6-curl php5.6-fpm php5.6-gd php5.6-intl php5.6-mcrypt php5.6-mysql php5.6-soap php5.6-xml php5.6-zip php5.6-memcache php5.6-memcached php5.6-zip
update-rc.d php5.6-fpm defaults
a2enconf php5.6-fpm
systemctl restart apache2
cp -r /etc/php/5.6/ /root/vst_install_backups/php5.6/
rm -f /etc/php/5.6/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.sh
For PHP 7.0
apt-get install php7.0-apcu php7.0-mbstring php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-intl php7.0-mcrypt php7.0-mysql php7.0-soap php7.0-xml php7.0-zip php7.0-memcache php7.0-memcached php7.0-zip
update-rc.d php7.0-fpm defaults
a2enconf php7.0-fpm
systemctl restart apache2
cp -r /etc/php/7.0/ /root/vst_install_backups/php7.0/
rm -f /etc/php/7.0/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.sh
For PHP 7.1
apt-get install php7.1-apcu php7.1-mbstring php7.1-bcmath php7.1-cli php7.1-curl php7.1-fpm php7.1-gd php7.1-intl php7.1-mcrypt php7.1-mysql php7.1-soap php7.1-xml php7.1-zip php7.1-memcache php7.1-memcached php7.1-zip
update-rc.d php7.1-fpm defaults
a2enconf php7.1-fpm
systemctl restart apache2
cp -r /etc/php/7.1/ /root/vst_install_backups/php7.1/
rm -f /etc/php/7.1/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.sh
For PHP 7.2
apt-get install php7.2-apcu php7.2-mbstring php7.2-bcmath php7.2-cli php7.2-curl php7.2-fpm php7.2-gd php7.2-intl php7.2-mysql php7.2-soap php7.2-xml php7.2-zip php7.2-memcache php7.2-memcached php7.2-zip
update-rc.d php7.2-fpm defaults
a2enconf php7.2-fpm
systemctl restart apache2
cp -r /etc/php/7.2/ /root/vst_install_backups/php7.2/
rm -f /etc/php/7.2/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.sh
For PHP 7.3
apt-get install php7.3-apcu php7.3-mbstring php7.3-bcmath php7.3-cli php7.3-curl php7.3-fpm php7.3-gd php7.3-intl php7.3-mysql php7.3-soap php7.3-xml php7.3-zip php7.3-memcache php7.3-memcached php7.3-zip
update-rc.d php7.3-fpm defaults
a2enconf php7.3-fpm
systemctl restart apache2
cp -r /etc/php/7.3/ /root/vst_install_backups/php7.3/
rm -f /etc/php/7.3/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.sh
For PHP 7.4
apt-get install php7.4-apcu php7.4-mbstring php7.4-bcmath php7.4-cli php7.4-curl php7.4-fpm php7.4-gd php7.4-intl php7.4-mysql php7.4-soap php7.4-xml php7.4-zip php7.4-memcache php7.4-memcached php7.4-zip
update-rc.d php7.4-fpm defaults
a2enconf php7.4-fpm
systemctl restart apache2
cp -r /etc/php/7.4/ /root/vst_install_backups/php7.4/
rm -f /etc/php/7.4/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
Posted: Fri Jun 15, 2018 11:28 am
by dpeca
This tutorial will enable PHP 5.6, 7.0, 7.1, 7.2 and 7.3 to specific/desired domains.
Tutorial is for Debian and Ubuntu (but probably can give you a good direction for CentOS).
PHP will run through PHP-FPM, which is much more faster solution than other existent PHP-switcher that uses only old phpfcgid solution (because with PHP-FPM you can use opcache).
Communication to PHP-FPM will goes through Unix-sockets, which is also the fastest communication between daemons.
Second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
First pre-required step for Debian 9:
apt-get updateapt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list'
First pre-required step for Debian 8:
apt-get updateapt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ jessie main" > /etc/apt/sources.list.d/php.list'
First pre-required step for Ubuntu:
apt-get updateapt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
Then in your browser go to https://launchpad.net/~ondrej/+archive/ubuntu/php/
Under Adding this PPA to your system click Technical details about this PPA, select your Ubuntu version, and two lines that you get from field box below add to /etc/apt/sources.list.d/php.list
Second pre-required step for both Debian and Ubuntu:
apt-get update
a2enmod proxy_fcgi setenvif
For PHP 5.6
apt-get install php5.6-apcu php5.6-mbstring php5.6-bcmath php5.6-cli php5.6-curl php5.6-fpm php5.6-gd php5.6-intl php5.6-mcrypt php5.6-mysql php5.6-soap php5.6-xml php5.6-zip php5.6-memcache php5.6-memcached php5.6-zip
update-rc.d php5.6-fpm defaults
a2enconf php5.6-fpm
systemctl restart apache2
cp -r /etc/php/5.6/ /root/vst_install_backups/php5.6/
rm -f /etc/php/5.6/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.sh
For PHP 7.0
apt-get install php7.0-apcu php7.0-mbstring php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-intl php7.0-mcrypt php7.0-mysql php7.0-soap php7.0-xml php7.0-zip php7.0-memcache php7.0-memcached php7.0-zip
update-rc.d php7.0-fpm defaults
a2enconf php7.0-fpm
systemctl restart apache2
cp -r /etc/php/7.0/ /root/vst_install_backups/php7.0/
rm -f /etc/php/7.0/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.sh
For PHP 7.1
apt-get install php7.1-apcu php7.1-mbstring php7.1-bcmath php7.1-cli php7.1-curl php7.1-fpm php7.1-gd php7.1-intl php7.1-mcrypt php7.1-mysql php7.1-soap php7.1-xml php7.1-zip php7.1-memcache php7.1-memcached php7.1-zip
update-rc.d php7.1-fpm defaults
a2enconf php7.1-fpm
systemctl restart apache2
cp -r /etc/php/7.1/ /root/vst_install_backups/php7.1/
rm -f /etc/php/7.1/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.sh
For PHP 7.2
apt-get install php7.2-apcu php7.2-mbstring php7.2-bcmath php7.2-cli php7.2-curl php7.2-fpm php7.2-gd php7.2-intl php7.2-mysql php7.2-soap php7.2-xml php7.2-zip php7.2-memcache php7.2-memcached php7.2-zip
update-rc.d php7.2-fpm defaults
a2enconf php7.2-fpm
systemctl restart apache2
cp -r /etc/php/7.2/ /root/vst_install_backups/php7.2/
rm -f /etc/php/7.2/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.sh
For PHP 7.3
apt-get install php7.3-apcu php7.3-mbstring php7.3-bcmath php7.3-cli php7.3-curl php7.3-fpm php7.3-gd php7.3-intl php7.3-mysql php7.3-soap php7.3-xml php7.3-zip php7.3-memcache php7.3-memcached php7.3-zip
update-rc.d php7.3-fpm defaults
a2enconf php7.3-fpm
systemctl restart apache2
cp -r /etc/php/7.3/ /root/vst_install_backups/php7.3/
rm -f /etc/php/7.3/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.sh
For PHP 7.4
apt-get install php7.4-apcu php7.4-mbstring php7.4-bcmath php7.4-cli php7.4-curl php7.4-fpm php7.4-gd php7.4-intl php7.4-mysql php7.4-soap php7.4-xml php7.4-zip php7.4-memcache php7.4-memcached php7.4-zip
update-rc.d php7.4-fpm defaults
a2enconf php7.4-fpm
systemctl restart apache2
cp -r /etc/php/7.4/ /root/vst_install_backups/php7.4/
rm -f /etc/php/7.4/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
Step forward: Enable direct communication between nginx and php-fpm (if you want to avoid Apache for specific domain)
Posted: Fri Jun 15, 2018 11:31 am
by dpeca
Step forward: Enable direct communication between nginx and php-fpm (if you want to avoid Apache for specific domain)
As I said in first post, second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
For custom PHP CMS:
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/default.tpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/default.stpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.sh
chmod a+x /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.sh
sed -i "s#%web_port%#%proxy_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#%web_ssl_port%#%proxy_ssl_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
For WordPress:
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/wordpress2.tpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/wordpress2.stpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.sh
chmod a+x /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.sh
sed -i "s#%web_port%#%proxy_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#%web_ssl_port%#%proxy_ssl_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
This way you can adapt any other existent Vesta PHP-FPM template for other CMS.
(list of CMS templates is here - https://github.com/serghey-rodin/vesta/ ... nx/php-fpm )
This is example for PHP 7.2.
You can install templates for other PHP version the same way, just substitute 7.2 and 72 with desired version.
Now simply go to Vesta, edit WEB for desired domain and choose:
Posted: Fri Jun 15, 2018 11:31 am
by dpeca
Step forward: Enable direct communication between nginx and php-fpm (if you want to avoid Apache for specific domain)
As I said in first post, second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
For custom PHP CMS:
For WordPress:
This way you can adapt any other existent Vesta PHP-FPM template for other CMS.
(list of CMS templates is here - https://github.com/serghey-rodin/vesta/ ... nx/php-fpm )
This is example for PHP 7.2.
You can install templates for other PHP version the same way, just substitute 7.2 and 72 with desired version.
Now simply go to Vesta, edit WEB for desired domain and choose:
As I said in first post, second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
For custom PHP CMS:
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/default.tpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/default.stpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.sh
chmod a+x /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.sh
sed -i "s#%web_port%#%proxy_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#%web_ssl_port%#%proxy_ssl_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
For WordPress:
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/wordpress2.tpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/wordpress2.stpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.sh
chmod a+x /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.sh
sed -i "s#%web_port%#%proxy_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#%web_ssl_port%#%proxy_ssl_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
(list of CMS templates is here - https://github.com/serghey-rodin/vesta/ ... nx/php-fpm )
This is example for PHP 7.2.
You can install templates for other PHP version the same way, just substitute 7.2 and 72 with desired version.
Now simply go to Vesta, edit WEB for desired domain and choose: