HOWTO: Setup A New DirectAdmin Server

loopforever

Verified User
Joined
May 30, 2003
Messages
298
Location
/home/admin
This guide is no longer applicable.

Please view:
http://directadmin.com/installguide.html

For the DirectAdmin installation guide!

------------------------------------------------------------

The purpose of this HOWTO is to give DirectAdmin newbies a "to-the-point" method of getting their new server set up. With this said, let's get started setting up our server!

Just a note before we begin, you will see tags like this: [TAB], [ESC], [ENTER] in this guide. They simply mean to hit that key on your keyboard.

Additionally, this guide is for a bare-naked machine (fresh/clean install of Redhat 8), so you may skip some features listed in this guide, if you need to.

Register with RedHat Network

If you are not registered already, just type the following to do so now:

Code:
up2date --register
Fill out all the fields on-screen, and you'll be set to go in no time.

Make sure ifconfig is in your PATH

Code:
locate ifconfig

Note the path to the binary, and then type:

Code:
export PATH=$PATH:/path/to/bindir
More than likely, ifconfig will be found in /sbin.

Disable Telnet

The first thing we will do, before anything else, is disable Telnet. We are doing this because SSH exists, and Telnet is simply useless, and too insecure for us. Depending on your setup, the method for turning telnet off may vary. If you are running xinetd, all that is needed is to do the following:

Code:
vi /etc/xinetd.d/telnet [ENTER]
Find the "disabled" field and set it to "yes". Then:

Code:
[ESC] :wq [ENTER]
/etc/rc.d/init.d/xinetd reload [ENTER]
Install/Upgrade Webalizer

The DirectAdmin installation requires Webalizer to be installed. The easiest way to do this, is to go to www.rpmfind.net and find the latest version for your OS distribution. If you are using RH8, like I am, you can do the following:

Code:
up2date -u webalizer [ENTER]
Ensure GCC is Installed

Next, we will upgrade GCC. We'll want to most recent version before we install DirectAdmin:

Code:
up2date -u gcc [ENTER]
Additionally, we need pam-devel, bison, and flex. So, run these commands also:

Code:
up2date -u pam-devel [ENTER]
up2date -u bison [ENTER]
up2date -u flex [ENTER]
Ensure named Configuration Exists

We'll also need to check that named is configured properly. Type:

Code:
less /etc/named.conf [ENTER]
If it does not exist, do this:

Code:
wget [url]http://66.51.122.131/named.conf[/url] -O /etc/named.conf [ENTER]
wget [url]http://66.51.122.131/named.ca[/url] -O /var/named/named.ca [ENTER]
Install DirectAdmin

We are now ready to begin installing DirectAdmin:

Code:
mkdir /usr/local/directadmin [ENTER]
cd /usr/local/directadmin [ENTER]
Replace yourlid with your License ID and youruid with your user ID:

Code:
wget [url]https://www.directadmin.com/cgi-bin/daupdate?lid=yourlid\&uid=youruid[/url] -O /usr/local/directadmin/update.tar.gz [ENTER]
Now confirm that you've downloaded the file successfully by running:

Code:
ls -lh /usr/local/directadmin/update.tar.gz [ENTER]
The file size should be around 2.5mb. If it is not, try removing the file and downloading it again.

Next, we can untar the file and begin the installation:

Code:
tar xvzf update.tar.gz [ENTER]
cd /usr/local/directadmin/scripts [ENTER]
./getInfo.sh [ENTER]
Now check that getInfo.sh set everything up properly, by running:

Code:
cat ./setup.txt [ENTER]
If there is something you need to change, edit setup.txt to your liking. Then continue on:

Code:
./install.sh [ENTER]
 
Last edited:
That's great, it will save us a lot of time for support requests! :)

Just a few changes:
The /etc/named.conf and /var/named/named.ca files are automatically downloaded if they don't exist.

Many servers don't have bind installed, but they do have bind-utils (old version), so:
rpm -e --nodeps bind-utils
up2date -u bind

Also, I've found all places I call ifconfig and hardcoded the full path so its no longer required to add the path to your environment.

MySQL has been existant on so many servers in so many forms that the mysql installer now has to use brute force to get things done. It will ask you if it can delete the /var/lib/mysql directory, say 'y' (yes) so that any root passwords (that are usually long forgotten) will be wiped out nice and clean.. you *can* say no, but you have to be absolutely sure you have the correct root password in the setup.

Note: *** Don't use spaces in your mysql passwords!!! ***
bash interprets spaces as being the next variable so things might get messed up :)

The Installer will chug along happily... for ./install.sh

Note: the admin user will be deleted before the install (if it exists), so if it exsits, backup whatever you need :)

After the installer is done, its a good idea to make sure that your license file has downloaded properly. It's filesize should be 1298 bytes, and if you "cat license.key" you should see:
version=1.1
(a whole pile of Hex)
(binary stuff that will mess up your screen :) )

Thats how you know it worked. If you see any error messages, you can either download it manually or just send us an email... to manually get it, its very similar to getting directadmin in the first few steps:

wget https://www.directadmin.com/cgi-bin/licenseupdate?uid=UID\&lid=LID -O /usr/local/directadmin/conf/license.key

Also, always check that the databases section of DirectAdmin is working properly. If you can see a table without any databases, you know it worked. It will give an error if it can't connect when the CMD_DB page is loaded.

For almost all of the new installs that *we* do, we will install our "customapache" build script to overwrite all of the old versions of the software. Until we integrate this into the installer, it will have to be downloaded and executed seperatly... note that you don't *have* to run it, but it's highly recommended.

John
 
Very Nice :)

What about FreeBSD "HOWTO: Setup A New DirectAdmin on FreeBSD Server"?

I will be waiting for this.

Thanks mate :)
 
Hello,

Just a note about this Redhat How-To.. we now use setup.sh to Install DA and it does about 90% of the commands listed above. :) (Doesn't install gcc)

FreeBSD is basically the same, just downlaod setup.sh, chmod it to 755 and answer the questions.

John
 
56 bytes

When d/ling the update.tar.gz file I'm given a 56 byte file.

I need to re-install DA on a server which had a hdd failure.

Can someone please tell me where to d/l installation files?

Thanks!

*edit*

NM Mark to the rescue! Thanks Mark your the best!
 
Last edited:
I'm getting this error, could anybody help me with it?

cat: /etc/rc.conf: No such file or directory
./doChecks.sh: line 20: [: !=: unary operator expected
*** bison is required for compiling, please install bison ***
Installation didn't pass, halting install.
 
S4rz said:
I'm getting this error, could anybody help me with it?

cat: /etc/rc.conf: No such file or directory
./doChecks.sh: line 20: [: !=: unary operator expected
*** bison is required for compiling, please install bison ***
Installation didn't pass, halting install.
Install bison. Use yum install bison, if u have configured yum correctly.
#yum install bison

Else... check rpmfind.net

With other os'es... check Google.
 
Any updates for red hat 9?

I'm kinda new as admin, and I don't want to mess my brand new server :(
 
i dont have up2date installed on my server and cant seem to find it (FC2) so whenever i ./setup.sh i get an error message:
Cannot find /etc/sysconfig/rhn/up2date... up2date may break things.
*** g++ is required for compiling, please install g++ (up2date -u gcc-c++)***
Installation didn't pass, halting install.


please advise.
 
MIA said:
i dont have up2date installed on my server and cant seem to find it (FC2) so whenever i ./setup.sh i get an error message:
Cannot find /etc/sysconfig/rhn/up2date... up2date may break things.
*** g++ is required for compiling, please install g++ (up2date -u gcc-c++)***
Installation didn't pass, halting install.


please advise.


On Fedora there is the option YUM (nearly the same as up2date)

Installing it with yum : yum install gcc-c++


Thats should to the trick and after installing the gcc-c++ module you will be able to install directadmin.
 
Matt,

Why don't you edit your first post to point this out, instead of placing it at the end?

:)

Jeff
 
Back
Top