migrate directadmin into freebsds services (exim etc)

tsiou

Verified User
Joined
Sep 15, 2006
Messages
236
Location
Larisa, Greece
migrate directadmin into freebsds ports (exim etc)

The file with the instructions is moved here...

**** EDITED ******************************************************
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 [email protected] 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!
********************************************************************

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 :)

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.

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)..


************************************************************************************************
 

Attachments

  • howto.txt
    16.9 KB · Views: 1,413
Last edited:
Thanks

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. :)
 
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:
 
Code:
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.
 
***** ADDED TO txt, no need to read it******

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


**** Added also
2. apache
you should cd /usr/ports/www/apache20, and run
make WITH_SUEXEC_MODULES=1 deinstall reinstall
to have the needed suexec module
 
Last edited:
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.
 
***** ADDED TO txt, no need to read it******

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
 
Last edited:
***** ADDED TO txt, no need to read it******

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 [email protected] 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
 
Last edited:
I will be trying this in the near future on FreeBSD 6.2 . Will keep you posted on how it goes!
 
I used your tutorial to switch only Apache and PHP to the ports versions and all seems to be working seamlessly. The only thing i did differently was install apache 2.2 rather than 2.0.
It took -ages- (almost an hour) to build everything in the php5-extensions package and in hindsight i could have done without a lot of extensions but never mind. I now have the benefit of allowing for portupgrade to keep Apache and PHP up to date... much better!

One thing i will say is that it seems as though the howto.txt is ordered wrongly, I wouldn't recommend installing mod_security and mod_evasive from ports before you have sorted out configuring and integrating php from ports.

One more thing -- remember to restart MySQL after upgrading apache and PHP to stop it causing high loads.

EDIT: This post should be placed in the How-To Guides section as well.
EDIT2: I used FreeBSD 7.1-Release for this howto and, other than using apache22, followed the howto exactly
 
Last edited:
One thing i will say is that it seems as though the howto.txt is ordered wrongly, I wouldn't recommend installing mod_security and mod_evasive from ports before you have sorted out configuring and integrating php from ports.

EDIT: This post should be placed in the How-To Guides section as well.

Yes you're right.. I 've changed the order...

Also i added (as i can remember) zend installation and a section that says about pkgtools.conf
(in apache22 it may not cause any problems as it may have suexec enabled by default)


The how to is written many months later than the real installations .
Some things may be missing. I hope that someone with
a new server to follow my guide, add his comments, see where my how to is wrong and post a real how to :).
Unfortunately i dont have a spare server to reinstall or the time needed ( i have the time to help somenone by advice though)....

If you 're starting now, take notes step by step, i can help you anytime by email for any problems, and make a how to that works 100% and then post it to the how to's section....

If someone is willing to do this, we can ask from DA support to open a section in the freebsd forum to discuss there for updates probles etc...

I think that if there were a 100% working how to many freebsd users would follow it.
For a year and a half ago that i started i only do a pkg_version -v |grep needs and portupgrade xxxxxx
 
Last edited:
thnaks for the information buddy well it true ...
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)
 
Back
Top