Are you trying to remove Nginx on Linux in the Vesta control panel? We can help you do it.

Here at Bobcares, we have seen several such Nginx-related queries as part of our Server Management Services for web hosts and online service providers.

Today we will take a look at how to remove Nginx on Linux in the Vesta control panel.

 

Remove Nginx on RHEL/CentOS in Vesta Control Panel

Here are the steps that we follow to remove the 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

 

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

 

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

Now let’s take a look at how our Support Engineers resolve this error.

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 any further assistance with Nginx-related queries? – We’re available 24*7]

 

Conclusion

Today, we saw how our Support Engineers remove Nginx on Linux in the Vesta control panel.