I've just completely uninstalled nginx 1.0.6 from my server (Ubuntu 11.04) using
apt-get remove nginx
rm -rf /etc/nginx/
rm -rf /usr/sbin/nginx
rm /usr/share/man/man1/nginx.1.gz
apt-get remove nginx*
Now I want to install it again, however when starting nginx, I get errors such as:
Restarting nginx: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
Then I placed my own conf file, then I get a new error:
Restarting nginx: nginx: [emerg] open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:12
Now it seems that apt-get install nginx
doesn't install it completely, I cleared the apt-get cache, doesn't seem to help. How can I get a full installation of nginx using apt-get?
Run
apt-get remove --purge nginx nginx-full nginx-common
first, and thenapt-get install nginx
and see if it works.first
then test
If you are not prompted to prove successful uninstall
I had the same problem, and solved it by copying the configuration files from
/opt/
into/etc/
:You first of all want to make sure that the older nginx is uninstalled completely together with its conf files.
Then install nginx. The nginx-extras comes in handy when you want to check your conf files for errors
Then check whether your conf files are okay with the command;