# Deploying server under CentOS

**URL:** <https://discourse.chef.io/t/deploying-server-under-centos/1503>\
**Category:** Chef Infra (archive)\
**Created:** [July 8, 2010, 9:24pm UTC](https://discourse.chef.io/t/deploying-server-under-centos/1503 "2010-07-08T21:24:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Albert\_Llop](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/albert_llop/32/885_2.png) [@Albert\_Llop](https://discourse.chef.io/u/Albert_Llop)\
**Post date:** [July 8, 2010, 9:24pm UTC](https://discourse.chef.io/t/deploying-server-under-centos/1503/1 "2010-07-08T21:24:21Z")

</div>

Hi there!  
I’ve been battling today trying to update my chef server to the latest  
version (0.9.6) but have been a complete disaster. We run everything under  
centos 5.3 so far, and I haven’t found much support in that area, since most  
of the documentation / bootstrapping cookbooks mention mostly only ubuntu  
support. What would you suggest to be the best course of action? I have a  
very small environment of only 5 clients, preparing for a bigger future, so  
scrapping everything can be considered. Would it be worth it to create a new  
chef server on an ubuntu based system, keep battling, or just wait for the  
rpm’s to be updated?

## Is there anyone else hosting the server in a centos that can share his experience?

{ :name =\> “Albert Llop” }

---

<div class="post-metadata">

**Author:** ![Alex\_Soto](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/alex_soto/32/673_2.png) [@Alex\_Soto](https://discourse.chef.io/u/Alex_Soto)\
**Post date:** [July 8, 2010, 9:36pm UTC](https://discourse.chef.io/t/deploying-server-under-centos/1503/2 "2010-07-08T21:36:56Z")

</div>

I'm on centos for one client, running chef .7X

It should work, but as you say, it's best to go ubuntu if you can. I'm in the process of moving all my systems to ubuntu not just because of chef, but it's part of the reason.

Alex

On Jul 8, 2010, at 2:24 PM, Albert Llop wrote:

> Hi there!  
> I've been battling today trying to update my chef server to the latest version (0.9.6) but have been a complete disaster. We run everything under centos 5.3 so far, and I haven't found much support in that area, since most of the documentation / bootstrapping cookbooks mention mostly only ubuntu support. What would you suggest to be the best course of action? I have a very small environment of only 5 clients, preparing for a bigger future, so scrapping everything can be considered. Would it be worth it to create a new chef server on an ubuntu based system, keep battling, or just wait for the rpm's to be updated?
> 
> ## Is there anyone else hosting the server in a centos that can share his experience?
> 
> { :name =\> "Albert Llop" }

---

<div class="post-metadata">

**Author:** ![Paul\_Choi](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@Paul\_Choi](https://discourse.chef.io/u/Paul_Choi)\
**Post date:** [July 8, 2010, 10:03pm UTC](https://discourse.chef.io/t/deploying-server-under-centos/1503/3 "2010-07-08T22:03:32Z")

</div>

It was a bit painful but I built my own set of RPMs for CentOS 4 (we run  
a mixed environment of CentOS 4 and CentOS 5), for Chef 0.8.16.  
I don't have the bandwidth to test 0.9 at this point.

gem2rpm is your friend (assuming you have rpmbuild environment set up):  
gem install gem2rpm

gem fetch shadow  
gem2rpm shadow-1.1.gem \> SPECS/rubygem-shadow.spec  
rpmbuild -ba SPECS/rubygem-shadow.spec

You can build all of Chef's ruby gem dependencies that way.  
Then you can fetch ELFF's latest rubygem-chef SRPM from  
[http://download.elff.bravenet.com/5/SRPMS/](http://download.elff.bravenet.com/5/SRPMS/). You'd need to edit the spec  
file a bit to make it work, but it can be done.

If and when I have time to test 0.9 and deploy across my org, I'll  
contribute.

-Paul

On 7/8/10 2:24 PM, Albert Llop wrote:

> Hi there!  
> I've been battling today trying to update my chef server to the latest  
> version (0.9.6) but have been a complete disaster. We run everything  
> under centos 5.3 so far, and I haven't found much support in that  
> area, since most of the documentation / bootstrapping cookbooks  
> mention mostly only ubuntu support. What would you suggest to be the  
> best course of action? I have a very small environment of only 5  
> clients, preparing for a bigger future, so scrapping everything can be  
> considered. Would it be worth it to create a new chef server on an  
> ubuntu based system, keep battling, or just wait for the rpm's to be  
> updated?
> 
> ## Is there anyone else hosting the server in a centos that can share his experience?
> 
> { :name =\> "Albert Llop" }

---

<div class="post-metadata">

**Author:** ![Albert\_Llop](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/albert_llop/32/885_2.png) [@Albert\_Llop](https://discourse.chef.io/u/Albert_Llop)\
**Post date:** [July 9, 2010, 7:01am UTC](https://discourse.chef.io/t/deploying-server-under-centos/1503/4 "2010-07-09T07:01:44Z")

</div>

I amanged to have chef server working on CentOS up to 8.16 aswell, but 9.6  
has just been completely impossible. I've managed to update it all, launch  
all the services, but there's no way in hell I can get to log in to the  
webui admin.

## Will try to get an ubuntu virtual machine working to save me some hassle in the future, and if I can't (or the boss doesn't approve, which could be :P) will try Paul's tips! Thanks a lot!!

{ :name =\> "Albert Llop" }

On 9 July 2010 00:03, Paul Choi [paulchoi@plaxo.com](mailto:paulchoi@plaxo.com) wrote:

> It was a bit painful but I built my own set of RPMs for CentOS 4 (we run a  
> mixed environment of CentOS 4 and CentOS 5), for Chef 0.8.16.  
> I don't have the bandwidth to test 0.9 at this point.
> 
> gem2rpm is your friend (assuming you have rpmbuild environment set up):  
> gem install gem2rpm
> 
> gem fetch shadow  
> gem2rpm shadow-1.1.gem \> SPECS/rubygem-shadow.spec  
> rpmbuild -ba SPECS/rubygem-shadow.spec
> 
> You can build all of Chef's ruby gem dependencies that way.  
> Then you can fetch ELFF's latest rubygem-chef SRPM from  
> [http://download.elff.bravenet.com/5/SRPMS/](http://download.elff.bravenet.com/5/SRPMS/). You'd need to edit the spec  
> file a bit to make it work, but it can be done.
> 
> If and when I have time to test 0.9 and deploy across my org, I'll  
> contribute.
> 
> -Paul
> 
> On 7/8/10 2:24 PM, Albert Llop wrote:
> 
> > Hi there!  
> > I've been battling today trying to update my chef server to the latest  
> > version (0.9.6) but have been a complete disaster. We run everything under  
> > centos 5.3 so far, and I haven't found much support in that area, since most  
> > of the documentation / bootstrapping cookbooks mention mostly only ubuntu  
> > support. What would you suggest to be the best course of action? I have a  
> > very small environment of only 5 clients, preparing for a bigger future, so  
> > scrapping everything can be considered. Would it be worth it to create a new  
> > chef server on an ubuntu based system, keep battling, or just wait for the  
> > rpm's to be updated?
> > 
> > ## Is there anyone else hosting the server in a centos that can share his experience?
> > 
> > { :name =\> "Albert Llop" }

---

<div class="post-metadata">

**Author:** ![Joshua\_Timberman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joshua_timberman/32/424_2.png) [@Joshua\_Timberman](https://discourse.chef.io/u/Joshua_Timberman)\
**Post date:** [July 9, 2010, 2:53pm UTC](https://discourse.chef.io/t/deploying-server-under-centos/1503/5 "2010-07-09T14:53:32Z")

</div>

Hello!

On Jul 9, 2010, at 1:01 AM, Albert Llop wrote:

> I amanged to have chef server working on CentOS up to 8.16 aswell, but 9.6 has just been completely impossible. I've managed to update it all, launch all the services, but there's no way in hell I can get to log in to the webui admin.
> 
> Will try to get an ubuntu virtual machine working to save me some hassle in the future, and if I can't (or the boss doesn't approve, which could be :P) will try Paul's tips! Thanks a lot!!

The RPMs currently install the Chef software as RubyGems, so you should be able to update the gems. The fun part is, the chef-server gems depend on merb 1.1, which depends on bundler, which depends on RubyGems 1.3.6+. So first, update RubyGems:

sudo gem update --system

(unlike debian/ubuntu, you can actually do this on CentOS :)).

Then update the gems by installing them by name:

sudo gem install chef chef-server-api chef-solr

Finally, restart the services.

for i in server solr solr-indexer  
do  
sudo service chef-$i restart  
done

I just performed this update on a centos 5 test system and it worked, in that the client was able to run, and save, to the chef server. I didn't test any cookbooks, though.

--  
Opscode, Inc  
Joshua Timberman, Senior Solutions Engineer  
C: 720.334.RUBY E: [joshua@opscode.com](mailto:joshua@opscode.com)

---

<div class="post-metadata">

**Author:** ![Albert\_Llop](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/albert_llop/32/885_2.png) [@Albert\_Llop](https://discourse.chef.io/u/Albert_Llop)\
**Post date:** [July 9, 2010, 4:21pm UTC](https://discourse.chef.io/t/deploying-server-under-centos/1503/6 "2010-07-09T16:21:06Z")

</div>

I finally got it all working today (kind of). Will try to write the problems I've had (next week though) and see if I was doing something wrong and if I contribute with something.

Thanks for the help!

--  
{ :sent\_from =\> "iPhone" }

On 09/07/2010, at 16:53, Joshua Timberman [joshua@opscode.com](mailto:joshua@opscode.com) wrote:

> Hello!
> 
> On Jul 9, 2010, at 1:01 AM, Albert Llop wrote:
> 
> > I amanged to have chef server working on CentOS up to 8.16 aswell, but 9.6 has just been completely impossible. I've managed to update it all, launch all the services, but there's no way in hell I can get to log in to the webui admin.
> > 
> > Will try to get an ubuntu virtual machine working to save me some hassle in the future, and if I can't (or the boss doesn't approve, which could be :P) will try Paul's tips! Thanks a lot!!
> 
> The RPMs currently install the Chef software as RubyGems, so you should be able to update the gems. The fun part is, the chef-server gems depend on merb 1.1, which depends on bundler, which depends on RubyGems 1.3.6+. So first, update RubyGems:
> 
> sudo gem update --system
> 
> (unlike debian/ubuntu, you can actually do this on CentOS :)).
> 
> Then update the gems by installing them by name:
> 
> sudo gem install chef chef-server-api chef-solr
> 
> Finally, restart the services.
> 
> for i in server solr solr-indexer  
> do  
> sudo service chef-$i restart  
> done
> 
> I just performed this update on a centos 5 test system and it worked, in that the client was able to run, and save, to the chef server. I didn't test any cookbooks, though.
> 
> --  
> Opscode, Inc  
> Joshua Timberman, Senior Solutions Engineer  
> C: 720.334.RUBY E: [joshua@opscode.com](mailto:joshua@opscode.com)

---

<div class="post-metadata">

**Author:** ![Albert\_Llop](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/albert_llop/32/885_2.png) [@Albert\_Llop](https://discourse.chef.io/u/Albert_Llop)\
**Post date:** [July 12, 2010, 10:05am UTC](https://discourse.chef.io/t/deploying-server-under-centos/1503/7 "2010-07-12T10:05:24Z")

</div>

Hi all!  
This is a resumed list of the problems I recall having. I wish it was more  
detailed.

- The nastiest one was discovering the problem with the json gem. I did  
uninstall json and reinstalled version 1.4.2, but still I only managed to  
have it all working when I uninstalled json\_pure the same way. If you catch  
the exception on the put\_rest method of lib/chef/rest.rb you'd get a weird  
JSON::SAFE\_STATE\_PROTOTYPE error. Since the exception wasn't caught, it  
failed silently (in my case, when creating a new view in couchdb =\>  
chef/lib/couchdb.rb line 95).
- Another thing I found very very confusing was, the init.d scripts  
provided with the gem don't have a reasonable $CONFIG default. For the  
chef-solr-indexer it's "/etc/chef/solr-indexer.rb" and for the  
chef-server-webui it's "/etc/chef/webui.rb". The bootstrapping cookbook only  
creates solr.rb and server.rb config files. I think it'd make more sense if  
the scripts pointed to solr.rb and server.rb. It's not so hard to debug this  
one, but it was very unexpected.
- Another weird default for the init.d scritps is the pidfile, in the  
bootstrapping process you end up with config files pointing to  
/srv/chef/run/, whereas the init.d scripts provided use /var/run/chef/. Not  
weird, but also not quite expected.
- On attribute definition, for example on the server\_proxy recipe if you  
have:  
set\_unless[:chef][:doc\_root] =  
"#{languages[:ruby][:gems\_dir]}/gems/chef-server-webui-#{chef[:server\_version]}/public"  
It seems to generate the [:chef][:doc\_root] attribute and save it. So  
when you update chef-server you have go to the webui and remove this  
attribute, or it will still point to older versions.

The first one was the worst, because I just couldn't figure it out until I  
dived into the code. The other ones were just a matter of time, but could  
help in the future if they're ironed out.  
I'm not (yet) so lucky as to be working with chef full time, so apologies in  
advance for not being able to contribute in a better way (opening tickets or  
providing packages). Chef is awesome, I love it!

## Thanks for the excellent work!

{ :name =\> "Albert Llop" }

On 9 July 2010 18:21, Albert Llop [mrsimo@gmail.com](mailto:mrsimo@gmail.com) wrote:

> I finally got it all working today (kind of). Will try to write the  
> problems I've had (next week though) and see if I was doing something wrong  
> and if I contribute with something.
> 
> Thanks for the help!
> 
> --  
> { :sent\_from =\> "iPhone" }
> 
> On 09/07/2010, at 16:53, Joshua Timberman [joshua@opscode.com](mailto:joshua@opscode.com) wrote:
> 
> > Hello!
> > 
> > On Jul 9, 2010, at 1:01 AM, Albert Llop wrote:
> > 
> > > I amanged to have chef server working on CentOS up to 8.16 aswell, but  
> > > 9.6 has just been completely impossible. I've managed to update it all,  
> > > launch all the services, but there's no way in hell I can get to log in to  
> > > the webui admin.
> > > 
> > > Will try to get an ubuntu virtual machine working to save me some hassle  
> > > in the future, and if I can't (or the boss doesn't approve, which could be  
> > > :P) will try Paul's tips! Thanks a lot!!
> > 
> > The RPMs currently install the Chef software as RubyGems, so you should  
> > be able to update the gems. The fun part is, the chef-server gems depend on  
> > merb 1.1, which depends on bundler, which depends on RubyGems 1.3.6+. So  
> > first, update RubyGems:
> > 
> > sudo gem update --system
> > 
> > (unlike debian/ubuntu, you can actually do this on CentOS :)).
> > 
> > Then update the gems by installing them by name:
> > 
> > sudo gem install chef chef-server-api chef-solr
> > 
> > Finally, restart the services.
> > 
> > for i in server solr solr-indexer  
> > do  
> > sudo service chef-$i restart  
> > done
> > 
> > I just performed this update on a centos 5 test system and it worked, in  
> > that the client was able to run, and save, to the chef server. I didn't test  
> > any cookbooks, though.
> > 
> > --  
> > Opscode, Inc  
> > Joshua Timberman, Senior Solutions Engineer  
> > C: 720.334.RUBY E: [joshua@opscode.com](mailto:joshua@opscode.com)

---

<div class="post-metadata">

**Author:** ![Ian\_Alderman](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@Ian\_Alderman](https://discourse.chef.io/u/Ian_Alderman)\
**Post date:** [July 13, 2010, 7:17pm UTC](https://discourse.chef.io/t/deploying-server-under-centos/1503/8 "2010-07-13T19:17:02Z")

</div>

> - Another thing I found very very confusing was, the init.d scripts  
> provided with the gem don't have a reasonable $CONFIG default. For the  
> chef-solr-indexer it's "/etc/chef/solr-indexer.rb" and for the  
> chef-server-webui it's "/etc/chef/webui.rb". The bootstrapping cookbook only  
> creates solr.rb and server.rb config files. I think it'd make more sense if  
> the scripts pointed to solr.rb and server.rb. It's not so hard to debug this  
> one, but it was very unexpected.
> 
> I second the comment about the $CONFIG defaults. I was bootstrapping on  
> RedHat and ran into several problems but this one just seems like a bug in  
> the bootstrap recipe. I just copied the /etc/chef/solr.rb config file to  
> /etc/chef/solr-indexer.rb - is that a reasonable workaround?

Other problems:

1. Unspecified dependency on runit (unless configured to use init).
2. Gem installation can put executables in different place from where the  
init scripts expect them.
3. service chef-solr stop doesn't.

If I have time I'll make patches &c.

Thanks,

-Ian
