MrPointy's journey designing, building and deploying private clouds

Modifying the default port on Chef 12

2016-07-31

Just a quick blog, probably more to help me remember in the future if I have a ‘Goldfish’ moment.

I’m running Chef Server 12 on my OpenVPN server. OpenVPN was there first and has port 443. Rather than reconfiguring that I decided to reconfigure Chef server to user port 444 and 84 for https and http respectively.

With Chef Server 12, where you set these values has been changed. It’s now at /etc/opscode/chef-server.rb. Normally, this file doesn’t exist.

A quick edit, later and I have :

1
2
nginx['ssl_port']=444
nginx['non_ssl_port']=84

Now, just a quick reconfigure :

1
$ sudo chef-server-ctl reconfigure

and we’re good to go.

reconfig

and netstat shows us

netstat

We need to modify our knife.rb to point to the correct port :

knife.rb

Note: Due to bug #50 [https://github.com/chef/chef-server/issues/50] that was still open at the time of writing you have to edit /opt/opscode/embedded/cookbooks/private-chef/templates/default/oc_erchef.config.erb to set s3_url to “https://your.fqdn:yourport“ otherwise you wont be able to upload cookbooks ;-(

s3url