Help with restricting directories on apache

Discussion in 'Apache' started by G4G4N, Jul 9, 2012.

  1. #1
    Hey everyone. This is my first post on this forum. I am basically very new to server administration, so please bear and correct me if i go wrong anyway.

    I am running an apache server that serves webpages from let's say xyz.com I am giving access to some developers to develop web apps. Each web app will be stored with some name in a subdirectory. And all such subdirectories will be placed in root directory. Now as obvious, i have to limit the code of each developer to his/her directory.

    I tried using this directive in httpd.conf (the key idea is backreferencing):

    <Directory "/home/user/www/xyz.com/^([A-Za-z0-9-]*)">
    php_admin_value open_basedir "/home/user/www/xyz.com/^\1$"
    </Directory>

    But it is not working. I am pretty sure it is some problem with the regular expression. Help me out.

    P.S.: Please tell me where if i have failed to explain my question. :)
     
    G4G4N, Jul 9, 2012 IP
  2. Ray Baron

    Ray Baron Member

    Messages:
    148
    Likes Received:
    10
    Best Answers:
    3
    Trophy Points:
    43
    #2
    I believe it is a problem with the regular expression. I'm pretty sure you can't use regular expressions in the open_basedir string.

    (I can't find a specific mention of regular expressions in the apache docs, but you can infer it from the way directory functions are discussed.)
     
    Ray Baron, Jul 10, 2012 IP