How To Install Directadmin on FreeBSD 9.1

DA-Rff

Verified User
Joined
Dec 4, 2006
Messages
119
After lots of trials and errors, this is what worked for me, hope it saves someone else time.

How To Freebsd 9.1 Directadmin Install

First Install FreeBSD - MINIMUM INSTALL ONLY!!!

check http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall.html freebsd 9 installation handbook

Make sure you DO NOT install 32 bit binaries!!! This runs you into trouble with Directadmin

Freebsd 9.1 partition structure:
Partition Type Size Mountpoint Label
freebsd-boot 512K
freebsd-ufs 2G /
freebsd-swap 16G
freebsd-ufs 30G /var
freebsd-ufs 4G /tmp
freebsd-ufs 30G /usr
freebsd-ufs remainder of disc /home

**** SPECIAL NOTICE for FreeBSD non-root ssh logins ****

You *must* add "AllowUsers username" to /etc/ssh/sshd_config before you log out from root or you'll lose root on the server forever, and you'll have to format.

On VPS: Make snapshot so the above steps are easy to replicate in case you need to.

Now update the ports on your box:

run the following commands:

# portsnap fetch

# portsnap extract

# portsnap update

When your ports are up to date, move on to:

Preinstall before Direcatadmin
Install ports below before Directadmin install:
(gcc and g++ are required to compile apache and php)

To find a port, use "whereis portname" on commandline
or use find / -name portname

Then go to port location and: make install clean
Here are the ports and locations that need installing:

ssh: installed during freebsd install
gcc: /usr/ports/lang/gcc
g++: included in gcc
perl: included in gcc
gmake: included in gcc
opensssl-devel: /usr/ports/security/openssl
wget: /usr/ports/ftp/wget
bison: /usr/ports/devel/bison
flex: /usr/ports/textproc/flex
gd: /usr/ports/graphics/gd
cyrus-sas12: /usr/ports/security/cyrus-sasl2
libidn: /usr/ports/dns/libidn

The above takes a while, relax and have a cuppa!

Next download the directadmin setup.sh file

# fetch http://www.directadmin.com/setup.sh

Change permissions on the setup.sh file

# chmod 755 setup.sh

Now run the setup script!

# ./setup.sh

You will be prompted for a client ID number, license ID number, and hostname.

Important: The hostname should not be the same as the primary domain name. e.g. gary.com is not a good hostname, where server.gary.com is. Having the same host/main domain name will cause e-mail and FTP problems. Also, please make sure the hostname resolves once you setup DNS.

!!! Make sure you use custombuild 1.2, because version 2 is in beta and installs apache 2.4 which does not work well yet on freebsd 9.1 per december 20 2012, date of this How To

=========INSTALLATION TROUBLES============

If you've just finished a DirectAdmin install and are trying to start apache, but you get the error:

Syntax error on line 21 of /etc/httpd/conf/extra/httpd-vhosts.conf: Could not open configuration file /etc/httpd/conf/ips.conf: No such file or directory
this means that the ips.conf is missing. The cause is usually that the DirectAdmin install didn't actually finish.

In that case, to finish the install, type:

cd /usr/local/directadmin
./directadmin i
./directadmin p

which is the last step of the DA install.

In case something in custombuild didn't compile correctly. Type the following:

cd /usr/local/directadmin/custombuild
./build all d
and check for errors in the last few pages of output if it stops prematurely.

=============VPS Settings DA===================

Special notice for VPS/VDS installs:
After the install, add:

ethernet_dev=devicename to /usr/local/directadmin/conf/directadmin.conf

type: /sbin/ifconfig to see which device your IP is on.

Replace devicename with the FULL devicename reported by ifconfig. If your VDS/VPS system emulates eth0, then you may skip this step.

FreeBSD 9.1 may require an exim rebuild (for me it did):

Use custombuild for that:

cd /usr/local/directadmin/custombuild
./build update
./build set exim yes
./build exim

Restart exim, and you're done.

This is what worked for me on december 20th 2012 :)

Good luck!
 
I installed on FreeBSD 9.1 with CustomBuild 2.0; however not with the default options. It will work with:

1. PHP set as mod_php

2. ProFTPD instead of PureFTPD
 
I installed on FreeBSD 9.1 with CustomBuild 2.0; however not with the default options. It will work with:
1. PHP set as mod_php
2. ProFTPD instead of PureFTPD
This is major good news. Those are my normal settings anyway, but most importantly it means you also have mod_ruid2.

Which version of Apache and PHP are you running?

*I wonder why CustomBuild 2.0 has been in beta for so many years.
 
No, I did not install mod_ruid2. I actually did not even try mod_ruid2. As far as I know mod_ruid2 do NOT work on BSD systems at all. Here is the options.conf that works:

#PHP settings.
#Default version of PHP is always php1_release. Possible values for php1/php2_release: 5.3, 5.4, 5.5, no. php1/php2_mode: mod_php, fastcgi, php-fpm or suphp)
php1_release=5.4
php2_release=no
php1_mode=mod_php
php2_mode=php-fpm
php_ini=yes
#Possible values - production or development
php_ini_type=production
ioncube=yes
zend=no

webserver=apache

#Possible value: 2.4
apache_ver=2.4
mod_ruid2=no
secure_htaccess=no
harden-symlinks-patch=yes

#Possible values - 5.1, 5.5
mysql=5.5
mysql_inst=no
mysql_backup=yes
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups

#Web applications
phpmyadmin=yes
squirrelmail=yes
roundcube=yes

#Mail options
exim=yes
eximconf=yes
clamav=yes
spamassassin=yes
dovecot=yes

#Statistics
awstats=no
webalizer=yes

#FTP options - possible values: proftpd, pureftpd
ftpd=proftpd

#Jailed shell
jail=no

#Autoconf/automake/libtool options
autoconf=yes
automake=yes
libtool=yes
curl=yes

#new version of zlib and libxml2 (experts only)
zlib=yes
new_zlib=yes
new_xml2=yes
new_pcre=yes

#Custombuild options
custombuild=2.0
autover=no
bold=yes
clean=yes
cleanapache=no
clean_old_tarballs=yes
clean_old_webapps=yes
downloadserver=files6.directadmin.com

#Cron settings
cron=yes
cron_frequency=daily
email= ********************
notifications=yes
da_autoupdate=no
updates=no
webapps_updates=yes

#Cloudlinux settings
cloudlinux=no
redirect_host=************************
redirect_host_https=no
php_timezone=EET
old_apr_util=no

P.S. There were some problems installing ioncube initially. After doing "./build all d" for a second time it did compile.
 
Last edited:
Looks like you're correct. I did not know that. Too bad. That's big.

Not much different in philosophy than the CGI variants - suPHP for example or mod_cgi+suEXEC... You only miss the APC and other accelerators with the CGI... Actually I don't feel quite good to have the main Apache process working as root user.
 
Last edited:
Not much different in philosophy than the CGI variants - suPHP for example or mod_cgi+suEXEC... You only miss the APC and other accelerators with the CGI... Actually I don't feel quite good to have the main Apache process working as root user.
I've been there and don't want to go back. mod_ruid2 is something I had been looking forward to.
 
Runs fine here!
Your feedback timing is prefect. Apache 2.4 is one of the necessary pieces to solve a Wordpress security issue that just reared its ugly head on one of my servers. I'm currently running 2.2 and no mod_ruid2.
 
Your feedback timing is prefect. Apache 2.4 is one of the necessary pieces to solve a Wordpress security issue that just reared its ugly head on one of my servers. I'm currently running 2.2 and no mod_ruid2.

running 2.4.6 installed with custombuild 2.0 rc 6 good luck and keep me posted
 
running 2.4.6 installed with custombuild 2.0 rc 6 good luck and keep me posted
There is another little gem I needed. As you probably know, mod_ruid2 is only set up for Custombuild 2.0. So apparently Custombuild 2.0 is working for you. Question: Do you happen to be running mod_ruid2 also?
 
There is another little gem I needed. As you probably know, mod_ruid2 is only set up for Custombuild 2.0. So apparently Custombuild 2.0 is working for you. Question: Do you happen to be running mod_ruid2 also?

No, not using mod_ruid2 on my server, good luck
 
Help

I'm using Freebsd 9.3. I installed everything above.
My installation hangs in here:
Making all in include
Making all in curl
make all-am
Making all in scripts
/usr/bin/perl > _curl

No errors no nothing. Is there a way I can tail what happens in there?
 
Back
Top