×

Remove Nginx on linux in Vesta control panel - Step by Step process to do it


Remove Nginx on linux in Vesta control panel - Step by Step process to do it
Are you trying to remove Nginx on Linux in the Vesta control panel?

This guide will help you.


Sometimes, VestaCP users might need to use other Web Servers such as Apache on their control panel and remove Nginx.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform Nginx related queries.

In this context, we shall look into how to remove Nginx on Linux in the Vesta control panel.


Steps to remove Nginx on RHEL/CentOS in Vesta Control Panel ?

Follow the process below to remove Nginx from RHEL/CentOS:

1. First, we stop the Nginx service. For that, we run the below command.

# service nginx stop

2. Next, we remove the Nginx package by running the below command:

# yum remove nginx

3. After that, we change the vesta configuration. For that, we execute the below commands:

# cd /usr/local/vesta/conf
# sed -i “/PROXY_*/d” vesta.conf
# sed -i “s/8080/80/” vesta.conf
# sed -i “s/8443/443/” vesta.conf

4. Then we change httpd configuration by running below commands:

# cd /etc/httpd/conf.d
# sed -i “s/8080/80/” *.conf
# sed -i “s/8443/443/” *.conf

5. Finally, we rebuild vhost configs:

# for user in $(v-list-sys-users plain); do v-rebuild-web-domains $user; done


To remove Nginx on Debian/Ubuntu in Vesta Control Panel:

1. First, we stop Nginx service by running the below command:

# service nginx stop

2. Next, we remove Nginx package by running the below command:

# apt-get remove nginx

3. After that, we change vesta configuration:

# cd /usr/local/vesta/conf
# sed -i “/PROXY_*/d” vesta.conf
# sed -i “s/8080/80/” vesta.conf
# sed -i “s/8443/443/” vesta.conf

4. Then we change httpd configuration. For that, we run the below commands:

# cd /etc/apache2/conf.d
# sed -i “s/8080/80/” *.conf
# sed -i “s/8443/443/” *.conf

5. Finally, we rebuild vhost configs:

# for user in $(v-list-sys-users plain); do v-rebuild-web-domains $user; done


How to resolve Nginx error on Vesta Control Panel installation ?

While trying to install VestaCP on Ubuntu with previously installed Nginx, an error occurs when executing the below command:

$ bash vst-install.sh

Here is the error message that appears:

Following packages are already installed:
nginx
It is highly recommended to remove them before proceeding.
If you want to force installation run this script with -f option:
Example: bash vst-install-ubuntu.sh –force

To resolve this error, apply the tips given below:

First, we remove Nginx using the following commands:

$ sudo apt-get remove nginx
$ sudo apt-get purge nginx
$sudo apt-get autoremove

If Nginx and all its configuration files are removed, we either use the -f flag mentioned by the installer or rebuild the droplet from the control panel using a stock OS image.

However, with any web hosting control panel, it is always recommended to start from a completely clean server rather than trying to clean it or remove packages.


[Need urgent assistance in resolving Nginx related issues? – We're available 24*7. ]

Who We Are ?

Most prominent, efficient, and well-performing IT companies and software solutions.

Related Posts