Freeside:1.7:Documentation:InstallingOnCentOS4.4

From Freeside

Jump to: navigation, search

Contents

Installing Freeside 1.7.x on CentOS 4.4

This is a (hopefully) step-by-step guide for doing a basic installation of Freeside on CentOS 4.4 (4.5?) using RPMs whenever possible. It would probably be easier to use CPAN directly in some cases, but that wouldn't be very fun now would it? These instructions also include information for installing on Red Hat Enterprise Linux 4.4/4.5 using up2date instead of yum.

Software Installation

Run the correct command below depending on your architecture. The BASEARCH environment variable must be set before running many of the commands contained in this document. If you close your terminal and resume the process at a later time, you must re-run the export command. If you find that rpm or wget is unable to download a particular file, run echo $BASEARCH and make sure it outputs either i386 or x86_64.

Please stop updating this wiki replacing the occurances of $BASEARCH with i386 or x86_64.

# export BASEARCH=i386

...or...

# export BASEARCH=x86_64

Binary Packages

*Package**Repo**Version*
httpdbase2.0.52-28.ent.centos4
postgresql-serverupdate7.4.16-1.RHEL4.1
tetexbase2.0.2-22.EL4.7
ghostscriptbase7.07-33
perlcentosplus4:5.8.8-4.el4s1
gccbase3.4.6-8
# yum install httpd postgresql-server tetex ghostscript.$BASEARCH

Upgrade to perl 5.8.8 to get CGI >= 3.08.

# yum --enablerepo=centosplus upgrade perl

Next install the gcc complier

# yum install gcc

Perl Packages

Setup 3rd party repos for most of the extra perl modules.

# wget -O /tmp/rpmforge-release-0.3.6-1.el4.rf.$BASEARCH.rpm http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.$BASEARCH.rpm
# rpm -ivh /tmp/rpmforge-release-0.3.6-1.el4.rf.$BASEARCH.rpm
# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

# cat <<END>/etc/yum.repos.d/dries.repo
[dries]
name=Extra Fedora rpms dries - \$releasever - \$basearch
baseurl=http://ftp.belnet.be/packages/dries.ulyssis.org/redhat/el\$releasever/en/\$basearch/dries/RPMS
END
# rpm --import http://dries.ulyssis.org/rpm/RPM-GPG-KEY.dries.txt

Install the cpan2rpm tool so we can build RPMs from CPAN packages.

# rpm --import http://perl.arix.com/cpan2rpm/gpg.pub.asc
# yum install rpm-build perl-Module-Build
# rpm -ivh http://superb-east.dl.sourceforge.net/sourceforge/cpan2rpm/cpan2rpm-2.027-1.noarch.rpm

mod_perl2

Grab mod_perl 2.03 from the centosplus repo.

# yum --enablerepo=centosplus install mod_perl


Freeside Prereqs

*Perl Module**Package**Version**Repo*
libnetlibnet1.1.2.1-2.rfextras
libwww-perlperl-libwww-perl.noarch5.79-5base
URIperl-URI.noarch1.30-4base
HTML::Tagsetperl-HTML-Tagset.noarch3.03-30base
HTML::Parserperl-HTML-Parser3.35-6base
DBIperl-DBI1.40-8base
DBD::MySQLperl-DBD-MySQL2.9004-3.1base
MailToolsperl-MailTools.noarch1.74-1.c4extras
TimeDateperl-TimeDate.noarch1.16-1.c4extras
Date::Manipperl-DateManip.noarch5.42a-3base
HTML::Masonperl-HTML-Mason1.3200-1.el4.rfrpmforge
Text::Templateperl-Text-Template1.44-1.2.el4.rfdries
DateTimeperl-DateTime0.2901-1.2.el4.rfrpmforge
Chartperl-Chart2.4.1-1.el4.rfdries
Cache::Cacheperl-Cache-Cache1.05-1.el4.rfdries
NetAddr::IPperl-NetAddr-IP4.004-1.el4.rfrpmforge
String::Approxperl-String-Approx3.26-1.el4.rfdries
Locale::SubCountryperl-Locale-SubCountry1.38-1.el4.rfdries
Term::ReadKeyperl-Term-ReadKey2.30-2.2.el4.rfdries
DateTime::Format::Strptimeperl-DateTime-Format-Strptime1.0700-1.2.el4.rfdries
Net::Whois::Rawperl-Net-Whois-Raw1.20-1.el4.rfdries
DBIx::DBSchemaperl-DBIx-DBSchema0.31-1.el4.rfdries
Tie::IxHashperl-Tie-IxHash1.21-1.2.el4.rfdries
Crypt::PasswdMD5perl-Crypt-PasswdMD51.3-1.2.el4.rfdries
File::CounterFileperl-File-CounterFile1.04-1.2.el4.rfdries
IPC::Run3perl-IPC-Run30.036-1.el4.rfdries
Net::SSHperl-Net-SSH0.08-1.2.el4.rfdries
String::ShellQuoteperl-String-ShellQuote1.03-2.2.el4.rfdries
JSONperl-JSON1.07-1.el4.rfdries
Data::Tableperl-Data-Table1.50-1.el4.rfdries
Lingua::EN::NameParseperl-Lingua-EN-NameParse1.22-2.2.el4.rfdries
Lingua::EN::Inflectperl-Lingua-EN-Inflect1.89-1.2.el4.rfdries
Apache::DBIperl-Apache-DBI0.9901-2.2.el4.rfdries
IO::Scalarperl-IO-stringy2.110-1.2.el4.rfdries
Text::CSV_XSperl-Text-CSV_XS0.23-1.2.el4.rfdries
Spreadsheet::WriteExcelperl-Spreadsheet-WriteExcel2.17-1.el4.rfdries
MIME-toolsperl-MIME-tools5.420-1.el4.rfdries
Date::Manipperl-DateManip5.42a-3base
Crypt::DESperl-Crypt-DES2.05-3.2.el4.rfdries
Crypt::Blowfishperl-Crypt-Blowfish2.10-1.2.el4.rfdries
Digest::MD4perl-Digest-MD41.5-1.2.el4.rfdries
Crypt::Rijndaelperl-Crypt-Rijndael0.05-1.2.el4.rfdries
ExtUtils::CBuilderperl-ExtUtils-CBuilder0.18-1.el4.rfdries
DBD::Pgperl-DBD-Pg1.49-1.el4s1centosplus
Locale-Codes cpan2rpm
Frontier::RPC2 cpan2rpm
Business::CreditCard cpan2rpm
Time::Duration cpan2rpm
HTML::Widgets::SelectLayers cpan2rpm
Color::Scheme cpan2rpm
Params::Classifycpan2rpm
Scalar::Numbercpan2rpm
Data::Integercpan2rpm
Data::Floatcpan2rpm
Module::Runtimecpan2rpm
Authen::DecHpwdcpan2rpm
Authen::Passphrasecpan2rpm
Data::Entropy::Algorithmscpan2rpm
Crypt::MySQLcpan2rpm
Crypt::Eksblowfishcpan2rpm
Crypt::UnixCrypt_XScpan2rpm
Fax::Hylafax::Clientcpan2rpm
# yum -y install libnet perl-libwww-perl perl-URI perl-HTML-Tagset
# yum -y install perl-HTML-Parser 
# yum -y install perl-MailTools perl-TimeDate
# yum -y install perl-HTML-Mason perl-Text-Template perl-DateTime perl-Chart
# yum -y install perl-Cache-Cache perl-NetAddr-IP perl-String-Approx
# yum -y install perl-Locale-SubCountry perl-Term-ReadKey
# yum -y install perl-DateTime-Format-Strptime perl-Net-Whois-Raw
# yum -y install perl-Tie-IxHash perl-Crypt-PasswdMD5
# yum -y install perl-File-CounterFile perl-IPC-Run3 perl-Net-SSH
# yum -y install perl-String-ShellQuote perl-JSON perl-Data-Table
# yum -y install perl-Lingua-EN-NameParse perl-Lingua-EN-Inflect
# yum -y install perl-IO-stringy perl-Text-CSV_XS perl-Spreadsheet-WriteExcel
# yum -y install perl-MIME-tools perl-DateManip
# yum -y install perl-DBI perl-DBD-MySQL perl-Apache-DBI 
# yum -y install --enablerepo=centosplus perl-DBD-Pg
# yum -y install perl-Crypt-DES perl-Crypt-Blowfish perl-Digest-MD4
# yum -y install perl-Crypt-Rijndael perl-ExtUtils-CBuilder

You can install these using cpan, or follow the directions here using cpan2rpm.

  • DBIx::DBSchema
# yum -y install perl-DBIx-DBSchema
  • Frontier::RPC2
# yum -y install perl-XML-Parser
# cpan2rpm --author='Ken MacLeod <ken@bitsko.slc.ut.us>' --version='0.07b4' Frontier-RPC
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Frontier-RPC-0.07b4-1.noarch.rpm


  • Business::CreditCard
# cpan2rpm Business::CreditCard
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Business-CreditCard-0.30-1.noarch.rpm


  • Time::Duration
# yum -y install perl-Test-Pod perl-Test-Pod-Coverage
# cpan2rpm Time::Duration
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Time-Duration-1.04-1.noarch.rpm


  • HTML::Widgets::SelectLayers
# cpan2rpm http://search.cpan.org/CPAN/authors/id/I/IV/IVAN/HTML-Widgets-SelectLayers-0.07.tar.gz
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-HTML-Widgets-SelectLayers-0.07-1.noarch.rpm


  • Color::Scheme

Ran into much brokenness when trying to build Test-Simple-0.67. Just skip the dep checks and test phase and hope. I mean, come on, it's Color::Scheme for crying out loud!

# yum -y install perl-Test-Differences
# cpan2rpm --make-no-test --no-depchk Color::Scheme
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Color-Scheme-1.02-1.noarch.rpm
  • Params::Classify

Install some deps first...

    • Scalar::Number
      • Data::Integer
# cpan2rpm Data::Integer
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Data-Integer-0.001-1.noarch.rpm
      • Data::Float
# cpan2rpm Data::Float
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Data-Float-0.005-1.noarch.rpm
# cpan2rpm Scalar::Number
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Scalar-Number-0.001-1.noarch.rpm

# cpan2rpm Params::Classify
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Params-Classify-0.002-1.noarch.rpm
  • Module::Runtime
# cpan2rpm Module::Runtime
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Module-Runtime-0.003-1.noarch.rpm
  • Authen::DecHpwd
# cpan2rpm Authen::DecHpwd
# rpm -ivh /usr/src/redhat/RPMS/${BASEARCH}/perl-Authen-DecHpwd-2.001-1.${BASEARCH}.rpm
  • Data::Entropy::Algorithms
# cpan2rpm --make-no-test Data::Entropy
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Data-Entropy-0.003-1.noarch.rpm
  • Crypt::MySQL
# cpan2rpm --version='0.04' --author='IKEBE Tomohiro <ikebe@shebang.jp>' Crypt::MySQL
# rpm -ivh /usr/src/redhat/RPMS/${BASEARCH}/perl-Crypt-MySQL-0.04-1.${BASEARCH}.rpm
  • Crypt::Eksblowfish
# cpan2rpm Crypt::Eksblowfish
# rpm -ivh /usr/src/redhat/RPMS/${BASEARCH}/perl-Crypt-Eksblowfish-0.001-1.${BASEARCH}.rpm
  • Crypt::UnixCrypt_XS
# cpan2rpm Crypt::UnixCrypt_XS
# rpm -ivh /usr/src/redhat/RPMS/${BASEARCH}/perl-Crypt-UnixCrypt_XS-0.06-1.${BASEARCH}.rpm
  • Authen::Passphrase
# cpan2rpm Authen::Passphrase
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Authen-Passphrase-0.005-1.noarch.rpm


  • Fax::Hylafax::Client (Optional)

Skip the tests here as well, unless you happen to have a properly configured HylaFAX server handy. Or, skip the package entirely if you don't plan on sending FAX invoices.

# cpan2rpm --make-no-test Fax::Hylafax::Client
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Fax-Hylafax-Client-1.02-1.noarch.rpm

RT Prereqs

*Perl Module**Package**Version**Repo*
Apache::Sessionperl-Apache-Session1.81-1.el4.rfdries
HTML-Formatperl-HTML-Format2.04-1.2.el4.rfdries
Class::ReturnValueperl-Class-ReturnValue0.53-1.2.el4.rfdries
DBIx::SearchBuilderperl-DBIx-SearchBuilder1.43-1.el4.rfrpmforge
Log::Dispatchperl-Log-Dispatch2.11-1.2.el4.rfrpmforge
Locale::Maketext::Lexiconperl-Locale-Maketext-Lexicon0.62-1.el4.rfdries
Locale::Maketext::Fuzzyperl-Locale-Maketext-Fuzzy0.02-1.2.el4.rfdries
Text::Wrapperperl-Text-Wrapper1.000-1.2.el4.rfdries
Time-modulesperl-Time-modules2003.1126-1.2.el4.rfdries
Text::Autoformatperl-Text-Autoformat1.13-1.2.el4.rfdries
Text::Quotedperl-Text-Quoted1.8-1.2.el4.rfdries
Regexp::Commonperl-Regexp-Common2.120-1.2.el4.rfdries
HTML::Scrubberperl-HTML-Scrubber0.08-1.2.el4.rfdries
Tree::Simpleperl-Tree-Simple1.17-1.el4.rfdries
HTML::TreeBuilderperl-HTML-Tree3.23-1.el4.rfdries
# yum -y install perl-Apache-Session perl-HTML-Format perl-Class-ReturnValue
# yum -y install perl-Locale-Maketext-Lexicon perl-Locale-Maketext-Fuzzy
# yum -y install perl-Text-Wrapper perl-Time-modules
# yum -y install perl-Text-Autoformat perl-Text-Quoted perl-Regexp-Common
# yum -y install perl-HTML-Scrubber perl-Tree-Simple perl-HTML-Tree
  • Log::Dispatch

Use the SRPM from Fedora Core 5. They have the correct and properly patched version that supports mod_perl 2.

But first, a couple of prereqs.

# yum -y install perl-File-Find-Rule perl-IO-String
# yum -y install perl-MIME-Lite perl-Mail-Sender perl-Mail-Sendmail

Now build and install Log::Dispatch itself. (There seems to be another rpm too, but it need Apache::Log)

# wget -O /usr/src/redhat/SRPMS/perl-Log-Dispatch-2.15-2.fc5.src.rpm http://download.fedora.redhat.com/pub/fedora/linux/extras/5/SRPMS/perl-Log-Dispatch-2.15-2.fc5.src.rpm

# rpmbuild --rebuild /usr/src/redhat/SRPMS/perl-Log-Dispatch-2.15-2.fc5.src.rpm
# rpm -ivh /usr/src/redhat/RPMS/noarch/perl-Log-Dispatch-2.15-2.noarch.rpm
  • DBIx::SearchBuilder

DBIx::searchBuilder is a little painful to install because it requires DBD::Oracle. You can just run "yum install perl-DBIx-SearchBuilder" if you want to go through the trouble of building and installing DBD::Oracle first. Again, that can be rather painful and isn't within the scope of this guide.

The alternative below is to force install the RPM for DBIx::SearchBuilder since we're not going to use Oracle anyway. You have to exclude it from future updates in yum otherwise you'll get dep failures everytime you do a "yum upgrade".

If you're not going to use RT, just skip DBIx::SearchBuilder altogether.

# yum -y install perl-Want perl-Clone perl-Cache-Simple-TimedExpiry
# yum -y install perl-DBD-SQLite perl-capitalization perl-Class-Accessor

# rpm -ivh --nodeps http://apt.sw.be/redhat/el4/en/${BASEARCH}/dag/RPMS/perl-DBIx-SearchBuilder-1.43-1.el4.rf.noarch.rpm

# echo "exclude=perl-DBIx-SearchBuilder" >> /etc/yum.conf

System configuration

This is just following the directions with CentOS-specific commands.

# groupadd freeside
# useradd -g freeside freeside

With CentOS 4.4, postgresql wouldn't start if SELinux was enabled. We call "setenforce 0" here to temporarily disable it. Some claim that it only needs to be disabled the first time postgresql is started.

Enable postgresql at startup, disable selinux temporarily, and start postgresql.

# chkconfig postgresql on
# setenfore 0
# service postgresql start

Create the freeside datbase user for postgresql.

# su -c "createuser -P freeside" - postgres

Installing Freeside

su to the freeside user, extract a copy of the freeside tarball or check out the code from CVS into the freeside user's home directory. You should have the freeside top-level Makefile in /home/freeside/freeside/Makefile or /home/freeside/freeside-1.7.0/Makefile at this point. 1.7.0 wasn't officially released at the time of writing, so we're using a version checked-out from CVS.

Edit freeside's top-level Makefile with your configuration. Here are some examples...

FREESIDE_CONF = /etc/freeside
FREESIDE_LOG = /var/log/freeside
FREESIDE_LOCK = /var/lib/freeside
FREESIDE_CACHE = /var/lib/freeside
FREESIDE_EXPORT = /var/lib/freeside

APACHE_VERSION = 2
FREESIDE_DOCUMENT_ROOT = /var/www/freeside/html

INIT_FILE = /etc/init.d/freeside
INIT_INSTALL = /sbin/chkconfig freeside on

HTTPD_RESTART = /etc/init.d/httpd restart
APACHE_CONF = /etc/httpd-freeside/conf.d

As the freeside user, create the database and make the perl modules.

$ createdb -E sql_ascii freeside

$ make perl-modules

As root, install the perl modules and create the initial config.

# make install-perl-modules

# mkdir -m 770 /var/lib/freeside
# chown -R freeside:root /var/lib/freeside/
# make create-config

Apache Configuration

Creating Freeside's Apache Instance

The default Apache init script for CentOS doesn't make it very easy to setup multiple instances of Apache. A few small modifications take care of that problem.

Start by making a copy of the init script, as well as download the patch and apply it to your httpd-freeside init script. You can make a symlink if you'd like to eventually setup additional Apache instances.

# ln -s /etc/init.d/httpd /etc/init.d/httpd-freeside

# cd /etc/init.d/
# wget -O /tmp/httpd-freeside.patch http://users.fire2wire.com/~khoff/freeside/1.7.0/httpd-freeside.patch
# patch < /tmp/httpd-freeside.patch

Make a copy of the Apache server root.

# cp -av /etc/httpd /etc/httpd-freeside

You can remove any extra conf files from /etc/httpd-freeside/conf.d (webdav, php, etc.) if you're not using them. They'll only take up more memory and potentially make freeside slower.

/etc/httpd-freeside/conf/httpd.conf

Change the following Apache configuration directives in /etc/httpd-freeside/conf/httpd.conf to match our previous changes.

  • ServerRoot "/etc/httpd-freeside"
  • PidFile run/httpd-freeside.pid

We're changing the listening port in case you're using the default Apache configuration (and port) for something else. This can be remedied by binding to a specific IP address as well (eg. 192.168.0.2:80).

  • Listen 8080

Freeside's instance of Apache needs to run as the freeside user and group.

  • User freeside
  • Group freeside
  • DocumentRoot "/var/www/freeside/html"
  • <Directory "/var/www/freeside/html">
  • ErrorLog logs/freeside_error_log
  • CustomLog logs/freeside_access_log combined


Install Docs and Freeside's Apache Includes

Inside the freeside source directory, run "make install-docs" and "make install-apache" as root.

# make install-docs
# make install-apache

Edit the config file that was just created (/etc/httpd-freeside/conf.d/freeside-base2.conf) by "make install-apache" and change the AuthUserFile directive to match our new path.

  • AuthUserFile /etc/freeside/htpasswd


Populating the Database

Populate the freeside database with the initial data, as the freeside user.

$ freeside-setup -d example.com

Create the freeside system users, as the freeside user.

$ freeside-adduser -g 1 fs_queue
$ freeside-adduser -g 1 fs_daily
$ freeside-adduser -g 1 fs_selfservice

Create whatever other freeside users you want, again, as the freeside user.

freeside-adduser -g 1 username
htpasswd /etc/freeside/htpasswd username

Repeat the last two commands as many times as you want for your internal staff's freeside accounts.

Startup Configuration

We just need to make sure that our new instance of Apache and the freeside queue daemon start when we boot.

# make install-init

# chkconfig freeside on
# chkconfig httpd-freeside on

And last but not least...start freeside's Apache instance.

# service httpd-freeside start

Hopefully, Apache should start without errors. If you do get errors, check /var/log/httpd/freeside_error_log.

Assuming Apache started correctly, you should now be able to access freeside via http://<Your server's FQDN or IP>:8080/. You can login using the username and password you set earlier with htpasswd.

From here, consult the standard freeside install documentation in the wiki on how to proceed with initial configuration. Good luck!

Problems

There might be some formatting issues as this was converted from TWiki to MediaWiki markup. If the syntax of a command doesn't look correct or doesn't make sense, it probably didn't get escaped correctly, or your web browser gobbled up some angle brackets, or both!

Personal tools