Building OpenPanel from source CentOS5.3

From Openpanel Documentation Wiki

Jump to: navigation, search

This document describes how to build openpanel from source on CentOS 5.3

Notes:

  1. Please note that I am new to this project and this is my first attempt. I have created these notes to document my experience but I do not expect that they will work for you. Additionally, I'm an accountant - not an IT boffin, so you have been warned!
  2. These notes are for i386 - please make appropriate changes for x86_64


Contents

Prepare your system

clean install with base

I used virt-install to boot up a new CentOS 5.3 image from the repository

add repo rpmforge

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

add dependencies

yum groupinstall -y "Development Tools" "Development Libraries"
yum install -y mysql-devel pcre-devel mercurial

yum install -y amavisd-new awstats pure-ftpd iptables mysql-server httpd postfix bind clamav clamd clamav-db spamassassin lighttpd perl-PlRPC \
perl-Archive-Tar perl-Archive-Zip perl-BerkeleyDB perl-DBD-SQLite perl-Compress-Zlib perl-Convert-BinHex perl-Convert-TNEF perl-Convert-UUlib  \
perl-Digest-HM AC perl-Digest-SHA1 perl-IO-stringy perl-MIME-tools perl-MailTools perl-Net-DNS perl-Net-Server perl-Time-HiRes perl-Unix-Syslog \
unarj lzop lzo zoo ripole unrar freeze arc nomarch cabextract perl-HTML-Parser php expect libtool-ltdl gamin-devel gdbm-devel pcre-devel

  • required to build courier - can be removed afterwards
yum install -y libtool-ltdl-devel libtool-ltdl postgresql-devel openldap-server

add courier

Here we download and build the source packages from the Courier sourceforge project site: https://sourceforge.net/project/showfiles.php?group_id=5404 You need to use a non-privileged user to build these - so create an account if necessary with the following:

useradd myusername
passwd myusername

Set up you build environment

cd ~
mkdir rpmbuild
mkdir rpmbuild/BUILD rpmbuild/RPMS rpmbuild/SOURCES rpmbuild/SPECS rpmbuild/SRPMS
mkdir rpmbuild/RPMS/i386 rpmbuild/RPMS/i586 rpmbuild/RPMS/i686
mkdir rpmbuild/SRPMS/i386 rpmbuild/SRPMS/i586 rpmbuild/SRPMS/i686
vi ~/.rpmmacros

Paste the following in to the file:

%_topdir        %(echo $HOME)/rpmbuild
%debug_package  %{nil}

The proceed to build courier packages

cd rpmbuild/SOURCES

wget http://kent.dl.sourceforge.net/sourceforge/courier/courier-authlib-0.62.2.tar.bz2
wget http://kent.dl.sourceforge.net/sourceforge/courier/courier-imap-4.4.1.tar.bz2
wget http://kent.dl.sourceforge.net/sourceforge/courier/maildrop-2.0.4.tar.bz2
wget http://kent.dl.sourceforge.net/sourceforge/courier/courier-authlib-0.61.1.20081206.tar.bz2

rpmbuild -ta courier-authlib-0.61.1.20081206.tar.bz2
rpmbuild -ta courier-authlib-0.62.2.tar.bz2 
rpmbuild -ta courier-imap-4.4.1.tar.bz2
rpmbuild -ta maildrop-2.0.4.tar.bz2

This needs to be done as root - use sudo / su -

cd /home/myusername/rpmbuild/RPMS/i386
rpm -Uvh courier-authlib-0.62.2-1.i386.rpm  courier-imap-4.4.1.i386.rpm maildrop-2.0.4-1.i386.rpm courier-authlib-pipe-0.62.2-1.i386.rpm courier-authlib-userdb-0.62.2-1.i386.rpm
ln -s /usr/bin/maildrop /usr/local/bin/maildrop

add user and group

useradd opencore
groupadd authd
groupadd paneluser
useradd openadmin -G paneluser

fix dynamic libraries

echo '/usr/local/lib' > /etc/ld.so.conf.d/common.conf
ldconfig

Download and Install

download from mercurial repository

hg clone http://hg.openpanel.com/wharf
cd wharf
make clean

build openpanel

make

install openpanel

cp -ar tree/opencore /var/opencore
mkdir /var/named/openpanel
mkdir /etc/httpd/openpanel.d
mkdir /etc/postfix/openpanel

start services

cd /var/opencore/bin
./swupd
./authd
./opencore

login to cli

./opencli
update user openadmin password=yourpass

Build VacationDrop

Note: this is not in wharf

cd ~
hg clone http://hg.openpanel.com/vacationdrop/
cd vacationdrop
./configure
make
cp vacationdrop /usr/bin/
cp setvacation /usr/bin/

Build LimaDaemon

cd ~
hg clone http://hg.openpanel.com/limadaemon/
cd limadaemon
./configure
make

Build logax

cd ~
hg clone  http://hg.openpanel.com/logax
cd logax
./configure
make
cp logax /usr/bin/

Build OpenCore-SSL

  • Download source
hg clone  http://hg.openpanel.com/opencore-ssl/
  • build
cd opencore-ssl
make
  • install
cp ~/tree/openpanel /var/
cp opencore-ssl /var/opencore/bin
cd /var/opencore/bin


  • generate SSL certifcate
mkdir /etc/openpanel

echo "-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDEKtLzKH/XJAreHeGNZcgXr7onz7ZVus4fyS3vlHdQsIz32UVo
OwI7bN33gk7Ait0BnadlyFwqIF8/jq9x/7mz1OsAu1TcIssmRKwgIn3ABR30s2Tp
I/Ok6GQ4yn2Ak+QMtH6dnv87SOCXpuJYNtEijjF/s4MCk4kk9ZXX6eqx2QIDAQAB
AoGAHcqnKNiQubq2j88X7yJzBe3hJqSr+08YeMlT2ZvBlxaJAicUHGVBzIaXGzzF
+wXb1J/9yT5piNhLvtpLmNOOfxYQNs+oTNMMzRYV84FFS5xMDRXggBJ5Y9LyR24S
Rt29uQxd61YvM/dFU80neFQghRcOodqZeHtSpCchShb1LdECQQDnOIfcdsgoyAuj
NJI1YENtywQ5ZIPi7JrA4uAWA7NlGIkw0GlAgSzPtsOj/Gko2fc1UE0JO7saqxlA
yOthvVX9AkEA2TCcUTg+Oh5DA/OKI7nLqugB/o1LvVMdSDGgtuat+574dwbSFkEY
Gz+2/Fur7vMz5bwB/sn3BcNi+60GPxjkDQJAYiUCtjfNGlJfbjUgYnur42yrLFlY
Cfh4b6tdhrqnaSATC59LLdAm3zwqqu63DFoIrp6ZNHQgJV++5lriXqhpWQJBAJ7H
0v/txlBm30d8PHlx01vW0d5vHfgDU1z8KyqL6pYR2kPqUJzEagNByV0lB8VhN4e0
syC6NkWYWjz0eaSXZeECQAvcfLilonjvhGh3xyMlfgKSzoC3j5Jp5leE3e7SdaUE
ieSIURWMYvjR4o5II9Itj4xYvIFean2O1x7tycIw8rE=
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIDHzCCAoigAwIBAgIJAKcV097JHjcOMA0GCSqGSIb3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ATE-----
" > /etc/openpanel/openpanel.pem


  • start opencore-ssl
./opencore-ssl

fix redhat stuff

touch /etc/named.conf
mkdir /var/log/httpd/openpanel/logs
mkdir /etc/postfix/openpanel/amavis
  • create /etc/httpd.conf.d/openpanel.conf as follows:
# Openpanel configuration 
NameVirtualHost *:80 
# Include openpanel's vhosts 
Include /etc/httpd/openpanel.d/*.conf 
 
# Logax configuration 
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" openpanelcomb 
CustomLog "|/usr/bin/logax -b 10 -r -i 180 -m 500000 -s /var/log/httpd/openpanel /var/log/httpd/openpanel/logs" openpanelcomb 
Alias /openpanel-template-images/ "/var/openpanel/http-templates/images/" 
Alias /openpanel-template-docs/ "/var/openpanel/http-templates/" 
<Directory "/var/openpanel/http-templates"> 
  AllowOverride None 
  Order allow,deny 
  Allow from all 
</Directory> 
<LocationMatch "^/+> \
  Options -Indexes 
  ErrorDocument 403 /openpanel-template-docs/index.html 
</LocationMatch> 

Restart apache service

service httpd restart
chkconfig httpd on

Pure-FTP service

service pure-ftpd start
chkconfig pure-ftpd on

Postfix service

service postfix start
chkconfig postfix on

Amavis Service

service amavisd start
chkconfig amavisd on

Login to openpanel

Now you can log in by going to https://your.server:4089/ and logging in with the 'openadmin' user and the password you just set up.

Testing

  • created domain, created domain records
  • created email mail box, sent mail, logged in via imap

Problems

  • can't login to pure-ftpd after creating user - user db looks correctly generated - but /var/log/messages displaying password failure

Please add your problems here.....

Trouble Shooting

Look in the logs:

cat /var/opencore/logs/opencore.event.log

navigate to the broken module and execute the verify

sh -x verify 3>/dev/null

To Do

  • service wrapper scripts

Thanks

I'd like to thanks the following irc users who have been really helpful in pointing me in the right direction when I've met challenges along this path. These guys have given up their free time to help me understand oepnpanel in some operational detail and without that - I probably would have become lost and perhaps never reached the goal.

  • javert - told me that centos > 4 did work and first pointed me to the build instructions
  • exel - provided some great info on debugging, specifically the following:
    • I think this has something to do with not all modules being loaded, probably some base module that is being whiny about missing deps - is there anything of interest in /var/opencore/log/opencore.event.log, error-wise, after starting opencore?
    • also check /var/opencore/modules/$module_that_fails/verify - that's the script that determines whether your system is cool enough to run the module, so to say.
    • the /var/opencore/modules/PostfixCourier.module/postinst may be of interest - that's what the centos4 rpm uses to get all the config right

Thanks to everyone who has encouraged me along the way and answered all my dumb questions

Personal tools