interfasys
Verified User
I'ts minor, but I think this block code should be rewritten, because php_admin_value in a virtualhost has no effect on PHP-FPM.
But it highlights a bigger problem with the templates which are getting too long winded because of the lack of nesting if statements.
How about keeping all the templates separate and having DA pick the right ones to generate the virtualhost?
There would be a common file with all the variables
and then a php-fpm.vhost.conf
same for the rest of the templates: php-cli.vhost.conf, etc.
Code:
|*if HAVE_SAFE_MODE="1"|
php_admin_flag safe_mode |SAFE_MODE|
|*endif|
|*if CLI="1"|
php_admin_flag engine |PHP|
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |PHP_EMAIL|'
|CLI_PHP_MAIL_LOG|
|*endif|
|*if OPEN_BASEDIR="ON"|
php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
But it highlights a bigger problem with the templates which are getting too long winded because of the lack of nesting if statements.
How about keeping all the templates separate and having DA pick the right ones to generate the virtualhost?
There would be a common file with all the variables
Code:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OBDP1=|
|*if PHP1_RELEASE!="0.000000"|
|?OBDP1=:/usr/local/php`PHP1_RELEASE`/lib/php/|
|*endif|
|?OBDP2=|
|*if PHP2_RELEASE!="0.000000"|
|?OBDP2=:/usr/local/php`PHP2_RELEASE`/lib/php/|
|*endif|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/`OBDP1``OBDP2`|
|?FASTCGI_OPENBASEDIR=|
|*if OPEN_BASEDIR_ENABLED="ON"|
|?FASTCGI_OPENBASEDIR=-d open_basedir="`OPEN_BASEDIR_PATH`"|
|*endif|
|?PHP_MAIL_LOG=|
|?CLI_PHP_MAIL_LOG=|
|*if PHP_MAIL_LOG_ENABLED="1"|
|?PHP_MAIL_LOG=-d mail.log="`HOME`/.php/php-mail.log"|
|?CLI_PHP_MAIL_LOG=php_admin_value mail.log `HOME`/.php/php-mail.log|
|*endif|
|?PHP_EMAIL=`USER`@`DOMAIN`|
|?FASTCGI_SENDMAIL_FROM=-d sendmail_from="`PHP_EMAIL`"|
|?ALLOW_OVERRIDE=AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,Includes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None|
and then a php-fpm.vhost.conf
Code:
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
|CUSTOM|
ServerName www.|DOMAIN|
ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
ServerAdmin |ADMIN|
DocumentRoot |DOCROOT|
|USECANONICALNAME|
CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
|*if SUSPENDED_REASON|
<IfModule mod_env.c>
SetEnv reason |SUSPENDED_REASON|
</IfModule>
|*endif|
|*if HAVE_PHP1_FPM="1"|
<FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
AddHandler "proxy:fcgi://php-fpm|PHP1_RELEASE|.|USER|/" .inc .php .phtml .php|PHP1_RELEASE|
</FilesMatch>
|*endif|
|*if HAVE_PHP2_FPM="1"|
<FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
AddHandler "proxy:fcgi://php-fpm|PHP2_RELEASE|.|USER|/" .php|PHP2_RELEASE|
</FilesMatch>
|*endif|
|HANDLERS|
|MIMETYPES|
</VirtualHost>
same for the rest of the templates: php-cli.vhost.conf, etc.
Last edited: