For production environment, it's good to have a front end server like Apache.
While we present mod_jk and mod_proxy below, since 2012 we've been preferring using mod_proxy as it is simpler to configure and its performance improvements in the past few years have shown to be as fast (if not faster than the native java jk protocol).
So if you are to choose between the two, go with mod_proxy.
Using Apache 2.4 and mod_proxy
Add/enable the following to your httpd.conf:
Then on your virtual host config:
Using Apache/IIS with LAMS (mod_jk)
If you want LAMS to coexist with another web server listening on port 80 on the same machine, and that web server is supported by the mod_jk connector, then you can use mod_jk to pass all requests from your web server through to lams.
See http://tomcat.apache.org/connectors-doc/ for the latest mod_jk binaries and documentation. http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss outlines how to use mod_jk with jboss.
On the LAMS side, all you need to do is install LAMS normally, by default it will be listening on port 8009, which will be used by the mod_jk connector. If you've changed this behaviour, then it's probably safe to assume you know what you're doing already.
- Download the mod_jk .so (unix) or .dll (windows) file from http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/, and place it in your Apache's modules directory.
- Add the module to your apache config. Update the paths as per your system.
- Create a workers.properties file in the location pointed to by JkWorkersFile directive above
- Restart apache.
- See http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html. The part with the steps you want to follow is under the heading 'Configuring the ISAPI redirector'.
- Use the workers.properties file above.
- Use the following uriworkermap.properties file.
- If using IIS6, also do the following (taken from http://www.cflex.net/showFileDetails.cfm?ObjectID=296):
- Open the ... Administrative Tools, Internet Information Services console.
- In the tree on the left, click " Web Service Extensions"
- In the right hand pane, click "Add a new Web Service Extension"
- For the Extension Name, enter: Jakarta Tomcat
- Click the "Add" button.
- Browse and select C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\bin\isapi_redirector.dll
- Click the "Allow" button. DO NOT MISS THIS STEP!
- From the "Services" MMC, restart "IIS Admin"