As follow up post to setting up solr i show you how to integrate tomcat into Apache as main web server:
The setup was made under ubuntu 11.10 with the following prerequisites:
- CATALINA_HOME is /usr/share/tomcat7
- JAVA_HOME is /usr/lib/jvm/default-java
- HOSTNAME in my case is ubuntu-vm.localdomain
- apt-get install libapache2-mod-jk
- nano /etc/apache2/workers.properties with the following contents
workers.tomcat_home=/usr/share/tomcat7 workers.java_home=/usr/lib/jvm/default-java ps=/ worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 worker.ajp13.lbfactor=1
- nano /etc/apache2/mods-available/jk.conf with the following contents
# Where to find workers.properties JkWorkersFile /etc/apache2/workers.properties # Where to put jk shared memory JkShmFile /var/log/apache2/mod_jk.shm # Where to put jk logs JkLogFile /var/log/apache2/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] " # solr redirect JkMount /solr* ajp13
- less /etc/apache2/mods-available/jk.load to see the following contents
- LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
- run a2enmod jk to see if mod_jk is enabled
- Module jk already enabled
- less /usr/share/tomcat7/conf/server.xml to see a line like this
- <Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ />
- nano /etc/apache2/sites-available/default and insert a line into the virtualHost:80 section
- JKMountCopy On
- restart apache2 with service apach2 restart
- Open a browser on your client to open http://ubuntu-vm.localdomain/solr/admin/