Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chef Server on different port

Tags:

chef-infra

I installed a chef server 11 on a Server that is behind a firewall, ie I had to set up some natting for this server to be available and as a result the server is reachable on port 449 from the outside (instead of default 443 https port). Now I installed chef on my workstation, and set up knife. I set my chef_server_url as https://blahblah.com:449 (thats a bogus domain) . Now I can connect with knife to the server, since if I run something like 'knife client list', it does give the list. However, if I want to upload a cookbook, it does not do it, an it looks as if it tries to connect to the chef_server_url on the normal port 443:

h046n100:chef-repo chris$ knife cookbook upload hostname
Uploading hostname       [0.1.0]
ERROR: Network Error: Error connecting to https://blahblah.com/sandboxes/00000000000020ec9bdebdbdaff8b9ed - Operation timed out - connect(2)
Check your knife configuration and network settings

Any ideas anyone why it is doing this, and if/how it is possible to tell chef to use port 449?

Many thanks in advance!

like image 273
Christophe Gehlen Avatar asked Aug 01 '13 15:08

Christophe Gehlen


1 Answers

You have to create or edit /etc/chef-server/chef-server.rb and add the line below:

nginx['ssl_port'] = 449

Then run:

sudo chef-server-ctl reconfigure
sudo chef-server-ctl restart

Please see the docs.

like image 107
Hui Hu Avatar answered Oct 12 '22 20:10

Hui Hu