Jump to content

[SOLVED] Authorization in the httpd.conf file


T-Bird

Recommended Posts

For starters the authz_host module is turned on and there are no .htaccess files overwriting my httpd.conf file.  This is my first time editing the httpd.conf file, so I'm probably just putting my directive in the wrong place.

 

At any rate in my last topic I learned how to allow only local traffic to a directory, but as I was reading some Apache documention I noted that they recommend actually avoiding .htaccess files and putting authorization directives in the main server configuration file when you have access to them and when the directives wont be changing much.  Both of these fit my case.

 

That said, just as a test, I opened httpd.conf and placed the following code at the end of the file

 

<Directory />
    Order Deny,Allow
    Deny from 192.168.1
</Directory>

 

From another computer on the network (IP of 192.168.1.103) I was still able to access all the server's pages.

 

What did I do wrong?  Did I put something in the wrong place?  Did I miss a step? ???

Link to comment
Share on other sites

WAMPServer just wraps around Apache and what not, so that shouldn't matter.

That's what I thought, but I figured I should throw it out there before anyone went chasing geese.

 

Would anything else later in the httpd.conf or other included files override that setting?

 

I put the code from my first post as the last lines in the httpd.conf file.  And I didn't notice any <Location> tags which, if I read correctly, are applied after Directory.  I scoured from my root directory up and didn't see any .htaccess files either.

 

Oh, and you restarted Apache, right?

Yes.

 

There must be something simple I'm doing wrong... probably a silly typo... but I'm just missing it.  Do I have to put that block of code in a specific area?  Or can I just append it to the end like I did?

Link to comment
Share on other sites

Hmmm.  I thought using no directory "<Directory />" would do a blanket of the whole server.  Apparently not.  As soon as I changed the above to <Directory "c:/wamp/www"> it worked perfect.

 

At any rate it works now.  Thanks for all the help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.