Installing Spacewalk on CentOS-5

Posted: July 3, 2010 in Redhat

I was trying to install Spacewalk for last few days and seems to be very difficult at the begining but at the end it was finaly installed . Here is the jest of my Successfull installation . This is my version from CentOS wiki to install Spacewalk.

Spacewalk is the upstream community project from which the Red Hat Network Satellite product is derived. It provides a management interface for software content across registered servers and desktops.

1. Server Requirement.

  • CentOS 5 (i386 or x86_64)
  • 1024 MB of swap space
  • 20 GB of free space, 80 GB recommended
  • A fully qualified domain name (FQDN) – In this example, we use the IANA reserved example.com domain: spacewalk.xxx.com.au
  • Also Try to add the Module under HTTP–> mod_nss while installing Centos . I have the problem because of that while finishing my installation and it fails while activating my RHN server . It will save lot of your time for troubleshooting.Check Below

My Server Setup:

I have used CentOS 5.4 32BIT on Vmware with 2 GB of RAM , 2 VCPU

2. Selinux

  • I personally Disable SElinux on my server . This is my choice but not recommanded.

3. Firewall

The following inbound TCP ports should be open on the Spacewalk server:

  • 69: TFTP (PXE provisioning)
  • 80: Spacewalk web interface
  • 443: Spacewalk web interface (SSL)
  • 4545: Spacewalk monitoring
  • 5222: If you plan to push actions to client systems
  • 5269: If you push actions to a Spacewalk Proxy Server
  • 9055: Oracle XE web access

4. Oracle Database

In this guide Spacewalk will be installed with an Oracle 10g database server; supporting PostgreSQL as backend is a work in progress and we will update here whenever will be a viable option. Oracle Express Edition server works fine even if it has some limitations:

  • 1 GB memory (max) – even if more is available
  • 4 GB disk space (max)
  • 1 database (max)
  • 1 cpu (max) – processing resources equivalent to one CPU will be consumed at peak even if more than one CPU is available

The following packages are required by the Oracle database. This will install bc, plus glibc and libaio in 32bit variant which is required even on the x86_64 architecture:

yum install bc glibc.i686 libaio.i386

Download Oracle XE from the Oracle website. You will need to register in order to download the RPMS. Choose the Oracle Database 10g Express Edition (Universal):

  • oracle-xe-univ-10.2.0.1-1.0.i386.rpm

You will also need a client to access the database. Download the Oracle Instant Client: i386 client or x86_64 according to the architecture of your server. Download the following two (2) RPM packages:

  • oracle-instantclient-basic-10.2.0.4-1.*.rpm
  • oracle-instantclient-sqlplus-10.2.0.4-1.*.rpm
 ATTENTION: Spacewalk version 1.0 is  known to work correctly with version 10.2.0.4 of the Oracle Instant  Client.
 This is the place where I made the Mistake downloading the latest Version of Oracel Instant Client which was 11.4.
 Please try to download version 10.2

Install the downloaded RPM on the Spacewalk server:

rpm -Uvh oracle-xe-univ-10.2.0.1-1.0.i386.rpm
rpm -Uvh oracle-instantclient-basic-10.2.0.4-1.*.rpm
rpm -Uvh oracle-instantclient-sqlplus-10.2.0.4-1.*.rpm

Before configuring the Oracle database, we need to pull some packages from the Spacewalk Yum repository.

Edit /etc/yum.repos.d/spacewalk.repo:

=========================================================

[spacewalk]
name=Spacewalk for Enterprise Linux – $basearch
baseurl=http://spacewalk.redhat.com/yum/1.0/RHEL/5/$basearch/
gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk
enabled=1
gpgcheck=1

=========================================================

Or

you can create that automatically via RPM .

rpm -Uvh http://spacewalk.redhat.com/yum/1.0/RHEL/5/i386/spacewalk-repo-1.0-2.el5.noarch.rpm

Install the following packages from the Spacewalk repository:

yum install oracle-lib-compat

Configure the Oracle database:

/etc/init.d/oracle-xe configure

 *** The default values are fine except for the HTTP port. Use 9055 instead  of 8080.

5. Client Configuration

We need to configure the tns names entry for our database. Edit /etc/tnsnames.ora: (Some time the File dows not exists , Just create it Manually)

This is what My one Look Like.

=========================================================

# tnsnames.ora Network Configuration File:

XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
# (SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

=========================================================

Test the connection with the Oracle database server:

sqlplus system@xe

Enter the password for the system user when prompted. You should see the following message:

SQL*Plus: Release 10.2.0.1.0 – Production on Wed Dec 17 09:41:18 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 – Production
SQL>

Type “quit” to exit the client interface.

Creating the spacewalk database user:

Create the spacewalk database user with the sqlplus command-line interface:

sqlplus ‘sys@xe as sysdba’
SQL> create user spacewalk identified by spacewalk default tablespace users;
User created.
SQL> grant dba to spacewalk;
Grant succeeded.
SQL> PASSWORD spacewalk;
Changing password for spacewalk
New password:
Retype new password:
Password changed
SQL> quit

Restart the Oracle database:

/etc/init.d/oracle-xe restart

6. Yum

6.1. EPEL
Spacewalk requires packages available from the EPEL repository. Edit /etc/yum.repos.d/epel.repo:

=========================================================

[epel]
name=Extra Packages for Enterprise Linux 5 – $basearch
#baseurl=http://download.fedora.redhat.com/pub/epel/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
gpgkey=http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL
gpgcheck=1
enabled=1
includepkgs=bea-stax* cobbler editarea gc gc-devel git* jabberd jabberpy* jakarta-commons-cli jcommon \
jfreechart libapreq2 libgsasl* libntlm* libyaml perl-Algorithm-Diff perl-Apache-DBI \
perl-BerkeleyDB perl-Cache-Cache perl-Class-MethodMaker perl-Class-Singleton \
perl-Convert-BinHex perl-Config-IniFiles perl-Crypt-DES perl-Crypt-GeneratePassword \
perl-DateTime perl-DateTime-Format-Mail perl-DateTime-Format-W3CDTF perl-Error \
perl-FreezeThaw perl-Frontier-RPC perl-GD perl-Git perl-Math-FFT perl-HTML-TableExtract \
perl-IO-Capture perl-IO-stringy perl-IPC-ShareLite perl-libapreq2 perl-MIME-Lite \
perl-MIME-tools perl-Net-IPv4Addr perl-Net-SNMP perl-Params-Validate perl-Proc-Daemon \
perl-SOAP-Lite perl-TermReadKey perl-Text-Diff perl-Unix-Syslog perl-XML-RSS perl-version \
perlAlgorithm-Diff python-cheetah python-dmidecode python-hashlib python-netaddr PyYAML \
python-simplejson rhino tzdata-java udns*

=========================================================

6.2. Spacewalk

The packages rhn-client-tools and rhnlib are needed by Spacewalk, but they were removed from CentOS as part of CentOS changed to the updater [to avoid an old upstream updater behaviour of un-configured CentOS units, that placed load on the upstream vendor due to some hard coded repository names]. To address this, edit /etc/yum.repos.d/spacewalk-client.repo and add the following lines:

=========================================================

[spacewalk-client]
name=Spacewalk Client Tools for Enterprise Linux – $basearch
baseurl=http://spacewalk.redhat.com/yum/1.0-client/RHEL/5/$basearch/
gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk
enabled=1
gpgcheck=1

=========================================================

6.3. Partial yum repositories

If you want to use your Spacewalk server to manage partial yum repositories,
we recommend to create a file named /etc/reposync.conf. Below is an example file used to manage both EPEL
and RPMforge i386 repositories. We strongly recommend using the includepkgs directive to protect the base distro packages and limit the occupied disk space:

=========================================================

[epel32]
name=Extra Packages for Enterprise Linux 5 – i386
baseurl=http://download.fedora.redhat.com/pub/epel/5/i386
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386
failovermethod=priority
gpgkey=http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL
gpgcheck=1
enabled=1
includepkgs=bea-stax* cobbler editarea gc gc-devel git* jabberd jabberpy* jakarta-commons-cli jcommon \
jfreechart libapreq2 libgsasl* libntlm* libyaml perl-Algorithm-Diff perl-Apache-DBI \
perl-BerkeleyDB perl-Cache-Cache perl-Class-MethodMaker perl-Class-Singleton \
perl-Convert-BinHex perl-Config-IniFiles perl-Crypt-DES perl-Crypt-GeneratePassword \
perl-DateTime perl-DateTime-Format-Mail perl-DateTime-Format-W3CDTF perl-Error \
perl-FreezeThaw perl-Frontier-RPC perl-GD perl-Git perl-Math-FFT perl-HTML-TableExtract \
perl-IO-Capture perl-IO-stringy perl-IPC-ShareLite perl-libapreq2 perl-MIME-Lite \
perl-MIME-tools perl-Net-IPv4Addr perl-Net-SNMP perl-Params-Validate perl-Proc-Daemon \
perl-SOAP-Lite perl-TermReadKey perl-Text-Diff perl-Unix-Syslog perl-XML-RSS perl-version \
perlAlgorithm-Diff python-cheetah python-dmidecode python-hashlib python-netaddr PyYAML \
python-simplejson rhino tzdata-java udns*

[rpmforge32]
name = RPMforge for Enterprise Linux 5 – i386
baseurl = http://apt.sw.be/redhat/el5/en/i386/dag
gpgkey = http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
gpgcheck=1
includepkgs=amavisd-new arc cabextract clamav* clamd freeze lha lzop nomarch perl-Archive-Zip perl-Convert-TNEF \
perl-Convert-UUlib perl-MailTools perl-Net-Server ripole unarj zoo

=========================================================

6.4. GPG keys

By default, Spacewalk will refuse to distribute unsigned RPMS or RPMS signed with an unknown key.

We make sure we have all the relevant GPG keys installed:

=========================================================

wget http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL
mv RPM-GPG-KEY-EPEL /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
wget http://www.redhat.com/security/37017186.txt
mv 37017186.txt /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
wget http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk
mv RPM-GPG-KEY-spacewalk /etc/pki/rpm-gpg/RPM-GPG-KEY-spacewalk
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-spacewalk
wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
mv RPM-GPG-KEY.dag.txt /etc/pki/rpm-gpg/RPM-GPG-KEY-dag
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-dag

=========================================================

7. Spacewalk Server

7.1. Installation

Remove the specspo package if present since it conflicts with Spacewalk.

rpm -e specspo

We use yum to fetch the rather long list of dependencies for the Spacewalk software:

yum install spacewalk-oracle
yum update

7.2. Configuration

Configure the Spacewalk application:

=========================================================

#spacewalk-setup –disconnected

* Setting up Oracle environment.
* Setting up database.
** Database: Setting up database connection.
DB User? spacewalk
DB Password?
DB SID? xe
DB hostname? localhost
DB port [1521]?
DB protocol [TCP]?
** Database: Testing database connection.
** Database: Populating database.
*** Progress: ##########################################################
* Setting up users and groups.
** GPG: Initializing GPG and importing key.
You must enter an email address.
Admin Email Address? webmaster@example.com
* Performing initial configuration.
* Activating Spacewalk.
** Loading Spacewalk Certificate.
** Verifying certificate locally.
** Activating Spacewalk.
* Enabling Monitoring.
* Configuring apache SSL virtual host.
Should setup configure apache’s default ssl server for you (saves original ssl.conf) [Y]?
* Configuring jabberd.
* Creating SSL certificates.
CA certificate password?
Re-enter CA certificate password?
Organization? example.com
Organization Unit [spacewalk.example.com]?
Email Address [webmaster@example.com]?
City? Montreal
State? Quebec
Country code (Examples: “US”, “JP”, “IN”, or type “?” to see a list)? CA
** 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/n]?
* Restarting services.
Installation complete.

=========================================================

Use a web browser to view https://spacewalk.example.com/ to create the Spacewalk administrator account.

Point your web browser at https://spacewalk.example.com to create the satellite administrator account
[where example.com is the local DNS domain under your local control]

This is the End of My installation . Now you need to concentrate on Configuring and AAdministration of  Spacewalk

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s