Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Need Help in Controlling Directory Access Apache
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Need Help in Controlling Directory Access Apache

mca295188mca295188 Member

Hello There,

I need some help in controlling access to directories

i want to block access to /var/www/a

but i want to allow access only to /var/www/a/b

Please help me...

Comments

  • varwwwvarwww Member
    edited May 2014
  • @varwww

    i want to show forbidden page when someone try to access that directory...

    let me elaborate

    i want to block access to

    /var/www/a/a
    /var/www/a/c
    /var/www/a/d
    /var/www/a/e

    but i want to allow access only to /var/www/a/b

  • @varwww

    and i want to allow all other directories on different apache port like 40

  • varwwwvarwww Member
    edited May 2014

    create a .htaccess file in /var/www/a/b with

    Options +Indexes 
    

    Make sure in /etc/apache2/sites-available/default

    AllowOverride is changed from none to All

  • @varwww

    Sir i am running web server on 2 ports for example 80 and 40

    i want to block all directories except /a/b on port 80

    and i want to allow all directories except /a/b on port 40

  • rds100rds100 Member
    edited May 2014

    And why do you want to have such lame directory structure then?

    Make directory /var/www80/ and make it the document root for the web server on port 80

    Make another directory /var/www/40/ and make it the document root for the web server on port 40.

    Problem solved.

  • varwwwvarwww Member

    @mca295188 said:
    varwww

    Sir i am running web server on 2 ports for example 80 and 40

    i want to block all directories except /a/b on port 80

    and i want to allow all directories except /a/b on port 40

    I think you should ask that in http://serverfault.com/

  • @varwww @rds100

    Thanks to both of you. Have a nice day.

Sign In or Register to comment.