Debian under Apache and Tomcat integration (using APT tool)

Source: Internet
Author: User

The recent deployment of Web systems requires the use of Tomcat processing and Apache consolidation, and Tomcat processing Jsp,apache processing static resources. Do not know how to operate at the beginning, the online access to the material has gone a lot of detours. When it's done, it's easy to find, and now the configuration process is documented below.

1. Installing the Software

Using apt tools (I'm lazy, there are automated tools available, why not) install Apache, Tomcat, and Apache Connector (JK modules), which are used for direct interaction between Apache and Tomcat.

The command is as follows:

Apt-get Install apache2 tomcat8 LIBAPACHE2-MOD-JK

2. Configuration

After the installation is complete, the configuration begins.

2.1.tomcat Configuration

Edit File "/var/lib/tomcat8/server.xml"

Turn on AJP Port snooping (Apache will interact with Tomcat via this port)

Save reboot Tomcat

2.2 Apache Configuration

Need to check if JK module is enabled (general installation is enabled automatically)

Method: See if the "/etc/apache2/mods-enabled" directory has "jk.conf", "Jk.load" two files

If not, modify the manually created

The command is as follows:

Ln–s/etc/apache2/mods-available/jk.conf/ete/apache2/mods-enabled/jk.conf

Ln–s/etc/apache2/mods-available/jk.load/ete/apache2/mods-enabled/jk.load

2.3 Interface Module Configuration

Edit File "/etc/libapache2-mod-jk/httpd-jk.conf"

Prohibit proxy for static resources (remove the same comment)

3. Deploy the App

Here is an example of "Zrlog personal blog program";

3.1 Copy Package to tomcat default project directory

Copy the package "Zrlog.war" to "/var/lib/comcat8/webapps/" and restart Tomcat.

Tomcat automatically expands the package, which is now accessible through port 8080 (the Tomcat default port).

3.2 Configuring Vhost

Edit Vhost configuration file

Add configuration options and then restart Apache to access the ports configured by Vhost (e.g. 80)

Debian under Apache and Tomcat integration (using APT tool)

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.