LAMP to LEMP Conversion in Linode
What is the best possible way for such conversion from LAMP to LEMP?
6 Replies
You can:
install Nginx from the command line.
configure Nginx to use a port other than port 80 (a temporary measure).
set up your vhost files for your websites using Nginx
test your websites using the Nginx port.
Once you're confident that everything is working as desired you can:
stop the Nginx service.
change the Nginx configuration to use port 80.
stop the Apache service (and make sure it doesn't automatically restart when your Linode reboots).
start the Nginx service (and make sure it automatically starts when your Linode reboots).
@Main Street James:
The best possible way? It all depends on your distro, your control panel software, etc.
2GB unmanaged linode vps account here. Hosted two websites in LAMP environment following this guide:
So, it appears that I can safely jump towards the conversion from LAMPP to LEMP. All I need is to follow:
and after successful working of sites in Nginx, I can uninstall Apache.
What additional step I have to take to make sure apache doesn't automatically restart when Linode reboots?
Regards
For Debain based distros (eg, Ubuntu, Linux Mint, etc):
update-rc.d -f apache2 remove
For Red Hat based distros (eg, Fedora, CentOS, etc):
# chkconfig httpd off
# chkconfig httpd --del
Please confirm whether the following steps are OK if I like to shift into LEMP environment completely.
1. Uninstall Apache using command: apt-get –purge remove apache2.
2. Install Nginx using command: apt-get install nginx.
3. Configure Nginx virtual hosting to use port 80.
4. Install PHP-FPM using command: apt-get install php5-fpm.
5. Configure PHP.
6. No need to configure MySQL as it is already installed and configured.
Do you agree with the above steps?
If it is alright, then, I shall try it tomorrow.
Honestly it is going to be a lot cleaner to just setup a new LEMP server and migrate your needed files over to the new VPS.
If you try to install multiple stacks it will get messy really fast and lead to possible security or stability problems.
Just setup a new LEMP stack and move your files, and delete the old server when you are sure its fine. For example if you have a Wordpress site on LAMP Apache just move your web design files (and database dump) to the LEMP server and that's all.