apachetomcat7solr4

JK_Mount apache forbidden without trailing slash


I'm running apache 2.4.6 on CentOS 7 and got apache tomcat 7 working with apache through mod_jk. I'm using tomcat to provide apache solr. The solr instance is working great on both port 8080 through tomcat directly and now on port 80 using the mod_jk connector.

I notice that the Solr page works fine if I put this URL into my browser:

http://solr1.mydomain.com/solr/

However, if I give the URL without a trailing slash, like so:

http://solr1.mydomain.com/solr

I get the following response from Apache:

Forbidden

You don't have permission to access /solr on this server.

This is how I have everything setup in my apache VHOST:

# Update this path to match your modules location
LoadModule   jk_module    modules/mod_jk.so
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /etc/httpd/conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile  /var/log/httpd/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile    /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel  info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# Send everything for context /examples to worker named worker1 (ajp13)

<VirtualHost *:80>

              ServerName solr1.mydomain.com

              # Select the timestamp log format
              JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
              # Send everything for context /examples to worker named worker1 (ajp13)

              Alias /solr /usr/share/tomcat/webapps/solr
              JkMount    /test/* worker1
              JkMount    /solr/* worker1
 </VirtualHost>

This is the response that I am getting in the error logs:

[Sun Nov 02 15:53:22.289517 2014] [authz_core:error] [pid 22386] [client 47.18.111.100:40247] AH01630: client denied by server configuration: /usr/share/tomcat/webapps/solr

I'd really appreciate it if I could get your feedback on how I could get rid of the trailing slash!

Thanks


Solution

  • Later, but maybe useful for someone else:

    JkMount    /solr* worker1
    

    Solution is to remove slash "/" behing URL prefix from JkMount command, it's working for me...