[BlueOnyx:20779] Re: positoin of Include /etc/httpd/conf/vhosts/sitex.include in Include /etc/httpd/conf/vhosts/sitex file

Michael Stauber mstauber at blueonyx.it
Sat Mar 4 18:01:27 -05 2017


Hi Dirk,

> can you please move the position of 
> Include /etc/httpd/conf/vhosts/sitex.include
> To the end (last line before </VirtualHost>).
> Otherwise custom php_admin_flag and php_admin_value will be 
> overwritten if there are also existing in the conf file.

Sorry, I cannot do that. Moving the siteX.include line to the bottom
would break expectation and certain existing (valid) configurations that
are in active usage. So I would rather not like to touch this one, Dirk.

But I think I get why you want it and there is a better way for this
that's already implemented.

Do you need custom PHP flags that conflict with GUI provided ones? Well,
the only flags that we do have there are usually these:

php_admin_flag register_globals Off
php_admin_flag allow_url_fopen Off
php_admin_flag allow_url_include Off
php_admin_value open_basedir [...]
php_admin_value post_max_size 8M
php_admin_value upload_max_filesize 5M
php_admin_value max_execution_time 30
php_admin_value max_input_time 90
php_admin_value max_input_vars 1000
php_admin_value memory_limit 72M
php_admin_flag mail.add_x_header On
php_admin_value sendmail_path /usr/sausalito/sbin/phpsendmail
php_admin_value auto_prepend_file [...]

All of these can be configured via the GUI. Except for:

- register_globals
- mail.add_x_header
- sendmail_path
- auto_prepend_file

So unless you're messing with these you shouldn't have the need to stuff
them into the siteX.include file as you can edit these settings via the
GUI anyway.

But assuming you do need to replace those? Well, put them under
/home/sites/<FQDN>/php.d/<filename>.ini in the same format that they
should appear in the Apache config file of that Vsite.

The Handlers that create the siteX file will check the above directory
of that Vsite and will parse *.ini files it finds. Those will then get
added into the Vsite's siteX Apache config file. Right below the other
PHP flags.

It then looks like this:

# BEGIN PHP SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
php_admin_flag register_globals Off
php_admin_flag allow_url_fopen Off
php_admin_flag allow_url_include Off
php_admin_value open_basedir [...]
php_admin_value post_max_size 8M
php_admin_value upload_max_filesize 5M
php_admin_value max_execution_time 30
php_admin_value max_input_time 90
php_admin_value max_input_vars 1000
php_admin_value memory_limit 72M
php_admin_flag mail.add_x_header On
php_admin_value sendmail_path /usr/sausalito/sbin/phpsendmail
php_admin_value auto_prepend_file [...]
# From /home/.sites/28/site1/php.d/:
php_flag display_errors Off
php_flag log_errors On
php_flag zlib.output_compression Off
php_flag magic_quotes_gpc Off
php_flag magic_quotes_runtime Off

We do have certain WebApps that need special PHP settings and for that
they also use the Vsite's php.d directory to put those into effect.

This makes it easier for us to remove no longer needed WebApp related
PHP flags if a WebApp gets undeployed from a Vsite.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list