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 | ||
---|---|---|
Option | Value | Description |
php1_release | 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, no | Default version of PHP. |
php1_mode | php-fpm, fastcgi, suphp, lsphp, mod_php | Mode 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_release | 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, no | Additional version of PHP. |
php2_mode | php-fpm, fastcgi, suphp, lsphp, mod_php | Mode 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_release | 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, no | Additional version of PHP. |
php3_mode | php-fpm, fastcgi, suphp, lsphp, mod_php | Mode 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_release | 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, no | Additional version of PHP. |
php4_mode | php-fpm, fastcgi, suphp, lsphp, mod_php | Mode 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_php | yes, no | Disable dangerous PHP functions. |
php_ini | yes, no | Enables ability to update php.ini file of PHP (rewrites any customizations!). |
php_timezone | userinput | date.timezone setting in php.ini file of PHP. More Information. |
php_ini_type | production, development | Type 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_header | yes, no | mail.add_x_header setting in php.ini file of PHP. More Information. |
MySQL Settings | ||
Option | Value | Description |
mysql | 8.0 | MySQL version. |
mariadb | 10.3, 10.4 | MariaDB version. |
mysql_inst | mysql, mariadb, no | Enables management of MySQL/MariaDB using CustomBuild. |
mysql_backup | yes, no | Backups MySQL databases before the installation of MySQL/MariaDB server. |
mysql_backup_gzip | yes, no | Compress MySQL database backups. |
mysql_backup_dir | userinput | Sets full path for mysql_backup option were MySQL backups should be placed. |
mysql_force_compile | yes, no | Force compilation of MySQL/MariaDB instead of using system packages (RPM, DEB). |
WEB Server Settings | ||
Option | Value | Description |
unit | yes, no | Nginx Unit. Dynamic Application Server. ALPHA support. |
webserver | apache, nginx, nginx_apache, litespeed, openlitespeed | WWW Server. |
http_methods | userinput | Allowed HTTP methods. Enabled with rewrite_confs or webserver update. |
litespeed_serialno | userinput | Serial number of LiteSpeed Enterprise license. |
modsecurity | yes, no | ModSecurity – Web application firewall. |
modsecurity_ruleset | comodo, owasp, no | ModSecurity 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_ver | 2.4 | Apache version. |
apache_mpm | prefork, event, worker, auto | Apache 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_ruid2 | yes, no | mod_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_access | yes, no | Allows accessing contents of public_html using https://hostname/~user, if enabled. |
harden_symlinks_patch | yes, no | Patches apache to include hardened symlinks patch. |
use_hostname_for_alias | yes, no | ModSecurity – Web application firewall. |
modsecurity | yes, no, auto | Redirects WEB appplications addresses to server hostname. Useful with FastCGI mode of PHP (‘auto’ option enables it for FastCGI mode of PHP only). |
redirect_host | userinput | Hostname used for use_hostname_for_alias setting. |
redirect_host_https | yes, no | Enables SSL redirection for use_hostname_for_alias setting. |
WEB Applications Settings | ||
Option | Value | Description |
phpmyadmin | yes, no | Enables management of phpMyAdmin (Web application to manage MySQL databases) using CustomBuild. |
phpmyadmin_public | yes, 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_ver | 3, 4, 5 | Selects the version of phpMyAdmin to install. Takes effect only when phpmyadmin option is enabled. |
squirrelmail | yes, no | Enables management of SquirrelMail webmail using CustomBuild. IMPORTANT: NOT IN ACTIVE DEVELOPMENT SELECT NO |
roundcube | yes, no | Enables management of RoundCube webmail using CustomBuild. |
webapps_inbox_prefix | yes, no | Adds INBOX. prefix to all of the mailbox folders in SquirrelMail/RoundCube (like: INBOX.Sent instead of just Sent). |
ClamAV-related Settings | ||
Option | Value | Description |
clamav | yes, no | Enables management of ClamAV antivirus engine using CustomBuild. Enables ClamAV automatically in Exim configuration. |
clamav_exim | yes, no | Enables ClamAV automatically in Exim configuration together with the installation of ClamAV. |
modsecurity_uploadscan | yes, no | Scan HTTP uploaded files using ClamAV, when ModSecurity is enabled. ClamAV needs to be installed for this setting to work. |
proftpd_uploadscan | yes, no | Scan FTP uploaded files in ProFTPd using ClamAV. ClamAV needs to be installed for this setting to work. |
pureftpd_uploadscan | yes, no | Scan FTP uploaded files in Pure-FTPd using ClamAV. ClamAV needs to be installed for this setting to work. |
suhosin_php_uploadscan | yes, no | Scan 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 | ||
Option | Value | Description |
exim | yes, no | Enables management of Exim MTA (Mail Transfer Agent) using CustomBuild. |
eximconf | yes, no | Enables ability to update exim.conf and exim.pl files of Exim MTA (rewrites any customizations!). |
eximconf_release | 2.1, 4.2, 4.3, 4.4, 4.5 | Description: Sets appopriate version of exim.conf to update. |
blockcracking | yes, no | Enables BlockCracking in exim.conf for outgoing spam mitigation. Requires exim configuration version 4.3 or higher. More Information. |
easy_spam_fighter | yes, no | Enables Easy Spam Figher in exim.conf for incoming spam mitigation. Requires exim configuration version 4.3 or higher. More Information. |
spamd | rspamd, spamassassin, no | Description: Enables management of Rspamd or SpamAssassin spam filters using CustomBuild. Enables Rspamd or SpamAssassin automatically in Exim configuration. |
sa_update | no, daily, weekly, monthly | Installs 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. |
dovecot | yes, no | Enables management of Dovecot configuration files using CustomBuild. |
mail_compress | yes, no | Enables 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). |
pigeonhole | yes, no | Enables 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 | ||
Option | Value | Description |
ftpd | proftpd, pureftpd, no | FTP Server. |
Statistics Settings | ||
Option | Value | Description |
awstats | yes, no | Enables management of AWstats (generates advanced web server statistics graphically) using CustomBuild. |
webalizer | yes, no | Enables management of Webalizer (generates advanced web server statistics graphically) using CustomBuild. |
CustomBuild Settings | ||
Option | Value | Description |
custombuild | 1.1, 1.2, 2.0 | CustomBuild version to be used. WARNING: NOT RECOMMENDED TO CHANGE THE SETTING WITHOUT DEEP KNOWLEDGE ABOUT UPGRADE/DOWNGRADE OF THE CUSTOMBUILD SCRIPT. |
custombuild_plugin | yes, no | CustomBuild plugin, shown in DirectAdmin admin level. |
autover | yes, no | Updates versions.txt file (latest versions of the packages are listed there) with every execution of the CustomBuild script. |
bold | yes, no | Enables bold effect for important output in terminal. |
clean | yes, no | Cleans not needed folders in the CustomBuild directory. Folders are often left from the previous packge installations. |
cleanapache | yes, no | Removes Apache directory when the installation is finished. Takes effect only when ‘clean’ option is enabled. |
clean_old_tarballs | yes, no | Removes tarballs of old (unused) packages. |
clean_old_webapps | yes, no | Removes old WEB application folders from /var/www/html. Takes effect when any WEB application is installed/updated. |
downloadserver | files.directadmin.com | Sets 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 | ||
Option | Value | Description |
cron | yes, no | Enables cronjob for CustomBuild scheduled jobs set. |
cron_frequency | daily, weekly, monthly | Sets the execution frequency of the Cronjob (scheduled jobs). Takes effect only when the ‘cron’ option is enabled. |
userinput | ModSecurity – Web application firewall. | |
notifications | yes, no | Sets the email for notifications about the updates available. Takes effect only when ‘cron’ option is enabled. |
da_autoupdate | yes, no | Sets DirectAdmin to be updated automatically when the Cronjob is executed. Takes effect only when ‘cron’ option is enabled. |
updates | yes, no | Enables 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_update | yes, no | Enables automatic updates of all WEB applications enabled. Takes effect only when ‘cron’ option is enabled. |
CloudLinux Settings | ||
Option | Value | Description |
cloudlinux | yes, no | Enables CloudLinux support in the CustomBuild script (automatic patching using CloudLinux patches for specific components). NOTE: CLOUDLINUX NEEDS TO BE INSTALLED. |
cloudlinux_beta | yes, no | Enables BETA repository for CloudLinux packages. NOTE: CLOUDLINUX NEEDS TO BE INSTALLED. |
cagefs | yes, no | Enables 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 | ||
Option | Value | Description |
autoconf | yes, no | Enables management of Autoconf (package for generating configure scripts) using CustomBuild. |
automake | yes, no | Enables management of Automake (tool for automatically generating Makefile.in files) using CustomBuild. |
libtool | yes, no | Enables management of Libtool (generic library support script) using CustomBuild. |
curl | yes, no | Enables management of cURL (library and command-line tool for transferring data using various protocols) using CustomBuild. |
new_pcre | yes, no | Enables latest version of pcre to be compiled using CustomBuild. |
ssl_configuration | modern, intermediate, old | Auto-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 | ||
---|---|---|
Option | Value | Description |
gmp | yes, no | GMP extension for PHP. |
ioncube | yes, no | PHP loader for ionCube Secured Files. |
imap | yes, no | IMAP extension for PHP. |
opcache | yes, no | opCache opcode cacher for PHP. |
htscanner | yes, no | htscanner for Apache (allows to confige php in .htaccess files using PHP). |
imagick | yes, no | ImageMagick extension for PHP. |
phalcon | yes, no | Phalcon extension for PHP. |
snuffleupagus | yes, no | Snuffleupagus security module for php7. |
suhosin | yes, no | Suhosin advanced protection system for PHP. IMPORTANT: NOT IN ACTIVE DEVELOPMENT SELECT NO |
xmlrpc | yes, no | XMLRPC extension for PHP. |
zend | yes, no | Zend 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.
Once you have logged in, you will be presented with the DirectAdmin dashboard.
If you want to customise DirectAdmin further you can use the CustomBuild plugin by selecting the icon under Extra Features.
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.
2 Comments for How to Install DirectAdmin Control Panel with CentOS
hey man, very helpful guide. i have successfully installed my direct admin using the auto method.
do i need to follow the security guide at http://help.directadmin.com/item.php?id=247
after the installation?
also can i request a noob friendly guide for a secure wordpress woocommerce site built on directadmin personal license including how to make the site fast using Openlitespeed and other security features. you can point out links to step by step on which guides of yours to follow and create a super fast and secure server with very low maintenance.
thanks again, great help, people like you is the reason why the internet is great. cheers mate.
Hi Fahim
Thank you for your very kind words and feedback about the website.
A lot of the security guide you have linked for DirectAdmin has now been included either in the auto setup script or directly within in the DirectAdmin custombuild options dashboard. For example, #8 regarding CSF, is now automatically installed and configured with BFM using the
./setup.sh auto
option as is #2, the secure PHP option. If you used the custombuild options.conf file before installing you may have already setup some of other options when installing, such as #7 for ModSecurity. If you didn’t we would recommend having a look through the Secure and Harden Guide to see if anything was missed to ensure your server is secured.There have also been other security features added recently which are not covered in the security guide such as Jailshell and Bubblewrap. We will be adding a tutorial very soon on how to install Jailshell and Bubblewrap, watch this space.
Thank you for your suggestion regarding a WP Woocommerce guide. You’ll be pleased to know we have plans to add new tutorials that should cover this subject.
Kind Regards
VPSBasics