Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've installed Ubuntu Server and Apache2.

I want to test my httpd.conf by adding following code:

<Directory />   
     Order allow,deny   
     Deny from all   
</Directory>

+apache restart

It should raise 403 error while entering website, but I can browse my index.html normally.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

These two lines should deny all IPs:

Order allow,deny
Deny from all

However, this is not the whole story. You need to place them in the right place. In Ubuntu, you need usually to edit the file /etc/apache2/sites-enabled/000-default which contains the defined vhosts.

If you have a different configuration, you can post the complete configuration to get help.

share|improve this answer
    
It works, thanks –  Djent Feb 22 '12 at 12:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.