Problems installing a Chef server

I am trying to install the chef server (chef-server-core-12.1.0-1.el6.x86_64.rpm) on my CentOS 6.5 computer using this guide: http://docs.chef.io/server/install_server.html# standalone This is a test environment, so I do not have a fully qualified domain name, but the IP address is resolved. After running the chef-server-ctl configuration, I will try to create a user using:

[ root@xxx-xxx-xxx-xxx ~]# chef-server-ctl user-create myusername myfirstname mylastname myemail mypassword --filename /root/myfile.pem 

I fill in the relevant data in the above command, but I keep getting this error:

 ERROR: Connection refused connecting to https://127.0.0.1/users/, retry 5/5 ERROR: Network Error: Connection refused - Connection refused connecting to https://127.0.0.1/users/, giving up Check your knife configuration and network settings 

The ngnix service is running continuously, cannot start it. After going through the magazines:

  tail -f /var/log/opscode/nginx/current 2015-07-01_10:59:00.69218 nginx: [emerg] invalid number of arguments in "server_name" directive in /var/opt/opscode/nginx/etc/chef_https_lb.conf:3 

The chef_https_lb.conf file is as follows:

 server { listen 443; server_name ; access_log /var/log/opscode/nginx/access.log opscode; 

I'm not sure what is going wrong. Has anyone shed light please?

+7
chef
source share
3 answers

If someone stumbles upon this search for an answer (like me). The problem is that you need to set the fully qualified domain name of the server other than localhost.

Example for Centos 6.6

In the / etc / hosts file, the top line that reads (or looks like)

 127.0.0.1 localhost 

Change localhost to the host name that you set for your server ( /etc/sysconfig/network )

 127.0.0.1 servername.com 

Restart network service

 $: service network restart 

When executing the following commands on the server terminal

 $: hostname $: hostname -f 

They should both bring out "servername.com"

Run chef-server-ctl reconfigure to rebuild the ssl certificate for the chef server.

You should be able to add your admin / ORG and web management interface using opscode

+6
source share

In my case, nginx could not bind to port 80 because apache2 already used it. So my chef-server-ctl tail nginx looks like this

 # chef-server-ctl tail nginx ==> /var/log/opscode/nginx/internal-chef.access.log <== ==> /var/log/opscode/nginx/error.log <== 2016/07/20 12:22:29 [emerg] 28912#0: listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use) 2016/07/20 12:22:29 [emerg] 28912#0: listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use) 2016/07/20 12:22:29 [emerg] 28912#0: listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use) 2016/07/20 12:22:29 [emerg] 28912#0: listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use) 2016/07/20 12:22:29 [emerg] 28912#0: still could not bind() 

So, I looked at the nginx.conf file and commented out the server that is listening on port 80 - as it redirects to 443 anyway. Then I restart nginx and chef-server-ctl user-create ... works :) for example.

 # vi /var/opt/opscode/nginx/etc/nginx.conf ... # We support three options: serve nothing on non_ssl_port (80), # redirect to https, or actually serve the API. # server { # listen 80; # access_log /var/log/opscode/nginx/rewrite-port-80.log; # return 301 https://$host$request_uri; # } # chef-server-ctl restart nginx ok: run: nginx: (pid 32236) 0s # chef-server-ctl user-create username fname sname username@example.com password --filename username.pem 
+4
source share

You need to disable SELinux so that Chef can bind his services with various sockets / ports. You may need to disable qpid too.

Cm:

http://docs.chef.io/server/install_server_pre.html

especially: http://docs.chef.io/server/install_server_pre.html#selinux

0
source share

All Articles