How To : Setup LAMP With DirectAdmin Custombuild Script

  Linux

This is alternative to setup LAMP beside using yum as we will be using DirectAdmin custombuild which is free to use. Firstly, make sure the server is clean OS and take note that, this applicable on CentOS only. Then run the pre-povision as you can refer here.

Download the DirectAdmin custombuild and extract it.

mkdir -p /usr/local/directadmin
cd /usr/local/directadmin
wget -O custombuild.tar.gz http://files.directadmin.com/services/custombuild/2.0/custombuild.tar.gz
tar xvf custombuild.tar.gz
cd custombuild
./build

Start to install MySQL / MariaDB.

./build set mariadb 10.3
./build set mysql_inst mariadb
./build mariadb

This steps is highly important, as we gonna secure the database server. We will remove the test account, disable remote access for root and set the password for root.

mysql_secure_installation

Now we can start to install the Apache.

mkdir -p /etc/httpd/conf
mkdir -p /var/log/httpd
touch /etc/httpd/conf/ips.conf
yum install openssl openssl-devel zlib zlib-devel -y
cd /usr/local/directadmin/custombuild
./build set php1_release 7.2
./build set php1_mode mod_php
./build set secure_php yes
./build set opcache yes
./build set php_ini yes
./build set php_timezone Asia/Kuala_Lumpur
./build set http_methods GET:HEAD:POST:PUT:OPTIONS
./build set mod_ruid2 no
./build apache

During the installation, it will asking the server IP address, just enter or key in *.

Unable to detect your server IP in /etc/hosts. Please enter it:
*

Verify the Apache installation, for example we can check the process id available or not:

# pidof httpd
32545 32544 32543 32542 32541 32540

or use telnet to port 80 or 443.

# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.