Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using apache http server 2.4.4 for load balancing purpose along with tomcat 7.0.

I have hosted 2 applications under my tomcat for e.g. app1 and app2.

What I want to achieve is for app1 I want to allow only certain ips from intranet to have access on it.

I added following code to my httpd.conf file.

DocumentRoot "C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\scm"
<Directory "C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\app1">
    Order Deny,Allow
    Deny from some_ip
</Directory>

Still I am not able to restrict the access. I have enabled the module mod_authz_host. Kindly guide me.

share|improve this question
add comment

1 Answer

Try

Order deny,allow
Deny from all
Allow from some_ip

to just allow some_ip access to the service.

However Order, Deny and Allow are now deprecated and you might want to try

Require host <host_name>

or

Require ip <ip_address>

See: http://httpd.apache.org/docs/2.4/howto/access.html

share|improve this answer
add comment

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.