如果我删除了 /etc/nginx 文件夹 (Ubuntu 14.04),如何重新安装 nginx?

How to reinstall nginx if I deleted /etc/nginx folder (Ubuntu 14.04)?

我正在尝试重新安装 nginx,但我有这个

nginx -t

nginx: [alert] could not open error log file: open()    
"/var/log/nginx/error.log" failed (2: No such file or directory)
2015/01/25 16:18:01 [emerg] 1400#0: open() "/etc/nginx/nginx.conf"   
failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed

如果删除了所有 nginx 文件夹,如何安装和启动 nginx?

尝试:

sudo aptitude purge nginx && sudo aptitude install nginx

此代码将删除并重新安装 Nginx

apt-get --purge remove nginx-*
apt-get install nginx

root 身份登录或:

sudo su -

然后卸载nginx:

apt-get purge nginx nginx-common nginx-full  

然后安装它:

apt-get install nginx

另一种方法是 运行 sudo 命令 -H:

sudo -H apt-get purge nginx nginx-common nginx-full  
sudo -H apt-get install nginx