Installing Kegbot Server on CentOS 6.6

I just got KegBot Server installed on CentOS 6.6 and wanted to document the hurdles I encountered while it’s still fresh. It was a pain and if you have your choice of OSs, I encourage you to pick something else. These are the modifications to the server docs that I had to do:

Starting with The Install Guide

For the dependencies here is the yum equivelent of the apt-get command:
$ sudo yum install \ libjpeg-turbo-devel \ mysql-devel \ redis\ mysql \ mysql-server \ supervisor \ nginx

You’ll note python isn’t in there: that’s because Kegbot Server needs Python 2.7 and there isn’t a binary available, only 2.6. So to install Python 2.7 you need to follow Digital Ocean’s Guide to Installing Python 2.7 on CentOS. You’re going to be compiling it from source and then installing it as /usr/local/bin/python2.7

Now for “Set up an environment”: You’ll want to run sudo pip2.7 install virtualenv to ensure that you get python2.7 in your virtual environment. You’ll also want to start some of the services you installed before trying to get mysql and redis running:

$ sudo service mysqld start ... $ sudo service redis start ...

And you probably want those services to start at boot time:
$ sudo chkconfig mysqld on ... $ sudo chkconfig redis on ...

That should get you to the point where you can get everything installed. Now onto Run Kegbot Server

So now you go to http://yourserver:8000/ and get nothing. Because iptables. So let’s open up port 8000 (temporarily):
sudo iptables -A INPUT -p tcp --dport 8000 -j ACCEPT
As long as you don’t save iptables, you should be able to get rid of that rule with sudo service iptables restart, or you can delete the rule (an exercise left up to the reader).

OK, now, since you’re running kegbot runserver 0.0.0.0:8000 you should be able to go to http://yourserver:8000/ and start messing around.

At this point you’re ready to start messing with Nginx and thinking it’s going to be a breeze, because you forgot about SELinux. So here’s what you need to do to allow Nginx to proxy to Kegbot Server:
$ sudo setsebool -P httpd_can_network_connect 1

And, if you’re like me and you put kegbot in a homedir, you’ll want to run
$ sudo setsebool -P httpd_enable_homedirs 1

That’s everything I can remember. If you run into any problems please let me know so I can update this guide.

Thanks for sharing - and sorry it was such a pain.

I don’t think there’s anything that could have been done differently on the Kegbot side, unless Python 2.6 is an option.

The problems were matching the right yum packages, compiling Python 2.7 and SELinux constraints blocking network port access. Not impossible but the pain I get for choosing CentOS.

Maybe this is something I should learn Docker for…