PDA

View Full Version : migrate directadmin into freebsds services (exim etc)


tsiou
07-24-2007, 12:15 AM
**** EDITED ******
Also check my post below with the howto.txt attachment
****************

Hi,
i have just managed to make my directadmin independent from its custom build services.
Unfortunately i cant write an extensive how to as many hours and attempts needed to make it work.
I can say though that it can be done. I have disabled all of DA's services and use freebsd's default services.. now i can freely portupgrade and follow security updates for apache, exim etc and follow freebsd's update tree.
The idea came from DA's how to upgrade mysql for freebsd.

As a rule, the standard procedure was :
1. install the service (cd /usr/ports/www/apache20) and when possible complile it with flags that DA uses.
2. cd to /usr/local/etc/apache, delete the folder and make a link to DA's config (/etc/httpd/conf)
3. delete DA's service files (/usr/local/bin/httpd) so the system use /usr/local/sbin/httpd)
4. set some flags to /etc/rc.conf to match DA's prefs and enable the service
5. sometimes have some links from DA's services to freebsd services like ln /usr/local/sbin/httpd /usr/local/bin/httpd
6. delete DA's startup files and let the system use its own.
7. start the service and see the logs for what you have forgotten :)

the system goes well for some time now, with most of the services changed (exim, mysql, apache, proftp, spamassasin), only dovecot has to be done.

Dont try to move all of the services by one, for example change spamassasin, wait for some days to see that the system goes ok, change exim and wait some days, then proftp etc..

proftpd is the simpler service along with mysql
then you can try spamassassin (this needs the links from the old executables as exim uses them by absolute path) etc...

In the end if something doesnt work you can pkg_delete it and use DA's custom build script to reinstall it :) and go from scratch.

The only problem (not really a problem) that i cant solve is that DA's service monitor doesnt work for exim and shows the service down (have to disable DA's exims check and notification by email) but i will try to solve it with the help of DA's crew.

I'm willing to help anyone who try's some of the above, i will watch this thread (cant every day due to military obligations for some months)..

Andres
08-09-2007, 08:16 AM
I see some one goes the same way.
Actually, FreeBSD is a stable system, and Linux - a set of varios software runing on kernel with many variation. So compile everything for linux by hands or setup.sh is a good idea. FreeBSD is operation system, and can manage/update software by itself. I hope one day directadmin can do installation via ports collection. :)

df-sean
08-24-2007, 10:09 AM
Me too! DA devs -- please consider letting FreeBSD ports take care of the services for a future release. It seems such a shame to have the bulk of my services not under the beautiful FreeBSD ports system. I can use FreeBSD, but I can't use one of its greatest features: the ports package system. :confused:

pucky
08-24-2007, 05:51 PM
Try building upon this thread, http://www.directadmin.com/forum/showthread.php?t=20728

lissyara
10-20-2007, 08:36 AM
serv# more /usr/local/directadmin/data/admin/services.status
directadmin=ON
exim-4.68-0=ON
httpd=ON
mysqld=ON
named=ON
proftpd=ON
sshd=ON
serv#
and status exim works.

tsiou
02-19-2008, 05:25 AM
Some notes when upgrading/installing ports :

1. exim
you should cd /usr/ports/mail/exim, edit the makefile and replace
EXIM_USER?= mailnull
with
EXIM_USER?= mail
to use DA's owner in files/directories
and then
make deinstall reinstall

2. apache
you should cd /usr/ports/www/apache20, and run
make WITH_SUEXEC_MODULES=1 deinstall reinstall
to have the needed suexec module

CentOS5
10-15-2008, 07:06 AM
Some notes when upgrading/installing ports :

1. exim
you should cd /usr/ports/mail/exim, edit the makefile and replace
EXIM_USER?= mailnull
with
EXIM_USER?= mail
to use DA's owner in files/directories
and then
make deinstall reinstall

2. apache
you should cd /usr/ports/www/apache20, and run
make WITH_SUEXEC_MODULES=1 deinstall reinstall
to have the needed suexec module

you should cd /usr/ports/mail/exim, edit the makefile and replace
EXIM_USER?= mailnull
with
EXIM_USER?= mail

ANd Remeber to chage it everytime exim is upgraded in ports.

tsiou
10-21-2008, 02:11 PM
For apache and mysql you can edit /usr/local/etc/pkgtools.conf, search for :
MAKE_ARGS = {

and make it like :

MAKE_ARGS = {
'databases/mysql50-server' => 'WITH_LINUXTHREADS=1',
'www/apache20' => 'WITH_SUEXEC_MODULES=1',
}

so at every portupgrade you dont need to deinstall reinstall.
For mysql it compiles it with linux threads support (it's not needed but you can use it for better perfomance)

If anyone can find out how we can use a way like it to avoid editing exim's Makefile before every upgrafe to replace mail with mailnul user, then the system is complete..

############## EDITED TO POST SOLUTION ###################
Many thanks to paix that solved that too :
edit exim.conf and add :

exim_user = mail
exim_group = mail

tsiou
10-29-2008, 10:43 AM
Hi, unfortunately i dont have time to put it all together, but i'm posting some notes attached for how i did my migration to ports.
There may be some mistakes (some of the notes added after some months of the real test), so try it and post any problems to check it out.
Don't try if possible in a production server, i hope that someone who has the time to test it will post back a 100% working directions.
It's running on freebsd 6.3 and (6.2) 32bit but i thing that it can be used for 7.0
Be sure to replace some root@servername.domain.com with your domain name..

Paix i hope that you can edit it and test it for 7.0 64bit ..

Before changing anything take a backup!

####### HOWTO.TXT IS UPDATED IN TIME TO TIME SO DOWNLOAD THE LATEST VERSION OR READ THE ENTIRE POSTS

S25
11-11-2008, 08:43 AM
I will be trying this in the near future on FreeBSD 6.2 . Will keep you posted on how it goes!

tsiou
11-11-2008, 01:31 PM
I will be trying this in the near future on FreeBSD 6.2 . Will keep you posted on how it goes!

And maybe keep some notes to edit my file and post a 100% working setup.

S25
11-11-2008, 03:45 PM
Sure! Assuming I get it working ;) !