Set up Spacewalk 2.3 on CentOS 6

Setting up Spacewalk software content management system on CentOS.

Check this article for Spacewalk 2.4.


  1. CentOS 6 (x86_64) minimal – make sure your underlying OS is fully up-to-date,
  2. 20GB of free disk space on / is recommended, or
  3. /var/satellite mounted on a dedicated logical volume, with at least 6GB of disk space per channel,
  4. if using PostgreSQL database backend, /var/lib/pgsql mounted on a dedicated logical volume, with 5GB of disk space,
  5. SELinux enforcing mode is recommended,
  6. Iptables turned on with inbound TCP ports 80 and 443 open on iptables for WebUI,
  7. A fully qualified domain name (FQDN), we use puppetm.vb.local in this article.

Setup Spacewalk Server

$ cat /etc/redhat-release
CentOS release 6.6 (Final)

Configure Repositories

Configure required repositories for Spacewalk. EPEL is needed for dependencies (jabberd, dojo etc). At the time of writing, the lastest Spacewalk version is 2.3.

# rpm -Uvh
# rpm -Uvh

Additional dependencies are needed from jpackage.

# cat << EOL >/etc/yum.repos.d/jpackage-generic.repo
name=JPackage generic

Yum repository list looks like this:

# yum clean all && yum repolist
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base:
 * epel:
 * extras:
 * jpackage-generic:
 * updates:
repo id                 repo name                                             status
base                    CentOS-6 - Base                                        6,518
epel                    Extra Packages for Enterprise Linux 6 - x86_64        11,750
extras                  CentOS-6 - Extras                                         38
jpackage-generic        JPackage generic                                       3,307
spacewalk               Spacewalk                                                115
updates                 CentOS-6 - Updates                                     1,370

Install and Setup Spacewalk

Let Spacewalk setup the PostgreSQL server on our machine without any manual intervention and install the set of RPMs required to get Spacewalk to run:

# yum install spacewalk-setup-postgresql spacewalk-postgresql
# spacewalk-setup --disconnected
* Setting up SELinux..
** Database: Setting up database connection for PostgreSQL backend.
** Database: Installing the database:
** Database: This is a long process that is logged in:
** Database:   /var/log/rhn/install_db.log
*** Progress: #
** Database: Installation complete.
** Database: Populating database.
*** Progress: #############################
* Configuring tomcat.
* Setting up users and groups.
** GPG: Initializing GPG and importing key.
** GPG: Creating /root/.gnupg directory
You must enter an email address.
Admin Email Address? [email protected]
* Performing initial configuration.
* Activating Spacewalk.
** Loading Spacewalk Certificate.
** Verifying certificate locally.
** Activating Spacewalk.
* Configuring apache SSL virtual host.
Should setup configure apache's default ssl server for you (saves original ssl.conf) [Y]?
Setup was unable to locate VirtualHost section in existing mod_ssl configuration.
* Configuring jabberd.
* Creating SSL certificates.
CA certificate password? **********
Re-enter CA certificate password? **********
Organization? CentOS6
Organization Unit [puppetm.vb.local]? Spacewalk
Email Address [[email protected]]?
City? Birmingham
State? West Midlands
Country code (Examples: "US", "JP", "IN", or type "?" to see a list)? GB
** SSL: Generating CA certificate.
** SSL: Deploying CA certificate.
** SSL: Generating server certificate.
** SSL: Storing SSL certificates.
* Deploying configuration files.
* Update configuration in database.
* Setting up Cobbler..
Cobbler requires tftp and xinetd services be turned on for PXE provisioning functionality. Enable these services [Y]?
* Restarting services.
Installation complete.
Visit https://puppetm.vb.local to create the Spacewalk administrator account.

If you need to remove the database (say you broke something):

# /usr/bin/spacewalk-setup-postgresql remove --db rhnschema --user rhnuser

Enable and start the service:

# /usr/sbin/spacewalk-service enable ;/
 /usr/sbin/spacewalk-service start
# /usr/sbin/spacewalk-service status
postmaster (pid  3101) is running...
router (pid 3126) is running...
sm (pid 3134) is running...
c2s (pid 3142) is running...
s2s (pid 3150) is running...
tomcat6 (pid 3212) is running...           [  OK  ]
httpd (pid  3355) is running...
osa-dispatcher (pid  3379) is running...
rhn-search is running (3399).
cobblerd (pid 3430) is running...
RHN Taskomatic is running (3454).

Create Channels and Repositories

Go to Channels –> Manage Software Channels –> Manage Repositories –> Create New repository

Go to Channels –> Manage Software Channels –> Create New Channel

Go to Channels –> Manage Software Channels –> Select the created channel –> Repository –> Select the previously created repository –> Update repository

Once updated, click on Sync and then click on Sync Now to start package synchronisation from the upstream server.

Once the package synchronisation is completed, you can check packages:

Go to Systems –> Activation Keys –> Create New Key

Setup Spacewalk Client

Install the Spacewalk yum repository and matching EPEL repository.

# rpm -Uvh
# rpm -Uvh

Install client packages:

# yum install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin

Install Spacewalk’s CA certificate on the server to enable SSL communication:

# wget -O /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT http://puppetm.vb.local/pub/RHN-ORG-TRUSTED-SSL-CERT

Register your system to Spacewalk using the activation key you created earlier:

# cat /usr/local/bin/

if [[ $# -gt 0 ]]; then

if [[ $reg_opts =~ --(activationkey|profilename) ]]; then
    echo "usage: $0 "
    echo " are passed as is to rhnreg_ks"
    echo "       do not use profile name or activationkey opts these are"
    echo "       hardcoded into the script"
    exit 1

read -p "Enter profile name: " profile
echo "Registering system as: ${profile}"
rhnreg_ks --force --activationkey="1-centos6-custom-spacewalk-key" \
  --serverUrl=https://puppetm.vb.local/XMLRPC \
  --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT \
  --profilename=${profile} ${reg_opts}
# yum repolist
Loaded plugins: fastestmirror, rhnplugin, security
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
repo id                     repo name                     status
centos-6.6-parent-x86_64    centos-6.6-parent-x86_64      6,518
repolist: 6,518


Related Posts

Setup Spacewalk 2.4 on CentOS 6

2 thoughts on “Set up Spacewalk 2.3 on CentOS 6

  1. spacewalk-repo-2.4-3.el6.noarch.rpm

    NOTE: Above doc need small correction while download spacewalk repo.

    • Hi Arsalan, not really, as the article was written for Spacewalk 2.3, not 2.4. However, since the latest release is now 2.4, the link in the article no longer works. So you can either use this one to download Spacewalk 2.3 repo, or check instructions for Spacewalk 2.4.

Leave a Reply

Your email address will not be published. Required fields are marked *