簡體   English   中英

如果我刪除了 /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?

root身份登錄或:

sudo su -

然后卸載nginx:

apt-get purge nginx nginx-common nginx-full  

然后安裝它:

apt-get install nginx

另一種方法是使用-H運行 sudo 命令:

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

嘗試:

sudo aptitude purge nginx && sudo aptitude install nginx

此代碼將刪除並重新安裝 Nginx

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM