open() /etc/nginx/nginx.conf failed

Ads
 

open() /etc/nginx/nginx.conf failed

Hi,

I have installed nginx on Ununtu 18.04 but then un installed. After that deleted /etc/nginx/ directory.

Then again installed nginx with following command:

sudo apt install nginx

But when I am restarting it exits with following error:

Apr 04 17:29:34 bugs-VirtualBox nginx[2880]: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
Apr 04 17:29:34 bugs-VirtualBox nginx[2880]: nginx: configuration file /etc/nginx/nginx.conf test failed
Apr 04 17:29:34 bugs-VirtualBox systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 04 17:29:34 bugs-VirtualBox systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 04 17:29:34 bugs-VirtualBox systemd[1]: Failed to start A high performance web server and a reverse proxy server.
-- Subject: Unit nginx.service has failed

How to resolve this?

Thanks

View Answers

April 4, 2019 at 7:13 AM

Hi,

You have purge compete installation with following command:

apt-get purge nginx nginx-common nginx-full

Then install with following command:

apt-get install nginx

After installation with these steps it worked again.

Thanks

Ads









Related Tutorials/Questions & Answers:

Ads