Apache Style Configurations

Discussion in 'General' started by zoom, Jul 11, 2008.

  1. zoom

    zoom Member

    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
  2. mistwang

    mistwang LiteSpeed Staff

    We will make $VH_ROOT, $VH_DOMAIN, $DOC_ROOT work in next release.
  3. zoom

    zoom Member

    Thanks mistwang!
  4. zoom

    zoom Member

    Seems this ability got removed from 3.3.18. I can not longer use the variable $VH_ROOT in the Apache Style Configurations.
  5. mistwang

    mistwang LiteSpeed Staff

    It should not be.
    Which version you upgrade from? Tried switch back?
  6. zoom

    zoom Member

    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
  7. mistwang

    mistwang LiteSpeed Staff

    Does it mean $VH_ROOT never worked? We need to know which version works if there is so we can track the code changes.
  8. zoom

    zoom Member

    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.
  9. mistwang

    mistwang LiteSpeed Staff

    Where do you use the variable for? server level, vhost level, vhost template.

    We tested vhost template, seems work well.
  10. zoom

    zoom Member

    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.
  11. mistwang

    mistwang LiteSpeed Staff

    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?
  12. zoom

    zoom Member

    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
  13. mistwang

    mistwang LiteSpeed Staff

    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
  14. zoom

    zoom Member

    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.

Share This Page