1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

open_basedir Still not working

Discussion in 'Plesk for Linux - 8.x and Older' started by webignite, Aug 29, 2006.

  1. webignite

    webignite Guest

    0
     
    I've tried every way of doing it listed on the boards. I have a PSA 7.01 using the vhost_ssl.conf setup and works without a hitch. I copied the settings over, and checked the full paths, but still no go. When I check phpinfo() it's not using my custom settings at all. It's using the default domain.com/httpsdocs:/tmp

    Here's my error:

    Warning: Unknown(): open_basedir restriction in effect. File(/usr/local/psa/home/vhosts/domain.com/httpdocs/index.php) is not within the allowed path(s): (/usr/local/psa/home/vhosts/securedomain.com/httpsdocs:/tmp) in Unknown on line 0

    Warning: Unknown(/usr/local/psa/home/vhosts/domain.com/httpdocs/index.php): failed to open stream: Operation not permitted in Unknown on line 0

    Warning: (null)(): Failed opening '/usr/local/psa/home/vhosts/domain.com/httpdocs/index.php' for inclusion (include_path='.:/usr/local/psa/apache/share/pear') in Unknown on line 0

    Here's my vhost_ssl.conf file:

    <Directory /usr/local/psa/home/vhosts/securedomain.com/httpsdocs:/tmp:/usr/local/psa/home/vhosts/domain.com/httpdocs/:/tmp>
    php_admin_value open_basedir none
    </Directory>


    Been at this all day... any help would be appreciated.

    And yes I've run all the restart commands etc, even down to restarting psa.
     
  2. jwdick

    jwdick Guest

    0
     
    The file that has the error is in "httpdocs". Therefore you do have a vhost.conf file in addition to the vhost_ssl.conf file, right?
     
  3. webignite

    webignite Guest

    0
     
    I do not have a vhost.conf file. I have an httpd.include and vhost_ssl.conf
     
  4. jwdick

    jwdick Guest

    0
     
    try creating the vhost.conf file:

    <Directory /var/www/vhosts/domainname.com/httpdocs/>
    php_admin_value open_basedir none
    </Directory>

    Your vhost_ssl.conf file should be:
    <Directory /var/www/vhosts/domainname.com/httpsdocs/>
    php_admin_value open_basedir none
    </Directory>

    make sure to run /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domainname.com
     
  5. webignite

    webignite Guest

    0
     
    Nadda, same error.
     
  6. webignite

    webignite Guest

    0
     
    No matter what I change, my phpinfo() shows the "Local Value" of /usr/local/psa/home/vhosts/securedomain.com/httpsdocs:/tmp

    and the "Master Value" of 'no value'
     
  7. jwdick

    jwdick Guest

    0
     
    I noticed the path in your vhost_ssl file:

    <Directory /usr/local/psa/home/vhosts/securedomain.com/httpsdocs :/tmp:/usr/local/psa/home/vhosts/domain.com/httpdocs/:/tmp>
    php_admin_value open_basedir none
    </Directory>


    Is the path that is bolded correct? Plus, the rest should not be in this part of the statement.

    I am also confused about the domain name. One place you refer to domain.com then in another, securedomain.com. It should only be "domain.com".
     
  8. webignite

    webignite Guest

    0
     
    Basically it's a shared SSL. The cert is on securedomain.com

    So I point all secure requests coming from domain.com to https://securedomain.com/domain.com

    the domain.com in the url is a directory within securedomain.com httpsdocs dir which is symlinked to domain.com's httpdocs directory.

    Complicated to explain.

    So basically calling a secure page from domain.com the URL changes and reads https://www.securedomain.com/domain.com/securepage.html

    domain.com is a symlink inside the httpsdocs folder back to the httpdocs folder on domain.com

    Hope that makes sense?
     
  9. jwdick

    jwdick Guest

    0
     
    Ok,

    so the original "allowed path" is in
    (/usr/local/psa/home/vhosts/securedomain.com/httpsdocs:/tmp)

    and a script from domain.com/index.php is doing the processing.

    The vhost_ssl.conf and vhost.conf files need to be in the securedomain.com/conf folder where the httpd.include file is located.

    The two files should look like this "using your path" ( from your setup, I don't think you need the vhost.conf file, but given the trouble you are having, I would leave it in at first to eliminate it as a problem until you get it worked out.)

    vhost.conf:
    <Directory your path here/securedomain.com/httpdocs/>
    php_admin_value open_basedir none
    </Directory>

    vhost_ssl.conf:
    <Directory your path here/securedomain.com/httpsdocs/>
    php_admin_value open_basedir none
    </Directory>
     
  10. webignite

    webignite Guest

    0
     
    Ok, All set and still seeing the same problem.

    Also... I checked my apache start stuff, here's something odd:

    ./apachectl -t
    Syntax error on line 2 of /usr/local/psa/home/vhosts/securedomain.com/conf/vhost.conf:
    Invalid command 'php_admin_value', perhaps mis-spelled or defined by a module not included in the server configuration
     
  11. jwdick

    jwdick Guest

    0
     
    That is extremely odd.

    Ok, try this, instead of setting the php_admin_value to none, set it to the base folder:

    php_admin_value open_basedir "/your path here/securedomain.com/httpsdocs:/"

    (with the quotes included in the statement)
    I have done this before to correct a problem I had with open_basedir
     
  12. webignite

    webignite Guest

    0
     
    It's decided to randomly start working with the following:

    vhost.conf:

    <Directory /usr/local/psa/home/vhosts/securedomain.com/httpdocs/>
    php_admin_value open_basedir none
    </Directory>

    vhost_ssl.conf:

    <Directory /usr/local/psa/home/vhosts/securedomain.com/httpsdocs/>
    php_admin_value open_basedir none
    </Directory>

    Apache is still complaining about:

    Invalid command 'php_admin_value', perhaps mis-spelled or defined by a module not included in the server configuration


    I've no idea why it would though. I've got some more domains to setup on this tomorrow so I'll see how they go.

    I appreciate the help. If you can come up with a reason it would be complaining about that error though, let me know, it does it for every domain that I have anything set in the vhost.conf or vhost_ssl.conf files.
     
  13. jwdick

    jwdick Guest

    0
     
    Glad it's working for you. open_basedir problem are a bear to correct. I'll see what I can find out about the error.
     
  14. Whistler

    Whistler Guest

    0
     
    If you start using the this notation in the conf file - Apache shouldn't complain :)

    Ie.

    Code:
    <Directory /usr/local/psa/home/vhosts/securedomain.com/httpdocs/>
      <IfModule mod_php4.c>
        php_admin_value open_basedir none
        php_admin_flag safe_mode off
      </IfModule>
    </Directory>
    
    etc.

    This is for PHP4 - if you're using PHP5 you change it to:

    <IfModule mod_php5.c>
     
Loading...