Page 1 of 1

How to switch from Nginx+PHP-FPM to Apache+Nginx ?

Posted: Sun Dec 23, 2018 4:31 pm
by Spheerys
Hi,

Is it possible to switch from Nginx+PHP-FPM to Apache+Nginx without interrupt for a long time the uptime of the hosted websites ?
If yes, how ?
I'm running debian Jessie 9.5

Thanks :)

Re: How to switch from Nginx+PHP-FPM to Apache+Nginx ?

Posted: Sun Nov 29, 2020 5:10 am
by mylastore
so is it possible?
I am on ubuntu 18

Re: How to switch from Nginx+PHP-FPM to Apache+Nginx ?

Posted: Sun Nov 29, 2020 6:48 am
by grayfolk
mylastore wrote:
Sun Nov 29, 2020 5:10 am
so is it possible?
I am on ubuntu 18
Just reinstall Vesta.

Re: How to switch from Nginx+PHP-FPM to Apache+Nginx ?

Posted: Sun Feb 07, 2021 2:56 am
by Vegas10128
grayfolk wrote:
Sun Nov 29, 2020 6:48 am
mylastore wrote:
Sun Nov 29, 2020 5:10 am
so is it possible?
I am on ubuntu 18
Just reinstall Vesta.
This post is dated, however if your running on the following instances.
Virtual Machine
Dedicated Machine (Physical)

Have a new / separate instance of ubuntu version which vestacp supports. 16.04, 18.04, etc.
Install as a local machine on the same network.

After installation of new instance, login to your current live vesta server and add the following domain on the (primary) Vesta server.
after adding domain login to server via SSH.

Code: Select all

cd /home/admin/conf/web/

Code: Select all

sudo ls
to verify if the domain apache2.conf and nginx.conf files are available for the domain.

Code: Select all

sudo nano exampledomain.com.apache2.conf

Code: Select all

sudo nano exampledomain.com.apache2.ssl.conf
edit virtual ip from the current vestacp server to the 2nd vestacp which has PHP-FPM

Code: Select all

sudo nano exampledomain.com.nginx.conf
Leave the listening IP alone, modify

Code: Select all

proxy_pass      http://XXX.XXX.XX.X:8080;
To the local ip address of the new VestaCP server with PHP-FPM

Code: Select all

sudo nano exampledomain.com.nginx.ssl.conf
Leave the listening IP alone, modify

Code: Select all

proxy_pass      https://XXX.XXX.XX.X:8443;
To the local ip address of the new VestaCP server with PHP-FPM

save file after modification,

Code: Select all

cd /

Code: Select all

sudo service apache2 restart && sudo service nginx restart
Nice! You just forwarded your domain to another VestaCP server which provides and serves PHP-FPM services on the same network using the same public ip address.
No reason to just re-install the machine if you have other websites on that server.

if you do not see

Code: Select all

sudo nano exampledomain.com.apache2.ssl.conf

Code: Select all

sudo nano exampledomain.com.nginx.ssl.conf
It is likely you do not have SSL setup and configured on your server. So disregard the steps needed for changing the following config files.