Installation


Upgrades


DTC-Xen Installation


DTC-Xen / Dom0 Howtos

DTC-Xen / DomU Howtos

FAQ


DTC Howtos


Manuals


Features


Roadmap


Devel docs


Wiki - i18n


Wiki - Meta


Setting up DTC on CentOS 5 and other RPM-based distributions

Before you start, we'd like you to know that the RPM based setup is currently rather experimental. We regularly rebuild DTC releases and its dependencies and publish it in our repository, but we rely on your questions and reports to improve it continuously, so don't be afraid to relay them to us or edit this wiki page if you find a workaround or a fix for a problem you experienced.

These instructions will be guaranteed to work if you're using CentOS 5 or the latest Red Hat Enterprise Linux release. They may also help you if you're using Fedora-based systems or CentOS 4 / older releases, but there are no guarantees. However, we do appreciate reports on anything that failed in Fedora -- we're hopeful the same packages will, with your help and input, work just fine in all RPM-based systems eventually; that's our ultimate goal.


Note: The current release (dtc-core-0.32.3-0.1) has still some issues.

Please review the CentOS and other RPM based distributions forum for the latest updates prior to installing.


Fast setup without any read, in 9 shell commands

If you don't want to read much, just perform the following commands.

32 bits version:

   hostname mx.example.com
   wget -q ftp://ftparchive.gplhost.com/yum/gplhost.repo -O /etc/yum.repos.d/gplhost.repo
   wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
   rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
   yum install dtc-postfix-courier
   sa-update
   /usr/share/dtc/admin/install/install --not-interactive --centos-init-daemons --mysql-pass YOURPASSWORD --dtcadmin-pass YOURPASSWORD
   service httpd start
   service named start
   chkconfig named on

64 bits version:

   hostname mx.example.com
   wget -q ftp://ftparchive.gplhost.com/yum/gplhost.repo -O /etc/yum.repos.d/gplhost.repo
   wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
   rpm -ivh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
   yum install dtc-postfix-courier
   sa-update
   /usr/share/dtc/admin/install/install --not-interactive --centos-init-daemons --mysql-pass YOURPASSWORD --dtcadmin-pass YOURPASSWORD
   service httpd start
   service named start
   chkconfig named on

Detailed setup

So, let's get on with the program. Setting up DTC in CentOS is a rather straightforward procedure which should take thirty minutes tops:

  1. Install your operating system (not convered in this HOWTO)
  2. Set up the RPMForge repository (to pull several DTC dependencies)
  3. Set up the DTC repository
  4. Install DTC rpm
  5. Pre-configuration checklist
  6. DTC configuration
  7. Post-configuration adjustments

Setting up the RPMForge repository

First, we need to set up the RPMForge repository on your machine. At the time of writing this HOWTO, the latest RPMForge RPM release for CentOS 5.1 was:

You probably want to get the latest release so peruse the right package here. Make sure the name matches your architecture (x86_64 or i386) and base system (fc7, fc8, el4, el5).

Once you've installed it, make sure you execute yum update to get your system up to date with all the packages.

Setting up the DTC repository

Once you've installed the RPMForge repository, put the following file (name it gplhost.repo) in /etc/yum.repos.d/:

[gplhost-archspecific]
name=GPLHost (architecture-specific)
#baseurl=ftp://ftparchive.gplhost.com/yum/centos/$releasever/RPMS/$basearch/
mirrorlist=http://ftparchive.gplhost.com/yum/centos/$releasever/RPMS/$basearch/mirrorlist
gpgcheck=1
enabled=1
gpgkey=ftp://ftp.gplhost.com/yum/RPM-GPG-KEY

[gplhost-noarch]
name=GPLHost (architecture-independent)
#baseurl=ftp://ftparchive.gplhost.com/yum/centos/$releasever/RPMS/noarch/
mirrorlist=http://ftparchive.gplhost.com/yum/centos/$releasever/RPMS/noarch/mirrorlist
gpgcheck=1
enabled=1
gpgkey=ftp://ftp.gplhost.com/yum/RPM-GPG-KEY

That sets up yum to download DTC from our repository mirrors. Make a note that the URLs have centos in them, but in the future we'll be providing packages for Fedora too.

Installing DTC

Once you have both rpmforge and GPLHost's repository, simply type:

   yum install dtc-postfix-courier

or

   yum install dtc-core

depending on how much dependencies you want to be instealled. dtc-core aims at installing the least possible dependencies, so that you just have a workable environment: a web server, no serious mail system. dtc-posfix-courier is when you want to use all supported packages from DTC, with mail content scanning, etc.

Fully-qualified host name

Your machine must have a fully qualified host name. Some Linux distributions happily accept or default to a simple host name (like saturn), while several daemons including SpamAssassin need a FQDN in the machine (like saturn.mit.edu). Use the setup tools in your machine to ensure this is the case.

You shall check that /etc/sysconfig/network has the correct FQDN. If it doesn't, then set mx.example.com there, and reboot. You shall also check that /etc/hosts has it. Then check with uname -a that your server is currently configured with the correct hostname.

SELinux and firewall

Use system-config-securitylevel to open the requisite ports for the services you'll be using. Then disable SELinux or set it to permissive, otherwise DTC configuration will fail and DTC won't be able to operate even after the configuration.

The following will tell you if it's enabled or not:

if selinuxenabled ; then echo "SELinux is enabled" ; else echo "SELinux is disabled" ; fi

MySQL security

It's advised to increase the timeout of MySQL as follow (edit /etc/my.cnf):

   connect_timeout=300
   wait_timeout=1800

Start your MySQL server with:

/sbin/service mysqld start

And then set an initial root password for it with:

/usr/bin/mysqladmin -u root password 'replace-me-with-a-secure-password'

Write this password down -- you will need it in order to set DTC up.

Starts all your daemons after the packages are installed

   service httpd start
   service crond start
   service postfix start
   service clamd start
   service amavisd start
   service rsyslog start
   service mysqld start
   service courier-authlib start
   service courier-imap start
   service dkimproxy start
   service pure-ftpd start
   sa-update
   service spamassassin start
   service saslauthd start

DTC configuration

After the installation and daemon setup is complete, set the safe mode to off in /etc/php.ini so that the cron job can do what it needs, then run

/usr/share/dtc/admin/install/install

This program will help you reconfigure your network services so they work properly in conjunction with DTC. Then simply start apache:

   service httpd start 

and browse your new URL.

Few tweaks

  • Squirrelmail fixing

Once you have installed dtc-postfix-courier, you might want to fix Squirremail so it can work with Courier. Just do this:

   /usr/share/squirrelmail/config/conf.pl

Then hit the letter D (capital letter), choose courier, then do:

   chown dtc /etc/squirrelmail/*

If you see the following error in Squirrelmail :

ERROR: Could not complete request.
 Query: CREATE "Sent"
 Reason Given: Invalid mailbox name.

You need to comment out the line in /etc/squirrelmail/config_local.php like this

#$default_folder_prefix         = '.';

then your Squirrelmail is good to go.

The end

So, basically that's it.

If you have any questions or any problems at all, you can submit them to our repo manager via e-mail or MSN.

Now you're ready to take your first steps within DTC.

Editing this page means accepting its license.

Page last modified on July 05, 2011, at 09:35 AM EST