0

I configured the nginx according to the vultr , Then i had to remove it , so i removed it using sudo apt-get --purge remove nginx and after that sudo apt-get autoremove . No error till now . But now when i need to install nginx again using Digitalocean tutorial it's installed but at the time of start I keeps me giving error like below

root@onebyteRails:~/working/nginx-1.7.5# sudo update-rc.d nginx
defaults  System start/stop links for /etc/init.d/nginx already exist.
root@onebyteRails:~/working/nginx-1.7.5# sudo service nginx restart  *
Stopping Nginx Server...                                              
[fail]   * Starting Nginx Server...                                   
nginx: [emerg] no "events" section in configuration
0

You need to define the events{} block in your nginx.conf. Here is a full working example of an nginx.conf file: https://www.nginx.com/resources/wiki/start/topics/examples/full

0

Vultr installation didn't use apt, so it was not uninstalled with sudo apt-get autoremove, neither the /etc/init.d/nginx file was removed.

To remove the /etc/init.d/nginx:

sudo service nginx stop
sudo update-rc.d nginx remove
sudo rm /etc/init.d/nginx
sudo rm `which nginx`

Nginx doesn't have a make uninstall option, and I don't know exactly where vultr files were placed, but the Digital Ocean install (which uses apt) will probably ask to overwrite the configuration files if they are in the same location.

If you want to make sure you have removed all vultr nginx files before installing Digital Ocean, try running the make install again on the vultr src and manually removing all files it listed as updated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.