How to Install DirectAdmin Control Panel with CentOS

How to Install DirectAdmin Control Panel with CentOS

DirectAdmin is a proprietary web-based control panel that offers system administrators a variety of features to easily manage manage websites using GUI. DirectAdmin was originally released in 2003 and at present is compatible with a variety of different operating systems such as CentOS, Debian and FreeBSD, although we believe that the DirectAdmin development team will reduce its OS compatibility going forward in order to aid the development of the panel.

The modular setup of DirectAdmin gives a system administrator complete control over how to set up the server and what software to run. From choosing a web server based on Apache, Nginx, Apache & Nginx reserve proxy, LiteSpeed or OpenLiteSpeed to enabling PHP running mod_php, PHP-FPM, FastCGI or LSPHP, DirectAdmin puts you in control. You can find out more about the different software supported by DirectAdmin here.

In this guide we will show you how to install DirectAdmin on your CentOS 7 or CentOS 8 server either using the automatic installation with pre-configured software or using a custom installation using the options.conf file.

IMPORTANT Although DirectAdmin can be installed on a system with 1GB RAM or less, it is highly recommended that your system has at least 2GB RAM and 2GB SWAP for the installation and software compilation.

Prerequisites

Before installing DirectAdmin you will need to ensure that you only have CentOS minimal installed with no other control panels or software installed. The installation script will install all the required software automatically during the initial setup, therefore do not install services such as Apache, PHP, MySQL or FTP beforehand.

Update Server

Firstly, we need to ensure our servers operating system packages are up to date. We will do this using the systems yum package manger and set it to automatically install packages with the following command:

yum update -y

Set Server Hostname

Next you will need to ensure that the hostname is correctly set for the server. When choosing a hostname for your server you will need to ensure it is in a suitable format such as server.domain.com or host.domain.com. Do not use your main domain name as your hostname as this will cause issues with services such as e-mail and FTP. You can check your existing server name using the following command.

hostname

If you need to change the hostname, then we will use the following command.

hostnamectl set-hostname hostname.domain.com

Create Swap File

As DirectAdmin complies all software from source it is important that you have a sufficient amount of RAM available. If your server has a low amount of RAM, 2GB or less you will need to ensure you have an adequate swap file installed.

Firstly, you will need to check if the server currently has a swap file created as some providers will automatically provision there within their OS templates. You can check for a swap file use the following command.

free -m

The output should look like the example below.

[server@directadmin ~]$ free -m
              total        used        free      shared  buff/cache   available
Mem:           7982        2236         904         202        4841        5244
Swap:          1023           1        1022

As you can see in the example above you already have a preinstalled 1GB swap file. The recommended swap file size for system with less than 2GB RAM is x2 the amount of memory installed. If your server has between 2GB and 8GB, it is recommended that the swap file is the same amount as the memory installed. If your server has more than 8GB RAM the recommended swap file size is 4GB. If your installed OS template didn’t include doesn’t a swap file the output will look similar to the example below.

[server@directadmin ~]$ free -m
              total        used        free      shared  buff/cache   available
Mem:           7982        2236         904         202        4841        5244
Swap:          0           0        0

To create a new swap file or extend the size of the existing swap file you can use the following commands.

if [ "$(df -hT | grep -w xfs)" ]; then dd if=/dev/zero of=/swapfile bs=1024 count=3072k; else fallocate -l 3G /swapfile; fi
mkswap /swapfile
swapon /swapfile 
chown root:root /swapfile
chmod 0600 /swapfile
swapon -s
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
mount -a
free -m

The above command will create a 3GB swap file. If you wanted to create a different sized swap file you would need to change count=3072k to your desired size for example 1024K for 1GB, 2048K for 2GB and 4096K for 4GB. You will also need to change 3G /swapfile to your desired size for example 1GB, 2GB or 4GB.

Disable SELinux

SELinux (Security Enhanced Linux) is a Linux kernel security module that specifies rules to how processes and users interact with each other as well as how processes and users interact with files. Depending on the template used CentOS will enable SELinux and place it in enforcing mode at setup. To check the current status of SELinux you can use the following command.

sestatus

If the output says disabled, no further action is required but if the output is enabled you will need to disable it before proceeding using the following commands.

setenforce 0
sed -i 's|enforcing|disabled|g' /etc/selinux/config

The first command will disable SELinux in your current session i.e. the server is rebooted and the second command will permanently disable SELinux on CentOS even after a reboot.

Now you have prepared the server ready for the installation of DirectAdmin by updating the installed packages, set the hostname, created or extended the current Swap file and disabled SELinux. It is highly recommended to reboot the server ensuring that the kernel is updated along with any other package updates using the following command.

reboot

Install DirectAdmin

Before you begin installing DirectAdmin, you will need to ensure that all the required packages for either CentOS 7 or 8 are installed or updated using the following command. You will need to ensure you are logged into SSH as the root user.

CentOS 7

yum install -y wget tar gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio \
libcom_err-devel libcurl-devel gd zlib-devel zip unzip libcap-devel cronie bzip2 cyrus-sasl-devel perl-ExtUtils-Embed \
autoconf automake libtool which patch mailx bzip2-devel lsof glibc-headers kernel-devel expat-devel \
psmisc net-tools systemd-devel libdb-devel perl-DBI perl-Perl4-CoreLibs perl-libwww-perl xfsprogs rsyslog logrotate crontabs file kernel-headers

CentOS 8

yum install -y wget tar gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio \
libcom_err-devel libcurl-devel gd zlib-devel zip unzip libcap-devel cronie bzip2 cyrus-sasl-devel perl-ExtUtils-Embed \
autoconf automake libtool which patch mailx bzip2-devel lsof glibc-headers kernel-devel expat-devel \
psmisc net-tools systemd-devel libdb-devel perl-DBI perl-libwww-perl xfsprogs rsyslog logrotate crontabs file \
kernel-headers hostname

With the required packages installed on your server, you will now need to download the DirectAdmin installation file and change the file permissions using the following command.

wget -O setup.sh https://www.directadmin.com/setup.sh
chmod 755 setup.sh

Before you run the DirectAdmin installation script you will need to either choose automatic installation using the pre-defined software (Apache, PHP 7.3, PHP-FPM, MariaDB 10.4) or using manual installation using the options.conf file.

Automatic Installation

Using the automatic installation setup method will automatically install all the pre-defined software (Apache, PHP 7.3, PHP-FPM, MariaDB 10.4) for DirectAdmin including ConfigServer Firewall (CSF) with Brute Force Monitor integration.

Retail License

If your licence was purchased directly from DirectAdmin (Retail), log into client area and make sure that you have correctly set the Server IP, Operating System and the Hostname. If these details are incorrect, you will need to ensure they have updated before installing DirectAdmin.

With the installation script now downloaded, file permissions correctly set and licence details verified, you can execute the installation using the the following command.

./setup.sh auto

Now just sit back, relax and let the installation script complete the DirectAdmin installation automatically. Once it has finished you can move onto the next section.

Bundled License

If your licence was included from your server provider (Bundled), you will need to log into your client area and make sure that you have correctly set the Server IP, Operating System and the Hostname. If these details are incorrect, you will need to update these before installing DirectAdmin. If you are unable to change them in your client area you will need to contact your service provider.

IMPORTANT When using an internal licence from your server provider such as BuyVM, the auto confirmation will default to the information contained in the licence, such as default hostname, email address, nameservers, this will not necessarily be the hostname associated with your server. We would recommend that you set these prior to using the auto install using the .txt file option.

Before you use the installation script you will need to set up some details that you can’t change in a bundled licence such as admin email, hostname, ns1 and ns2 using the the following command.

nano /root/.email.txt
server@domain.com # Change Email Address
nano /root/.use_hostname.txt
server.domain.com # Change Hostname
nano /root/.ns1.txt
ns1.domain.com # Change NS1
nano /root/.ns2.txt
ns2.domain.com # Change NS2

With the installation script now downloaded, file permissions correctly set and licence details verified, you can execute the installation using the the following command.

./setup.sh auto

Now just sit back, relax and let the installation script complete the DirectAdmin installation automatically. Once it has finished you can move onto the next section.

Manual Installation

In most cases the automatic installation method is ideal but if you are looking for more control over the software initially installed or want to set up the DirectAdmin using options from another server then the manual installation method will enable you to do this.

Change Default Settings (Script)

If you want to install DirectAdmin but choose the software installed you can run the installer using the following command.

./setup.sh

The installation script will now ask you to enter your Client ID, Licence ID, Hostname and Network Adaptor.

[root@vpsbasics ~]# ./setup.sh
*** 64-bit OS ***

*****************************************************
*
* DirectAdmin requires certain packages, described here:
*   http://help.directadmin.com/item.php?id=354
*
* Would you like to install these required pre-install packages? (y/n): n
*
* skipping pre-install packages.
* We then assume that you've already installed them.
* If you have not, then ctrl-c and install them (or-rerun the setup.sh):
*   http://help.directadmin.com/item.php?id=354
*
*****************************************************

Please enter your Client ID : CLIENT_ID
Please enter your License ID : LICENCE_ID
Please enter your hostname (server.domain.com)
It must be a Fully Qualified Domain Name
Do *not* use a domain you plan on using for the hostname:
eg. don't use domain.com. Use server.domain.com instead.
Do not enter http:// or www

Your current hostname is: server.domain.com
Leave blank to use your current hostname

Enter your hostname (FQDN) : server.domain.com
Client ID:  CLIENT_ID
License ID: LICENCE_ID
Hostname: server.domain.com
Is this correct? (y,n) : y
Is eth0 your network adaptor with the license IP (SERVER_IP)? (y,n) : y
Your external IP: SERVER_IP
The external IP should typically match your license IP.

Is SERVER_IP the IP in your license? (y,n) : y

DirectAdmin will now be installed on: Enterprise 7.7
Is this correct? (must match license) (y,n) : y

After confirming the detail you will need to select No when asked if you want to use the default settings of apache 2.4 with mod_ruid2 and php 7.2.

Would you like the default settings of apache 2.4 with mod_ruid2 and php 7.2 cli? (y/n): n

You have chosen to customize the custombuild options.  Please wait while options configurator is downloaded...
 
Please select webserver you would like to use (apache/nginx/nginx_apache/litespeed/openlitespeed, default: apache):apache
Please select MySQL database server you would like to use (mysql/mariadb/no, default: mysql):mariadb
Please select mariadb version you would like to use (5.5/10.0/10.1/10.2/10.3/10.4, default: 10.4):10.4
Please select FTP server you would like to use (proftpd/pureftpd/no, pureftpd):pureftpd
Please select default PHP version you would like to use (5.3/5.4/5.5/5.6/7.0/7.1/7.2/7.3/7.4, default: 7.3):7.3
Please select default PHP mode you would like to use (php-fpm/fastcgi/suphp/lsphp/mod_php, default: mod_php):php-fpm
Would you like to have a second instance of PHP installed? (yes/no, default: no): yes
Please select additional PHP version you would like to use (5.3/5.4/5.5/5.6/7.0/7.1/7.2/7.3/7.4):7.4
Please select additional PHP mode you would like to use (php-fpm/fastcgi/suphp/lsphp, default: mod_php):php-fpm
Would you like to have a third instance of PHP installed? (yes/no, default: no): no
Please select if you would like to use ionCube (yes/no, default: no):yes
Please select if you would like to use opCache (yes/no, default: no):yes
Please select if you would like to use Zend Guard Loader (yes/no, default: no):yes
Please select if you would like CustomBuild to manage Exim installation (yes/no, default: yes):yes
Please select if you would like CustomBuild to manage Dovecot installation (yes/no, default: yes):yes
Please select if you would like CustomBuild to manage phpMyAdmin installation (yes/no, default: yes):yes
Please select if you would like CustomBuild to manage SquirrelMail installation (yes/no, default: no):no
Please select if you would like CustomBuild to manage RoundCube installation (yes/no, default: yes):yes
Would you like to search for the fastest download mirror? (y/n): y

Once you have choose your settings the installation script will ask if you want to search for the fastest download mirror. We would recommend that you select yes. Once confirmed the installation script will proceed with installing DirectAdmin on your CentOS server.

Now just sit back, relax and let the installation script complete the DirectAdmin installation automatically. Once it has finished you can move onto the next section.

Change Default Settings (Options)

Another option you can use to install DirectAdmin is using a preconfigured options.conf file that you may have saved from an previous DirectAdmin server set up. You will need to download the custom options.conf file from the remote server prior to running the installation script. If you don’t have a custom options.conf file setup but would like to customise the installation of DirectAdmin you can use our custom options.conf file and tweak to your needs.

With the recent release of CustomBuild2 for DirectAdmin the default location and installation of PHP extensions has changed from using the options.conf file to it own file called php_extensions.conf. If you don’t have a custom php_extensions.conf file setup but would like to customise the PHP installation you can use our custom php_extensions.conf file and tweak to your needs.

Before downloading the custom options.conf or php_extensions.conf files you will need to create a custombuild folder using the following command.

mkdir -p /usr/local/directadmin/custombuild

Our custom template will install Apache web server with hardened symlinks, with PHP 7.3 using PHP-FPM, secure PHP, MariaDB 10.4, phpMyAdmin 5, Roundcube, ClamAV, PureFTP, Exim with Blockcracker and Easy Spam Fighter, SpamAssassin with daily cron system and package updates. The PHP extension template with install imagick, ioncube, opcache and snuffleupagus.You can download our templates using the following commands.

wget -O /usr/local/directadmin/custombuild/options.conf https://www.vpsbasics.com/downloads/options.conf
wget -O /usr/local/directadmin/custombuild/php_extensions.conf https://www.vpsbasics.com/downloads/php_extensions.conf
IMPORTANT If you are using our custom options.conf templats make sure you edit the file and change redirect_host=HOSTNAME to your own hostname under the WEB Server Settings section and email=EMAIL_ADDRESS to your own email address under the Cronjob Settings.

If you are using your own custom file location can use the same commands and substitute our URL for your own.

wget -O /usr/local/directadmin/custombuild/options.conf OWN_URL
wget -O /usr/local/directadmin/custombuild/php_extensions.conf OWN_URL 

You can edit the files using the following command.

# Edit DirectAdmin Options
nano /usr/local/directadmin/custombuild/options.conf
# Edit DirectAdmin PHP Extensions
nano /usr/local/directadmin/custombuild/php_extensions.conf

In the table below you can see different settings that can be used in DirectAdmin options.conf file along with their values and a brief description.

PHP Settings
OptionValueDescription
php1_release5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, noDefault version of PHP.
php1_modephp-fpm, fastcgi, suphp, lsphp, mod_phpMode of the default PHP version. lsphp is only compatible with LiteSpeed, OpenLiteSpeed WWW servers or CloudLinux+Apache. For nginx (not as a reverse proxy for apache) php-fpm must be chosen.
php2_release5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, noAdditional version of PHP.
php2_modephp-fpm, fastcgi, suphp, lsphp, mod_phpMode of the default PHP version. lsphp is only compatible with LiteSpeed, OpenLiteSpeed WWW servers or CloudLinux+Apache. For nginx (not as a reverse proxy for apache) php-fpm must be chosen.
php3_release5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, noAdditional version of PHP.
php3_modephp-fpm, fastcgi, suphp, lsphp, mod_phpMode of the default PHP version. lsphp is only compatible with LiteSpeed, OpenLiteSpeed WWW servers or CloudLinux+Apache. For nginx (not as a reverse proxy for apache) php-fpm must be chosen.
php4_release5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, noAdditional version of PHP.
php4_modephp-fpm, fastcgi, suphp, lsphp, mod_phpMode of the default PHP version. lsphp is only compatible with LiteSpeed, OpenLiteSpeed WWW servers or CloudLinux+Apache. For nginx (not as a reverse proxy for apache) php-fpm must be chosen.
secure_phpyes, noDisable dangerous PHP functions.
php_iniyes, noEnables ability to update php.ini file of PHP (rewrites any customizations!).
php_timezoneuserinputdate.timezone setting in php.ini file of PHP. More Information.
php_ini_typeproduction, developmentType of php.ini file. php.ini-development contains settings recommended for use in development environments. php.ini-production contains settings recommended for use in production environments.
x_mail_headeryes, nomail.add_x_header setting in php.ini file of PHP. More Information.
MySQL Settings
OptionValueDescription
mysql8.0MySQL version.
mariadb10.3, 10.4MariaDB version.
mysql_instmysql, mariadb, noEnables management of MySQL/MariaDB using CustomBuild.
mysql_backupyes, noBackups MySQL databases before the installation of MySQL/MariaDB server.
mysql_backup_gzipyes, noCompress MySQL database backups.
mysql_backup_diruserinputSets full path for mysql_backup option were MySQL backups should be placed.
mysql_force_compileyes, noForce compilation of MySQL/MariaDB instead of using system packages (RPM, DEB).
WEB Server Settings
OptionValueDescription
unityes, noNginx Unit. Dynamic Application Server. ALPHA support.
webserverapache, nginx, nginx_apache, litespeed, openlitespeedWWW Server.
http_methodsuserinputAllowed HTTP methods. Enabled with rewrite_confs or webserver update.
litespeed_serialnouserinputSerial number of LiteSpeed Enterprise license.
modsecurityyes, noModSecurity – Web application firewall.
modsecurity_rulesetcomodo, owasp, noModSecurity rule set. Set to ‘no’ to use no ruleset. Set to ‘comodo’ for Comodo Rule Set and ‘owasp’ for OWASP Rule Set. Custom rules to custom/modsecurity/conf, they’d be added automatically to /etc/modsecurity.d after ‘./build modsecurity’ or ‘./build modsecurity_rules’ command. Nginx is not compatible with Comodo Rule Set.
apache_ver2.4Apache version.
apache_mpmprefork, event, worker, autoApache Multi-Processing Module. ‘auto’ mode sets MPM to be Prefork if PHP as mod_php is chosen, because this way PHP is not thread-safe. Otherwise Event MPM is set.
mod_ruid2yes, nomod_ruid2 is an Apache extension that allows requests to a domain to run as the owner of that domain, instead of the Apache user. WARNING: NOT SUPPORTED ON CENTOS 8, FREEBSD OR DEBIAN SYSTEMS.
userdir_accessyes, noAllows accessing contents of public_html using https://hostname/~user, if enabled.
harden_symlinks_patchyes, noPatches apache to include hardened symlinks patch.
use_hostname_for_aliasyes, noModSecurity – Web application firewall.
modsecurityyes, no, autoRedirects WEB appplications addresses to server hostname. Useful with FastCGI mode of PHP (‘auto’ option enables it for FastCGI mode of PHP only).
redirect_hostuserinputHostname used for use_hostname_for_alias setting.
redirect_host_httpsyes, noEnables SSL redirection for use_hostname_for_alias setting.
WEB Applications Settings
OptionValueDescription
phpmyadminyes, noEnables management of phpMyAdmin (Web application to manage MySQL databases) using CustomBuild.
phpmyadmin_publicyes, no Makes phpMyAdmin accessible over /phpMyAdmin/ for everyone, if set to ‘yes’. Setting this option to ‘no’ would make it available only from DirectAdmin (single-sign-on).
phpmyadmin_ver3, 4, 5Selects the version of phpMyAdmin to install. Takes effect only when phpmyadmin option is enabled.
squirrelmailyes, noEnables management of SquirrelMail webmail using CustomBuild. IMPORTANT: NOT IN ACTIVE DEVELOPMENT SELECT NO
roundcubeyes, noEnables management of RoundCube webmail using CustomBuild.
webapps_inbox_prefixyes, noAdds INBOX. prefix to all of the mailbox folders in SquirrelMail/RoundCube (like: INBOX.Sent instead of just Sent).
ClamAV-related Settings
OptionValueDescription
clamavyes, noEnables management of ClamAV antivirus engine using CustomBuild. Enables ClamAV automatically in Exim configuration.
clamav_eximyes, noEnables ClamAV automatically in Exim configuration together with the installation of ClamAV.
modsecurity_uploadscanyes, noScan HTTP uploaded files using ClamAV, when ModSecurity is enabled. ClamAV needs to be installed for this setting to work.
proftpd_uploadscanyes, noScan FTP uploaded files in ProFTPd using ClamAV. ClamAV needs to be installed for this setting to work.
pureftpd_uploadscanyes, noScan FTP uploaded files in Pure-FTPd using ClamAV. ClamAV needs to be installed for this setting to work.
suhosin_php_uploadscanyes, noScan PHP uploaded scripts using suhosin upload verification script and ClamAV antivirus (clamdscan). ClamAV must be installed and suhosin option should be enabled for the setting to work.
Mail Settings
OptionValueDescription
eximyes, noEnables management of Exim MTA (Mail Transfer Agent) using CustomBuild.
eximconfyes, noEnables ability to update exim.conf and exim.pl files of Exim MTA (rewrites any customizations!).
eximconf_release2.1, 4.2, 4.3, 4.4, 4.5Description: Sets appopriate version of exim.conf to update.
blockcrackingyes, noEnables BlockCracking in exim.conf for outgoing spam mitigation. Requires exim configuration version 4.3 or higher. More Information.
easy_spam_fighteryes, noEnables Easy Spam Figher in exim.conf for incoming spam mitigation. Requires exim configuration version 4.3 or higher. More Information.
spamdrspamd, spamassassin, noDescription: Enables management of Rspamd or SpamAssassin spam filters using CustomBuild. Enables Rspamd or SpamAssassin automatically in Exim configuration.
sa_updateno, daily, weekly, monthlyInstalls a cronjob for sa-update to update SpamAssassin Spam Filter Rules daily, weekly or monthly using CustomBuild. Takes effect only if SpamAssassin is enabled on the server, at the installation time of SpamAssassin, CustomBuild cronjob or ‘spamassassin_cron’ call.
dovecotyes, noEnables management of Dovecot configuration files using CustomBuild.
mail_compressyes, noEnables gzip compression for new emails (using zlib in dovecot). Compressed emails take less space (when testing, compressed mail folders took ~20% of their initial disk space). To compress old emails manual action is needed (script to automate the process: dovecot_compress.sh).
pigeonholeyes, noEnables management of Pigeonhole (enables Sieve language and the ManageSieve protocol, allows users to configure email filtering in their email clients) for Dovecot IMAP and POP3 email server using CustomBuild. When this setting is enabled, Pigeonhole is enabled with update/installation of Dovecot. RoundCube plugin to manage email filtering is enabled with update/installation of RoundCube.
FTP Settings
OptionValueDescription
ftpdproftpd, pureftpd, noFTP Server.
Statistics Settings
OptionValueDescription
awstatsyes, noEnables management of AWstats (generates advanced web server statistics graphically) using CustomBuild.
webalizeryes, noEnables management of Webalizer (generates advanced web server statistics graphically) using CustomBuild.
CustomBuild Settings
OptionValueDescription
custombuild1.1, 1.2, 2.0CustomBuild version to be used. WARNING: NOT RECOMMENDED TO CHANGE THE SETTING WITHOUT DEEP KNOWLEDGE ABOUT UPGRADE/DOWNGRADE OF THE CUSTOMBUILD SCRIPT.
custombuild_pluginyes, noCustomBuild plugin, shown in DirectAdmin admin level.
autoveryes, noUpdates versions.txt file (latest versions of the packages are listed there) with every execution of the CustomBuild script.
boldyes, noEnables bold effect for important output in terminal.
cleanyes, noCleans not needed folders in the CustomBuild directory. Folders are often left from the previous packge installations.
cleanapacheyes, noRemoves Apache directory when the installation is finished. Takes effect only when ‘clean’ option is enabled.
clean_old_tarballsyes, noRemoves tarballs of old (unused) packages.
clean_old_webappsyes, noRemoves old WEB application folders from /var/www/html. Takes effect when any WEB application is installed/updated.
downloadserverfiles.directadmin.comSets which download server to use to download files needed by the CustomBuild script. Any other server than files.directadmin.com may take 24 hours for latest files to be synced, however they may have better speeds than files.directadmin.com.
Cronjob Settings
OptionValueDescription
cronyes, noEnables cronjob for CustomBuild scheduled jobs set.
cron_frequencydaily, weekly, monthlySets the execution frequency of the Cronjob (scheduled jobs). Takes effect only when the ‘cron’ option is enabled.
emailuserinputModSecurity – Web application firewall.
notificationsyes, noSets the email for notifications about the updates available. Takes effect only when ‘cron’ option is enabled.
da_autoupdateyes, noSets DirectAdmin to be updated automatically when the Cronjob is executed. Takes effect only when ‘cron’ option is enabled.
updatesyes, noEnables automatic updates of all available to update packages managed by the CustomBuild script. Takes effect only when ‘cron’ option is enabled. WARNING: NOT RECOMMENDED IN PRODUCTION!
webapps_updateyes, noEnables automatic updates of all WEB applications enabled. Takes effect only when ‘cron’ option is enabled.
CloudLinux Settings
OptionValueDescription
cloudlinuxyes, noEnables CloudLinux support in the CustomBuild script (automatic patching using CloudLinux patches for specific components). NOTE: CLOUDLINUX NEEDS TO BE INSTALLED.
cloudlinux_betayes, noEnables BETA repository for CloudLinux packages. NOTE: CLOUDLINUX NEEDS TO BE INSTALLED.
cagefsyes, noEnables support of CageFS component by CloudLinux in the CustomBuild script (automatic updating of files in CageFS using ‘cagefsctl –force-update’). NOTE: CLOUDLINUX NEEDS TO BE INSTALLED.
Advanced Settings
OptionValueDescription
autoconfyes, noEnables management of Autoconf (package for generating configure scripts) using CustomBuild.
automakeyes, noEnables management of Automake (tool for automatically generating Makefile.in files) using CustomBuild.
libtoolyes, noEnables management of Libtool (generic library support script) using CustomBuild.
curlyes, noEnables management of cURL (library and command-line tool for transferring data using various protocols) using CustomBuild.
new_pcreyes, noEnables latest version of pcre to be compiled using CustomBuild.
ssl_configurationmodern, intermediate, oldAuto-generated SSL ciphers/protocol list used in configuration, based on https://ssl-config.mozilla.org/.

In the table below you can see different settings that can be used in DirectAdmin php_extensions.conf file along with their values and a brief description.

PHP Extensions
OptionValueDescription
gmpyes, noGMP extension for PHP.
ioncubeyes, noPHP loader for ionCube Secured Files.
imapyes, noIMAP extension for PHP.
opcacheyes, noopCache opcode cacher for PHP.
htscanneryes, nohtscanner for Apache (allows to confige php in .htaccess files using PHP).
imagickyes, noImageMagick extension for PHP.
phalconyes, noPhalcon extension for PHP.
snuffleupagusyes, noSnuffleupagus security module for php7.
suhosinyes, noSuhosin advanced protection system for PHP. IMPORTANT: NOT IN ACTIVE DEVELOPMENT SELECT NO
xmlrpcyes, noXMLRPC extension for PHP.
zendyes, noZend Guard Loader is a free runtime application that enables PHP to run the scripts encoded by Zend Guard. IMPORTANT: NOT IN ACTIVE DEVELOPMENT SELECT NO

Now you have setup custom options.conf and php_extensions.conf files you can now run the installer using the following command.

./setup.sh auto

Now just sit back, relax and let the installation script complete the DirectAdmin installation automatically.

If you make a configuration error in the options.conf file when installing DirectAdmin for example, accidentally enabling mod_ruid2 with CentOS 8. The DirectAdmin installation script will stop and show the reason in your SSH terminal.

mod_ruid2 does not support CentOS8.
PHP has been secured.
Restarting php-fpm73.
[root@vpsbasics ~]# 

Just open the options.conf file and correct the error using the following command.

nano /usr/local/directadmin/custombuild/options.conf

Once you have corrected the error simply restart the installation script using the following command.

./setup.sh auto

Once it has finished you can move onto the next section.

Complete Installation

Once the installation has finished you will be presented with the following confirmation message which includes details of your admin username, password and the address of your DirectAdmin dashboard.

To login now, follow this link:

http://SERVER_IP:2222

and enter your Admin username and password when prompted.

You should now visit http://admin.site-helper.com and http://www.directadmin.com/newinstall.html to learn how to get started.

Thank you for using DirectAdmin. Should you have any questions, don't hesitate to contact us at support@directadmin.com

## REPORT_END
Permissions set

System Security Tips:
http://help.directadmin.com/item.php?id=247
IMPORTANT If you don’t use root to log into your server via SSH, you must ensure you add your username to the /etc/ssh/sshd_config file using AllowUsers username before you reboot or logout of SSH. Failure to do so will mean you will lose root access to your server and you will have to reinstall your server from scratch.

In the scripts directory you will find the setup.txt file which details the mySQL username and password, DirectAdmin username and password along with other details such as the hostname, host email. You can view the details of this file using the following command.

cat /usr/local/directadmin/scripts/setup.txt
hostname=HOSTNAME
email=ADMIN EMAIL ADDRESS
mysql=MYSQL PASSWORD
mysqluser=MYSQL USER
adminname=ADMIN NAME
adminpass=ADMIN PASSWORD
ns1=NS1.DOMAIN.COM
ns2=NS2.DOMAIN.COM
ip=SERVER IP ADDRESS
uid=CLIENT ID
lid=LICENCE ID

DirectAdmin Dashboard

Now you can access the DirectAdmin using http://SERVER_IP:2222 and the adminname and adminpass from the setup.txt.

How to Install DirectAdmin - Login

Once you have logged in, you will be presented with the DirectAdmin dashboard.

How to Install DirectAdmin - Dashboard

If you want to customise DirectAdmin further you can use the CustomBuild plugin by selecting the icon under Extra Features.

How to Install DirectAdmin - CustomBuild
That’s it. You have now installed DirectAdmin on your CentOS 7 or CentOS 8 server using either the automatic installation method with pre-configured software or using a custom installation method using the options.conf file, accessed the DirectAdmin dashboard and customised DirectAdmin further using the CustomBuild plugin.

VPSBasics

VPSBasics

This guide was written by the VPS Basics editorial team, led by Gilberto Van Roosen. They are a unique blend of people who are dedicated to providing highly detailed, comprehensive and easy to follow tutorials, written in plain English. They specialise in tutorials for managing Linux servers, its software and WordPress.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.