Apache Directives for SUBDIRECTORY

Discussion in 'Installation/Configuration' started by mzerbe, Jul 10, 2010.

  1. mzerbe

    mzerbe New Member

    Apache Directives for SUBDIRECTORY (php_admin_flag) shows no effect.

    Hi all, I have a strange problem since yesterday:

    I need to set register_globals on for a subdirectory of the web (not the complete web).

    The web has following settings;
    Auto Subdomain www
    SSL: on
    PHP: Mod-PHP

    (No CGI, SUPHP, nothing )

    I added following into the Options tab: (Nothing else, only this!)
    Code:
    <Directory /var/www/clients/clientX/webY/web/SUBDIRECTORY>
    RewriteEngine On
    php_admin_flag register_globals on
    </Directory>
    
    I also renamed the .htaccess in the SUBDIRECTORY to _htaccess to avoid any interference.

    I also tried php_admin_flag register_globals on as well as
    php_flag register_globals on
    no success.

    If I check the value with phpinfo.php register_globals Off is displayed

    Where is the problem, what do I (most likely) not see???

    Tried now also the following:
    Code:
    <Directory /var/www/clients/clientX/webY/web/SUBDIRECTORY>
    RewriteEngine On
    <IfModule mod_php5.c>
    php_admin_flag register_globals On
    </IfModule>
    <IfModule mod_php4.c>
    php_admin_flag register_globals On
    </IfModule>
    </Directory>
    
    and afterwards, as dome after each change: /var/www/clients/clientX/webY/web/SUBDIRECTORY
    But the value does not change, "Local Value" AND "Master Value" are shown in phpinfo() with register_globals Off Off
     
    Last edited: Jul 10, 2010
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which php mode do you use? Settings like php_admin_flag .... or php_admin_value .... are functions of mod_php and will not work with any other PHP mode.
     
  3. mzerbe

    mzerbe New Member

    Apache Directives for SUBDIRECTORY (php_admin_flag) shows no effect.

    Hi Till,

    thanks for the reply, that is exactly the reason why I opened the threat.

    As mentioned in first posting, I am using mod_php and the directives are not working.

    I looked also in error log, but nothing there except few lines from a "Chinese visitor"
    Code:
    [Sun Jul 11 22:14:07 2010] [error] [client 58.218.204.110] script '/usr/local/ispconfig/interface/web/proxyheader.php' not found or unable to stat
    
    And following PHP problem, but I guess that is not related ....
    ( I installed a couple of wrong modules few weeks ago, but removed them seconds later, as I realized that I was in the wrong terminal window. Those has caused that message, but xcache.so does not exist on the server anymore)
    Code:
    Failed loading /usr/lib/php5/20060613/xcache.so:  /usr/lib/php5/20060613/xcache.so: cannot open shared object file: No such file or directory
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Is Xcache still enabled in your PHP configuration?
     
  5. mzerbe

    mzerbe New Member

    Hello Falko,

    thanks for that hint yes it was,
    so I disabled that in /etc/php5/apache2/conf.d/xcache.ini

    Code:
    less xcache.ini
    # configuration for php Xcache module
    
    [xcache-common]
    ;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
    ; zend_extension = /usr/lib/php5/20060613/xcache.so
    
    
    and restarted apache2

    But that had no influence on the parameter setting

    The output of php -m gives me now following.

    Code:
    /etc/php5/apache2/conf.d# php -m
    [PHP Modules]
    bcmath
    bz2
    calendar
    ctype
    curl
    date
    dba
    dom
    exif
    fileinfo
    filter
    ftp
    gd
    gettext
    hash
    iconv
    imagick
    imap
    json
    libxml
    lzf
    mbstring
    mcrypt
    mime_magic
    mysql
    mysqli
    ncurses
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    posix
    Reflection
    session
    shmop
    SimpleXML
    soap
    sockets
    SPL
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    tokenizer
    wddx
    xml
    xmlreader
    xmlwriter
    xsl
    zip
    zlib
    
    [Zend Modules]
    
    
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the line "Server API" from the phpinfo output of this website. Additionally, take a look into the vhost file for this website in /etc/apache2/sites-enabled to check if the lines that you had added on the options tab had been written into the vhost file.
     
  7. mzerbe

    mzerbe New Member

    Hi Till,

    Server API Apache 2.0 Handler

    Everything else was written into der meinedomain.vhost just before the </VirtualHost> tag.

    Code:
    <Directory /var/www/clients/client1/web3/web/admin>
    RewriteEngine On
    <IfModule mod_php5.c>
    php_admin_flag register_globals On
    </IfModule>
    <IfModule mod_php4.c>
    php_admin_flag register_globals On
    </IfModule>
    </Directory>
    
    </VirtualHost>
    
     
    Last edited: Jul 15, 2010
  8. falko

    falko Super Moderator ISPConfig Developer

    Please try
    Code:
    php_flag register_globals on
    instead of
    Code:
    php_admin_flag register_globals On
     
  9. mzerbe

    mzerbe New Member

    Hi Falco,

    unfortunately no effect,...

    However I made a second test and put:
    Code:
    php_admin_flag register_globals On
    in front of the statement, and php_admin_flag register_globals On was set immediately.

    So it must have something to do with the restriction to the sub directory.

    Code:
    <Directory /var/www/clients/client1/web3/web/admin>
    ...
    </Directory>
    
    But why is that not working - I am puzzled.
    Please find below the complete vhostfile (normalized to example.com, and IP changed to 000.000.000.000)

    Code:
    <Directory /var/www/example.com>
        AllowOverride None
        Order Deny,Allow
        Deny from all
    </Directory>
    
    <VirtualHost 000.000.000.000:80>
          DocumentRoot /var/www/example.com/web
    
        ServerName example.com
        ServerAlias www.example.com
        ServerAdmin [email protected]
    
        ErrorLog /var/log/ispconfig/httpd/example.com/error.log
    
        ErrorDocument 400 /error/400.html
        ErrorDocument 401 /error/401.html
        ErrorDocument 403 /error/403.html
        ErrorDocument 404 /error/404.html
        ErrorDocument 405 /error/405.html
        ErrorDocument 500 /error/500.html
        ErrorDocument 503 /error/503.html
    
        <Directory /var/www/example.com/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
        <Directory /var/www/clients/client1/web3/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    
        # Clear PHP settings of this website
        <FilesMatch "\.ph(p3?|tml)$">
            SetHandler None
        </FilesMatch>
        # mod_php enabled
        AddType application/x-httpd-php .php .php3 .php4 .php5
        php_admin_value sendmail_path "/usr/sbin/sendmail -t -i [email protected]"
        php_admin_value upload_tmp_dir /var/www/clients/client1/web3/tmp
        php_admin_value session.save_path /var/www/clients/client1/web3/tmp
        php_admin_value open_basedir /var/www/clients/client[client_id]/web3/web:/var/www/clients/client[client_id]/web3/tmp:/var/www/example.com/web:/srv/www/example.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/usr/bin/convert
    
        # add support for apache mpm_itk
        <IfModule mpm_itk_module>
          AssignUserId web3 client1
        </IfModule>
    
    <Directory /var/www/clients/client1/web3/web/admin>
    RewriteEngine On
    <IfModule mod_php5.c>
    php_flag register_globals on
    </IfModule>
    <IfModule mod_php4.c>
    php_flag register_globals on
    </IfModule>
    </Directory>
    
    </VirtualHost>
    
     
  10. falko

    falko Super Moderator ISPConfig Developer

    Can you try
    Code:
    <Directory /var/www/example.com/web/admin>
    instead of
    Code:
    <Directory /var/www/clients/client1/web3/web/admin>
    ?
     
  11. mzerbe

    mzerbe New Member

    Hello Falko,

    thanks a lot, using the domain name in the path solved the problem.
    example.com shows register_globals Off Off
    example.com/subdir shows register_globals On Off
    in phpinfo()


    PS: I checked the symbolic link example.com and it points to the correct location.

    However, its working now, thanks alot!
     

Share This Page