简体   繁体   English

更改默认的Nginx位置

[英]Change default nginx location

I am stuck in a scenario. 我陷入了一个场景。 I had nginx already installed on my linux server at /etc/nginx/ but it did not has passenger mod enabled. 我已经在/ etc / nginx /的linux服务器上安装了nginx,但尚未启用passenger mod。 So i run 所以我跑

passenger-install-nginx-module 乘客安装nginx模块

to but then in the wizard i chosen the option 1 to download and configure fresh nginx because i did not know the "source" location of previously installed nginx. 到,但随后在向导中,我选择了选项1以下载和配置新的nginx,因为我不知道以前安装的nginx的“源”位置。 So it downloaded and configure the nginx but at different location: /opt/nginx/ 因此,它在不同位置下载并配置了Nginx: / opt / nginx /

Now the problem is server is getting only previously installed at /etc/nignx/ . 现在的问题是服务器仅以前安装在/ etc / nignx /中

Do i have to change the default location somewhere? 我必须在某处更改默认位置吗? IF yes, then how? 如果是,那怎么办? i couldnt find it anywhere on google. 我在Google的任何地方都找不到它。

您可以简单地将/ etc / nginx备份到某个位置,将其删除,然后使用ln /opt/nginx /etc -s进行符号链接,以将两个位置都指向同一位置。

stop the nginx process running at /etc/nginx and then start the server from /opt/nginx. 停止在/ etc / nginx上运行的nginx进程,然后从/ opt / nginx启动服务器。

 sudo /opt/nginx/sbin/nginx

will start nginx. 将启动nginx。 You should have the root path set properly in the nginx conf. 您应该在nginx conf中正确设置根路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM