How to install SpaceWalk on CentOS 6 (working)

Because I could not found any guide that let me properly install SpaceWalk on CentOS 6, I decided to write this article. Kuddos go to The Noc Cave with this article, for helping me most to go in the good direction.

Please leave a comment if you encounter any problems. Thank you!

For the installation of SpaceWalk on CentOS 6, I used a bare installation of CentOS.

First install the SpaceWalk repository:

rpm -Uvh http://spacewalk.redhat.com/yum/latest/RHEL/6/x86_64/spacewalk-repo-1.9-1.el6.noarch.rpm

Enable the priority plugin for yum:

yum install yum-plugin-priorities

Edit /etc/yum.repos.d/spacewalk.repo and add the following lines:

[spacewalk-latest]
name=Spacewalk-latest
baseurl=http://spacewalk.redhat.com/yum/latest/RHEL/6/x86_64/
gpgkey=http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2012
enabled=1
gpgcheck=1
priority=1

Install the following required additional repositories:

rpm -Uvh http://mirrors.dotsrc.org/jpackage/5.0/generic/free/RPMS/jpackage-release-5-4.jpp5.noarch.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://spacewalk.redhat.com/yum/1.7-client/RHEL/6/x86_64/spacewalk-client-repo-1.7-5.el6.noarch.rpm

Change the following line in /etc/yum.repos.d/jpackage.repo (at the bottom):

mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=redhat-el-$releasever&type=free&release=5.0

to

mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=redhat-el-5.0&type=free&release=5.0

Now, yum clean all

Install postgresql:

yum install postgresql postgresql-contrib postgresql-devel postgresql-server

Enable postgresql and initialize it:

chkconfig postgresql on
service postgresql initdb
service postgresql start

Create the SpaceWalk database and user:

su – postgres -c ‘PGPASSWORD=spacepw; createdb spacedb ; createlang plpgsql spacedb ; yes $PGPASSWORD | createuser -P -sDR spaceuser’

Edit /var/lib/pgsql/data/pg_hba.conf and add the following lines so it look likes this:

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# local spacewalk info
local      spacedb      spaceuser           md5
host       spacedb      spaceuser      127.0.0.1/8      md5
host       spacedb      spaceuser      ::1/128      md5
local      spacedb      postgres           ident

Reload postgresql:

service postgresql reload

Now, install SpaceWalk and get a coffee:

yum install spacewalk-postgresql

Finally we can initialize SpaceWalk now:

spacewalk-setup –disconnected –external-db

choose for local db (just enter)
database is: spacedbusername is: spaceuser
password is: spacepw

Next you will be asked for some certificate information. Supply with the (default) information needed and reboot your box.

After reboot you will have to adjust your firewall to allow access to ports 443 and 5222.

Your SpaceWalk server should now be available on: https://[box-ip-address]

At first access you’ll be asked to create a new user.

 

About Esmé