如何更改chef nginx默认的http端口80? [英] How to change chef nginx default http port 80?
问题描述
我尝试在安装了Chef-server的计算机上安装apache.由于厨师nginx占用了端口80,Apache无法启动.如果我想让apache使用默认端口80,是否可以将Chef nginx默认http端口更改为另一个端口?
I tried to install apache on a machine that chef-server was installed. Apache could not start up due to the occupation of port 80 by chef nginx. If I want to let apache use port 80 as default, is it possible to change chef nginx default http port to another one?
我在Internet上找到了一种在apache和nginx上都设置虚拟主机的解决方案,但是它们需要
I found a solution on the Internet to set virtual host on both apache and nginx, but they need a different FQDN as server name. My machine uses an IP instead of FQDN, so I need to change the default HTTP port for chef nginx.
我尝试添加具有以下内容的/etc/chef-server/chef-server.rb
:
I tried to add /etc/chef-server/chef-server.rb
with the following content:
nginx['non_ssl_port'] = 9898
然后我运行了"chef-server-ctl重新配置".没用
Then I ran 'chef-server-ctl reconfigure'. It didn't work.
有人可以帮忙吗?谢谢.
Can anyone help on this? Thanks.
已更新
关于更改厨师服务器设置,我的信息有误.
My information was wrong regarding changing the chef server settings.
设置应添加到Chef12的/etc/opscode/chef-server.rb
中. chef-server-ctl reconfigure
之后,nginx的HTTP端口更改为9898.
谢谢.
The settings should be added into /etc/opscode/chef-server.rb
for Chef12. After chef-server-ctl reconfigure
, nginx's HTTP port is changed to 9898.
Thanks.
推荐答案
以下是更改端口的方法.编辑/etc/opscode/chef-server.rb
Here is how to change the port. Edit /etc/opscode/chef-server.rb
nginx['non_ssl_port'] = 10080
nginx['ssl_port'] = 10443
nginx['url'] = "https://<YOUR URL>:10443/"
并调整您的本地~/.chef/knife.rb
以阅读
chef_server_url 'https://<YOUR URL>:10443/organizations/<YOUR ORG>'
但是Chef目前存在一个错误,该错误阻止嵌入式nginx在非标准端口上运行:
But currently there is a bug in Chef that prevents the embedded nginx to run on a non standard port: https://github.com/chef/chef-server/issues/50
这篇关于如何更改chef nginx默认的http端口80?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!