Directadmin don't rebuild virtualhost template with FPM

brtkm

Verified User
Joined
Jul 17, 2014
Messages
20
Hello,

Old config:

Custombuild 1.2
Apache 2.2 + mod_ruid2
PHP 5.4

New config:

Custombuild 2.0
Apache 2.4
PHP 5.4 FPM

I did

./build update && ./build apache && ./build php n && ./build rewrite_confs and echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

Everything was OK but Apache cannot start because:

"Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the server configuration"

I see old entries in file /usr/local/directadmin/data/users/$user/httpd.conf which include "if module ruid.." and php_admin_value and _flag.. It look like that Directadmin don't rewrite this file..

When I comment entries with # Apache start but PHP don't work.

echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue command not change entries in file.

Directadmin is newest.

How I can force rewrite user httpd.conf to work with PHP-FPM?
 
No, in the past I used custom for mod_ruid2 but now I removed everything from custom directory and do rewrite
 
PS. Actually it work on CB 2.0 - Apache 2.4 + mod_ruid2 + PHP5 mod_php
 
Sure, I have mod_ruid2 actually because FPM don't work properly :(

FPM was build successfull from CB but user httpd.conf not changed.. old entreis from mod_php etc.. any entries from FPM template such as Proxy etc..
 
Last edited:
Does you have in /usr/local/directadmin/data/templates/virtual_host2.conf any reference to FPM like:

Code:
|*if HAVE_PHP1_FPM="1"|
        <FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
                AddHandler "proxy:unix:/usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .inc .php .phtml .php|PHP1_RELEASE|
        </FilesMatch>
|*endif|

|*if HAVE_PHP2_FPM="1"|
        <FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
                AddHandler "proxy:unix:/usr/local/php|PHP2_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .php|PHP2_RELEASE|
        </FilesMatch>
|*endif|

|*if HAVE_PHP1_FPM_OLD="1"|
        #Make sure you're running Apache 2.4.10 or newer.
|*endif|

|*if HAVE_PHP2_FPM_OLD="1"|
        #Make sure you're running Apache 2.4.10 or newer.
|*endif|

If no, what version of DA are you using?

Regards
 
root@srv /usr/local/directadmin/custombuild # ./build versions
Latest version of DirectAdmin: 1.47.0
Installed version of DirectAdmin: 1.47.0

root@srv /usr/local/directadmin/custombuild # cat /usr/local/directadmin/data/templates/virtual_host2.conf | grep FPM
|*if HAVE_PHP1_FPM="1"|
|*if HAVE_PHP2_FPM="1"|
|*if HAVE_PHP1_FPM_OLD="1"|
|*if HAVE_PHP2_FPM_OLD="1"|

PS. When I do echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue and /usr/local/directadmin/dataskq d I see that httpd error with restart.. When tries manually /etc/init.d/httpd restart got error "Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the server configuration". I can manually comment all lines begin php_admin and httpd restart in dataskq but user template is old.. (file modification date is actual)
 
Please let us know the output of:
Code:
ls /usr/local/directadmin/data/templates/custom
ls /usr/local/directadmin/custombuild/custom
ls /usr/local/directadmin/data/users/*/domains/*.cust_httpd
 
root@srv /usr/local/directadmin/custombuild # ls /usr/local/directadmin/data/templates/custom

root@srv /usr/local/directadmin/custombuild # ls /usr/local/directadmin/custombuild/custom
ap2 phpmyadmin

root@srv /usr/local/directadmin/custombuild # ls /usr/local/directadmin/data/users/*/domains/*.cust_httpd
/usr/local/directadmin/data/users/admin/domains/mydomain.com.cust_httpd
/usr/local/directadmin/data/users/admin/domains/blahablah.coml.cust_httpd
/usr/local/directadmin/data/users/admin/domains/asdasdadl.pl.cust_httpd

root@srv /usr/local/directadmin/custombuild # cat /usr/local/directadmin/custombuild/custom/ap2/configure.apache
#!/bin/sh
"./configure" \
"--prefix=/etc/httpd" \
"--exec-prefix=/etc/httpd" \
"--bindir=/usr/bin" \
"--sbindir=/usr/sbin" \
"--sysconfdir=/etc/httpd/conf" \
"--enable-so" \
"--enable-dav" \
"--enable-dav-fs" \
"--enable-dav-lock" \
"--enable-suexec" \
"--enable-deflate" \
"--enable-unique-id" \
"--enable-mods-static=most" \
"--with-mpm=prefork" \
"--with-suexec-caller=apache" \
"--with-suexec-docroot=/" \
"--with-suexec-gidmin=100" \
"--with-suexec-logfile=/var/log/httpd/suexec_log" \
"--with-suexec-uidmin=100" \
"--with-suexec-userdir=public_html" \
"--with-suexec-bin=/usr/sbin/suexec" \
"--with-included-apr" \
"--with-pcre=/usr/local" \
"--includedir=/usr/include/apache" \
"--libexecdir=/usr/lib/apache" \
"--datadir=/var/www" \
"--localstatedir=/var" \
"--enable-logio" \
"--enable-ssl" \
"--enable-rewrite" \
"--enable-proxy" \
"--enable-expires" \
"--with-ssl=/usr" \
"--enable-expires" \
"--enable-headers"
 
What is the content of those files:

/usr/local/directadmin/data/users/admin/domains/mydomain.com.cust_httpd
/usr/local/directadmin/data/users/admin/domains/blahablah.coml.cust_httpd
/usr/local/directadmin/data/users/admin/domains/asdasdadl.pl.cust_httpd

And the output of:
ls /usr/local/directadmin/custombuild/custom/ap2

Regards
 
3 domains have different docroot set in custom httpd in DA

ex: |?DOCROOT=/home/admin/domains/asdasdasdr.com/public_html/mobi

ls /usr/local/directadmin/custombuild/custom/ap2
configure.apache
 
I suppose or a missconfiguration of options.conf in custombuild or maybe a bug.

I suppose that smtalk should be the more relavant person to understand and fix the issue if is a custombuild bug (since he mantain it).

Just to be sure, can you paste the content of options.conf?

Regards
 
PHP settings. default_php possible values - 4 or 5, php5_ver - 5.2, 5.3 or 5.4
#default_php=5
#php5_ver=5.4
#php4_cli=no
#php4_cgi=no
#php5_cli=yes
#php5_cgi=no
#ioncube=yes

php1_release=5.4
php1_mode=mod_php
php2_release=no
php2_mode=php-fpm
zend=yes

#Possible values - recommended or dist
php_ini_type=production

#Possible values - 5.0, 5.1, 5.5
mysql=5.5
mysql_inst=yes
mysql_backup=yes
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups

#Possible values - 1.3, 2.0, 2.2 or 2.4
apache_ver=2.4
secure_htaccess=no
harden-symlinks-patch=yes
apache_mpm=auto
mod_ruid2=yes


#Web applications
phpmyadmin=yes
atmail=yes
squirrelmail=yes
roundcube=yes
uebimiau=no

#Mail options
exim=yes
eximconf=yes
clamav=no
mailman=no
spamassassin=yes
mail-header-patch=no
dovecot=yes

#Statistics
awstats=yes
webalizer=no

#FTP options
proftpd=yes
pureftpd=no

#Jailed shell (beta)
jail=no

#Autoconf/automake/libtool options
autoconf=yes
automake=yes
libtool=yes
curl=yes

#new version of zlib and libxml2 (experts only)
new_zlib=no

#CustomBuild options
custombuild=2.0
autover=no
bold=yes
clean=yes
clean_old_tarballs=no
clean_old_webapps=no
downloadserver=files.directadmin.com
cleanapache=no

#Cron settings
cron=no
cron_frequency=daily
[email protected]
notifications=yes
da_autoupdate=no
updates=no
webapps_updates=no

#CustomBuild 1.2 settings
php6_cli=no
php6_cgi=no
php_ini=no

#Cloudlinux settings
cloudlinux=no
cagefs=no
old_apr_util=no
new_xml2=no
new_suphp=no
mysql_force_compile=no
ftpd=pureftpd
pureftpd_uploadscan=no
proftpd_uploadscan=no
clamav_exim=yes
webserver=apache
redirect_host_https=no
use_hostname_for_alias=auto
php_timezone=Europe/Berlin
apache_mpm=auto
mod_ruid2=yes
harden_symlinks_patch=yes
php1_release=5.5
php2_release=no
php1_mode=mod_php
php2_mode=php-fpm
opcache=no
htscanner=no
suhosin=no
suhosin_php_uploadscan=no
x_mail_header=yes
pigeonhole=no
phpmyadmin_ver=4
webapps_inbox_prefix=no
new_pcre=no
modsecurity_uploadscan=no
litespeed_serialno=trial
modsecurity=no
modsecurity_ruleset=comodo
dovecot_conf=yes
eximconf_release=2.1
blockcracking=no
easy_spam_fighter=no
default_php=5
php5_cli=yes
php5_cgi=no
php5_ver=5.3
ioncube=no
 
Back
Top