Ubuntu apche2 + tomcat6 integration (AJP)

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.