Installation Instructions for LAMP setup on Centos7/AlmaLinux8

Vinion

New member
Joined
Jul 18, 2022
Messages
22
Hello,
The last three days I am trying to install DirectAdmin on Centos7 and AlmaLinux8 in order to host a simple PHP website.
The instructions given at https://docs.directadmin.com/getting-started/installation/overview.html are very simple to follow but the task is much harder than I first thought or there is something I am completely missing here

After setting up my VPS I run the following command, as the instructions suggests
yum install wget 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
I export the php_release
export php1_release=8.0
and then

DA installs correctly without any errors in a couple of minutes and then I login into DA using the http://myip:2222 url.
Everything works fine so far.

After a few minutes I see that lfd, mysqld, named and sshd services are started but httpd is Stopped and there is no mail service running on the box.
After searching the forum I found out the following solution to start Apache server, which I followed, but Apache wont start...
cd /usr/local/directadmin/custombuild
./build update
./build apache
./build rewrite_confs

The systemctl status httpd.service output is the following:
httpd.service - The Apache HTTP Server
Loaded: loaded (/etc/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-07-20 13:18:52 EEST; 32s ago
Process: 32573 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 32573 (code=exited, status=1/FAILURE)
Status: "Reading configuration..."

Jul 20 13:18:52 server-188-241-115-43.da.direct systemd[1]: Starting The Apache HTTP Server...
Jul 20 13:18:52 server-188-241-115-43.da.direct httpd[32573]: AH00526: Syntax error on line 21 of /usr/local/directadmin/data/users/admin/httpd.conf:
Jul 20 13:18:52 server-188-241-115-43.da.direct httpd[32573]: Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the ser...guration
Jul 20 13:18:52 server-188-241-115-43.da.direct systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 20 13:18:52 server-188-241-115-43.da.direct systemd[1]: Failed to start The Apache HTTP Server.
Jul 20 13:18:52 server-188-241-115-43.da.direct systemd[1]: Unit httpd.service entered failed state.
Jul 20 13:18:52 server-188-241-115-43.da.direct systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

I opened the /usr/local/directadmin/data/users/admin/httpd.conf and the content is the following
# Auto generated apache config file by DirectAdmin version 1.641
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to their website

# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=2
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3


<Directory "/home/admin/public_html">
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
#RGroups apache access
RGroups @none
</IfModule>
<IfModule mod_fcgid.c>
SuexecUserGroup admin admin
</IfModule>
php_admin_flag engine ON
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@'
php_admin_value mail.log /home/admin/.php/php-mail.log
php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/opt/alt/php80/usr/share/pear/:/dev/urandom:/usr/local/lib/php/:/usr/local/php80/lib/php/
</Directory>

At this moment I am pretty sure I will never make DA work properly on Centos or AlmaLinux. Is there any guide available on how I can install DA in order to host a Linux, Apache, MySQL and IMAP mail server on Centos7 or AlmaLinux8 ? If I change the OS to Debian or Ubuntu will things be simpler as it comes to compatibility ?

Thank you
 
If I change the OS to Debian or Ubuntu will things be simpler as it comes to compatibility ?
No. Panels are developped for RH alike systems and other distro support is added. So that would make no difference.

It seems a configuration issue to me. I see you have this error:
Invalid command 'php_admin_flag',
this often occurs when incompatible php flags are used.

Are you by any chance using mod_ruid2 in combination with php-fpm? Because that would be generating errors.

Check this thread, probably one of the commands/tips there will fix your issue.
 
@Vinion "After a few minutes..." DA install on VPS 2 core 2 ram - can take up to 45 minutes, maybe you start your actions too fast?
check custombuild log to see progress
 
Hello,
I was initially testing DirectAdmin on a single core VPS with 1GB (984Mb) RAM.
The problem I had was during PHP installation. PHP installation needs more than 1GB Ram and the installation process was "crashing".

I upgraded the VPS to 2VCPUs and 2GB RAM and I finally managed to install DirectAdmin.
Everything seems to work now.

Thank you for your help, I am currently transferring my website to my new VPS, running DirectAdmin.
 
I was initially testing DirectAdmin on a single core VPS with 1GB (984Mb) RAM.
The problem I had was during PHP installation. PHP installation needs more than 1GB Ram and the installation process was "crashing".
yes it need's 2gb ram, or at least ram+swap>=2gb
 
It's not or.... it's and. So 2 GB ram AND 2 GB swap.
yep, just checked after your reply in another thread. I always install DA on servers with 2G+ RAM and 4G+ SWAP - so never had such issue.
----
I think it would be better to add in description line like "min 3GB total RAM+SWAP"
 
Back
Top