Access directory above DocumentRoot

Discussion in 'Apache' started by rcdi, Aug 26, 2008.

  1. #1
    I need to access a directory above my documentroot directory. DocumentRoot is

    /var/www/vhosts/domain.com/httpdocs/www

    I tried adding the following httpd.conf command in my file:

    <Directory "/var/www/vhosts/domain.com/httpdocs/content">
    Order allow,deny
    Allow from all
    </Directory>

    in the virtual config for domain.com and restarted the web server, but that did not give me access. I can run the below test file from shell and it finds the file and says okay.


    $id = "12705";

    $im = "/var/www/vhosts/domain.com/httpdocs/content/photos/" . $id . "/" . $id . "_100.jpg";

    if (file_exists("$im")) {
    echo "file okay<br>";
    } else {
    echo "nope<br>";
    }

    ?>

    This does not work and says 'nope' when running via browser but does work when run from the shell.

    Figure it is simple, but can someone help?
     
    rcdi, Aug 26, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Try Aliases (or ScriptAlias)

    Jay
     
    jayshah, Aug 26, 2008 IP
  3. stoneshine

    stoneshine Banned

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    how to do, please.
     
    stoneshine, Aug 28, 2008 IP