1. install Tomcat:
Sudo apt-Get install tomcat6
Of course, you can also directly download the free installation version. However, if Ubuntu is directly installed, the Tomat user group and user will be automatically created for you.
2. install Apache. Installed by default.
Sudo apt-Get install apche2
3. Start two proxy modules
Sudo a2enmod proxy_ajp
Sudo a2enmod proxy
You can also enter the following sentence in httpd. conf under/etc/apache2/conf:
Loadmodule proxy_module modules/mod_proxy.so
Loadmodule proxy_ajp_module modules/mod_proxy_ajp.so
Enter httpd. conf
Proxypass/AJP: // 127.0.0.1: 8009/
Proxypassreverse/AJP: // 127.0.0.1: 8009/
Restart
Sudo/etc/init. d/apache2 restart
Open Tomcat server. XML (the path should be/usr/share/tomcat6. You can use whereis tomcat6 to view it)
Define a coyote/JK2 AJP 1.3 connector on port 8009
Comment out.
Restart tomcat.
Over.
Note:
I encountered 403 problems during configuration.
Based on the suggestions on the Internet:
Modify the content in/etc/apache2/Module-available/Proxy. conf:
<Ifmodule mod_proxy.c>
Proxyrequests off
<Proxy *>
Order deny, allow
Deny from all
# Allow from localhost 127.0.0.1 192.168.139.2
Allow from all
</Proxy>
Proxyvia on
</Ifmodule>
Of course, allow from all is not recommended for this file, but it does not mean to set proxyrequests on at the same time.
In this case, there is no problem.