Apache Style Configurations

zoom

Well-Known Member
#1
When overriding php directives in LiteSpeed under "Apache Style Configurations" for a vhost template which server variables are available to reference?

Doing this works:
php_admin_value error_log /www/$VH_NAME/logs/php_errors.log

Doing this doesn't work
php_admin_value error_log /www/$VH_ROOT/logs/php_errors.log
 

zoom

Well-Known Member
#4
Seems this ability got removed from 3.3.18. I can not longer use the variable $VH_ROOT in the Apache Style Configurations.
 

zoom

Well-Known Member
#6
Mistwang,

I've tried all the way back to 3.3.16 when I first reported it. The following fails to work correctly.

php_admin_value open_basedir /usr/share/pear:/www/$VH_ROOT:/tmp
php_admin_value error_log /www/$VH_ROOT/logs/php_errors.log

However, if I replace $VH_ROOT with $VH_NAME it seems fine.

The value of $VH_ROOT would be for example: /www/home.com
 

zoom

Well-Known Member
#8
mistwang,

When I made the request I was running 3.3.15. Prior to the official release of 3.3.16 I was able to download 3.3.16 and upgrade. I was sure this version (3.3.16) was patched to allow $VH_ROOT var within the Apache Style Configuration.
 

zoom

Well-Known Member
#10
mistwang,

I'm using the variable at the vhost template level. The value for $VH_ROOT at the template level is /www/$VH_NAME. Then I have the following Apache Style Configurations for the VHOST template.

php_admin_value open_basedir /usr/share/pear:/www/$VH_ROOT:/tmp
php_admin_value error_log /www/$VH_ROOT/logs/php_errors.log
php_admin_value log_errors On

This causes the site to report the following error:

Fatal error: Unknown: Failed opening required '/www/testsite.com/www/index.php' (include_path='.:/usr/share/pear') in Unknown on line 0


Changing the value to $VH_NAME for the "Apache Style Configurations" works.
 

mistwang

LiteSpeed Staff
#11
We tried similar configuration at vhost template level, still works.

I think the problem is that, for some reason the "open_basedir" configuration has not been applied at all, not that $VH_ROOT does not get expanded.

How about the $VH_ROOT in "error_log" configuration?
 

zoom

Well-Known Member
#12
mistwang,

Same deal for the error_log. I created a test php file with a parse error which is displayed when I access the script. However. I don't get a php_errors.log file. Based on the following admin values it should have created the file.

php_admin_value error_log /www/$VH_ROOT/logs/php_errors.log
php_admin_value log_errors On
 

mistwang

LiteSpeed Staff
#13
Since "$VH_ROOT" is "/www/$VH_NAME", should not
php_admin_value error_log /www/$VH_ROOT/logs/php_errors.log

be

php_admin_value error_log $VH_ROOT/logs/php_errors.log

?

If the directory /www/www/$VH_NAME/logs/php_errors.log does not exist, the log file will not be created.

You can verify the value with phpinfo() page
 

zoom

Well-Known Member
#14
mistwang,

You are correct! I completely missed the fact the $VH_ROOT contained the /www portion. Therefore the template would have been trying to create the file in directory /www/www which doesn't exist. Thanks for spotting it! It's amazing how something so simple can be easily missed.
 
Top