For those who wants to give it a try, here is the best way to have a (fast) setup of the DTC control panel.
Prerequires
You will need a freshly installed Debian stable with a hard drive partition of at least 1.2 GB, plus all the space you will need for you hosted files (mail, web and db). The absolute minimum amount of RAM to run DTC is 128 MB of RAM with 256 MB of swap space, but it's highly recommended to use it with 256 MB of RAM, so you have enough to do mail content scanning and filtering. DTC doesn't use some memory by itself (as it's made only of sh and php scripts), but there's a lot of daemon running to run all the system. To give a rough idea, with about 1000 domains, you will absolutely need something like 2GB as a start, but with a reasonable traffic, 4 or even 8GB seems a good idea.
GPLHost Debian repository
If you are using Etch, first of all, add the debian repository (select the closest to you, the .fr and .sg mirrors are synchronized hourly). Note that if you are using Lenny, DTC is directly available from your closest Debian mirror, BUT it's version is outdated and you'd better use the GPLHost repositories bellow, unless you want to use something older than the stable release.
Here are the addresses of our mirrors:
PLEASE, use FTP as much as possible.
Let's say you are using our Tampa mirror (if you don't replace ftp.gplhost.com in all what is below by the mirror you have selected):
echo "deb ftp://ftp.gplhost.com/debian lenny main" >>/etc/apt/sources.list
NEW: add our repository key:
wget -q ftp://ftp.gplhost.com/debian/repository_key.asc -O - | apt-key add -
Then OF COURSE, run apt-get update.
Here is a full /etc/apt/sources.list for lenny (replace CC by your country code):
# Binary repositories:
deb http://ftp.CC.debian.org/debian/ lenny main
deb http://security.debian.org/debian-security lenny/updates main
deb http://volatile.debian.org/debian-volatile lenny/volatile main
deb ftp://ftp.gplhost.com/debian lenny main
# Source repositories:
#deb-src http://ftp.CC.debian.org/debian/ lenny main
#deb-src http://security.debian.org/debian-security lenny/updates main
#deb-src http://volatile.debian.org/debian-volatile lenny/volatile main
#deb-src ftp://ftp.gplhost.com/debian lenny main
If you are still using Etch (which is a bad choice), just replace lenny by etch everywhere above. Note that you don't really need the source repositories, or contrib and non-free. DTC and it's dependencies are all fully free, included in "main".
If you use Lenny, you will notice that DTC pulls really A LOT of dependencies. This is because by default, Lenny install all the packages that are in the Recommends: section of each dependencies. If you want to avoid that, simply put this in your /etc/apt/apt.conf.d/20norecommends:
APT
{
Install-Recommends "false";
}
Doing this will pull 100 less packages at least, and save a lot of disk space by pulling only what is absolutely necessary, which is best in a server environment.
Before the setup
Check that you have a valid hostname entered, or amavisd-new will complain about it and refuse to setup. Try this command, as this is the one that amavis will use:
hostname --fqdn
it should return the fully qualified domain name of your mx server that should be something like "mx.example.com" (this is best option). Check that
cat /etc/hostname
returns mx.example.com and that
cat /etc/hosts
returns something like:
10.2.3.4 mx.example.com mx
The order of the host names after the IP seems to matter.
The below reverse order does NOT seem to work on Debian Etch
when running "hostname --fqdn":
10.2.3.4 mx mx.example.com
Also, you can make it so the reverse DNS for 1.2.3.4 also replies mx.example.com as many SMTP servers out there check for it. The reverse for the DNS server is less important, and you can always use mx instead of ns1 (in that case, you will change it later in dtc -> general configuration -> named zone files once DTC is installed).
check your hostname ( /etc/hostname )
hostname -d gives only example.com
hostname -s gives only mx
hostname -f gives the mx.example.com
if not, correct it by editing /etc/hostname then run /etc/init.d/hostname.sh start
Something like "mx.example.com" in /etc/hostname sounds to be the correct setup (otherwise you need some more customization).
Then check that "uname -a" is returning the correct FQDN.
If you are still running a kernel older than 2.6.24 (for example if you run Etch), the capability module has to be loaded. Another way is to recompile pure-ftpd-mysql with the option not to use this kernel module. You can find how to do this here.
the default debconf is set to high, dtc will miss some questions. Resolve this with:
dpkg-reconfigure debconf
choose Dialog, the default, and then medium. This way you dont miss questions when configuring your packages at install time.
Make sure you have at least one locale installed (eg: supported languages like ru_RU.UTF-8, fr_FR, en_US, es_ES, pt_PT, it_IT, etc.). To check, do:
dpkg-reconfigure locales
and make sure at least one entry is selected.
Remember that you HAVE to use the debian volatile repository to have clamav and spamassassin working. The default one simply does NOT work. So don't forget to add this repository:
deb http://volatile.debian.org/debian-volatile etch/volatile main contrib non-free
If you want to know more, read this site: http://www.debian.org/volatile/
Installing dtc-toaster
Then do a apt-get update and apt-get install dtc-toaster. Answer the few questions, and that's it, you are DONE !
Installing dtc-core
If you want a server using a lot less memory, then you can use dtc-core. It has as few dependencies as possible, to allow you to have a minimal install. It even doesn't have a dependency on mysql, so you can use a remote MySQL server. It also allows you to choose what kind of package you want for everything. Here's an example on how to setup:
apt-get install dtc-core postfix postfix-tls postfix-mysql mysql-server-5.0
Then the rest of is as usual, knowing that you wont have mail content scanning and such. Note that if you are running a not-so-busy server, then 256 MB of RAM is enough with this kind of setup, while dtc-toaster requires quite more RAM.
WARNING:
This is a very common mistake: dtc-xen is NOT to be setup under the same server where dtc is installed. It's to be setup on your dom0, while dtc itself would be typically installed in a domU. If you don't know what dom0 is, read the Xen documentation.
Important answers to debconf
Here is some side notes about what to answer to debconf when doing the setup.
- Create directories for web-based administration ? -> yes.
- Postfix general type of configuration? -> Internet Site. Answer mx.example.com when it asks for the mail name as this is the default in DTC.
- Run pure-ftpd from inetd or as a standalone server? -> standalone. Note you will need the capability kernel module to run pure-ftpd (can be found under the security screen in the make menuconfig).
Later, you will need to activate spamassassin and saslauthd in /etc/default, as Debian leave it not activated at boot time (See Post Install section).
The other options don't matter a lot, select what you feel is good for you.
Note that if you didn't had any question for the MySQL root password, or for pure-ftpd-mysql, that means that your debconf priority was set to high and that you need to reconfigure these package:
- dpkg-reconfigure pure-ftpd-common
- dpkg-reconfigure mysql-server-5.0
Its a good idea to run the "dpkg-reconfigure pure-ftpd-common" regarless, as the config has been known to periodically fail.
Post install
Debian has a policy which prevents a required post-install script from running. To complete the setup of DTC, the following script must be run as administrator:
/usr/share/dtc/admin/install/install
** Note - You may need to open /etc/courier/authdaemonrc and change a line to read: \\ authmodulelist="authmysql"
to avoid the "pop3 login error" as the configuration generation screen.
Special note for Ubuntu users
Someone wrote here:
"I get root@ubuntu:/usr/share/dtc/admin/install# ./install
bash: ./install: Permission denied so I chmod 777 install, then it worked but failed at the end with -> Managing ldconfig
exec: 17: /sbin/ldconfig.real: not found.
In Kubuntu ldconfig is a script that calls ldconfig.real - Rename ldconfig to ldconfig.real in the /usr/share/dtc/admin/install/functions script"
This is because the Ubuntu package was never updated. We DID the necessary modifications in our package, but it didn't reach Ubuntu yet. In that case, make sure to use the package from GPLHost, and not the outdated one from Ubuntu.
You should also check the /etc/default folder so it starts daemons automaticaly. These files must have the excute bit set. If they dont, run these commands:
chmod +x /etc/default/saslauthd
chmod +x /etc/default/spamassassin
chmod +x /etc/default/apache2
locales
If you are using Debian, then you need to apt-get install locales and maybe dpkg-reconfigure locales. If you are using Ubuntu, then you might need this:
1. sudo cp /var/lib/locales/supported.d/local /var/lib/locales/supported.d/local.old
2. sudo cp /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/local
3. sudo dpkg-reconfigure --force locales
If you don't perform this step, then the control panel will display "failed to setlocales" and there wont be any language support. Note that you do not need UTF8 but you do need en_US ISO8859-1, plus all the languages that you will want to be displayable.
Edit PhpMyAdmin .htacess file so phpmyadmin will work
DTC should be automatically patching it, but if the file changed since the last release of DTC, the our md5 is failing and DTC will not be able to do anything. Just remove the line inside the .htaccess file on line 2, located in /usr/share/phpmyadmin/.htaccess that should be this way:
Option FollowSymLinks
Commenting it using a # in front also works.
YOU SHOULD BE ALL DONE INSTALLING DTC-TOASTER
Log in with:
https://dtc.example.com/dtcadmin/
Username: dtc
Password: What you chose during the package configuration.
If it doesn't work, try using the IP address directly instead of dtc.example.com (as your DNS setting might be wrong). Something like: https://10.2.3.4/dtcadmin/
Now if you want to help gplhost, you can "vote" for us by installing the popcon package (apt-get install popcon) to participate to the Debian packages popularity contest.
_________________________________________________________________________________________
Finally, if you want to help us, install the popularity-contest package to report to Debian that you are using our packages. This will help us to get a higher score and help people to see that many are using our packages.
How to get out of the tracks with specific setup
Note that dtc-toaster is a meta package that will install apache 2, mysql 5.0, postfix and courier. If you want to use cyrus, qmail, dovecot, apache 1.3, or any other specific things, you need to install them first with apt-get, then apt-get install dtc and it will detect what you have selected. This is also the way to go when you want to use the Cyrus delivery and pop3/imap system.
Here is the link to the howto for Debian Express Setup Old Version. If you want more explanations, you can go on the forums install faq here or on the dtc faq on this wiki (see the left menu...).