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 have a java application running on tomcat and i'm using the apache mod_proxy module to pass the files to tomcat, however tomcat seems to be ignore the .htaccess files, here my vhost.conf. How can I instruct apache to read the .htaccess and still server the jsp.

DirectoryIndex index.jsp index.htm index.html index.php  

ProxyRequests Off
ProxyPreserveHost On

<Proxy *>
        Order deny,allow
        Allow from all
</Proxy>
ProxyPass / http://localhost:9080/SouthSide_815/
ProxyPassReverse / http://localhost:9080/SouthSide_815/

RewriteLog /etc/httpd/logs/rewrite.log
RewriteLogLevel 3

DocumentRoot /usr/share/tomcat6/psa-webapps/southside815.com/SouthSide_815

<Directory /usr/share/tomcat6/psa-webapps/southside815.com/SouthSide_815>
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

On a sidenote, with the above configuration, when apache parses this configuration file and reaches the proxy part, will it proxy everything to tomcat and ignore the rest of the lines (DocumentRoot, Directory...)?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

.htaccess is meaningful to httpd only. Once a request is passed over to Tomcat, it is under rules of Tomcat's realm. You may handle a part of Apache's namespace to Tomcat though.

share|improve this answer
    
cool, i can do something like this ProxyPassMatch ^/(.+\.jsp)$ ajp://localhost:8009/$1, however back to my last question, when apache parses this configuration file and reaches the proxy part, will it proxy everything to tomcat and ignore the rest of the lines (DocumentRoot, Directory...)? –  Yehia A.Salam Jan 5 '13 at 12:20
    
@Yehia Yes, those directives have no effect since everything under / is proxied before it gets to directory mapping. If you want to apply configuration like access controls to the proxied path, use <Location> instead of <Directory>. –  Shane Madden Jan 5 '13 at 19:53
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.