如何安装nginx并安装配置文件

Mac*_*Mac 16 ubuntu nginx apt

我刚刚从我的服务器(Ubuntu 11.04)完全卸载了 nginx 1.0.6 使用

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*
Run Code Online (Sandbox Code Playgroud)

现在我想再次安装它,但是在启动 nginx 时,我收到如下错误:

重启 nginx: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

然后我放置了我自己的conf文件,然后我收到一个新错误:

重新启动 nginx: nginx: [emerg] open() "/etc/nginx/mime.types" failed (2: No such file or directory) in /etc/nginx/nginx.conf:12

现在好像apt-get install nginx没有完全安装好,我清空了apt-get缓存,好像没有用。如何使用 apt-get 获得 nginx的完整安装?

Geo*_*lis 30

apt-get remove --purge nginx nginx-full nginx-common先运行,然后apt-get install nginx看看它是否有效。


小智 7

第一的

sudo apt-get -o DPkg::options::=--force-confmiss --reinstall install nginx-common
Run Code Online (Sandbox Code Playgroud)

然后测试

sudo nginx -t
Run Code Online (Sandbox Code Playgroud)