Debian Apache and tomcat integration (using apt tool), debianapt

Source: Internet
Author: User

Debian Apache and tomcat integration (using apt tool), debianapt

Recently deployed web systems require the use of tomcat for integrated use with Apache, tomcat for JSP processing, and Apache for static resources. I didn't know how to operate it at first, and I had a lot of detours when I checked the information online. The configuration process is recorded as follows.

1. Install software

Install Apache, tomcat, and Apache Connector (jk module) using apt tools (I am relatively lazy and can use automation tools ), jk module is 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, start the configuration.

2.1.tomcat Configuration

Edit the file "/var/lib/tomcat8/server. xml"

 

Enable ajp port listening (Apache will use this port to interact with tomcat)

 

Save and restart tomcat

2.2 Apache configuration

Check whether the jk module is enabled (generally, it is automatically enabled after successful installation)

Method: Check whether "jk. conf" and "jk. load" files exist in the "/etc/apache2/mod-enabled" directory.

 

If not, modify the manual Creation

The command is as follows:

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

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

2.3 interface module configuration

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

 

Do not proxy static resources (just remove the comments below)

 

3. Deploy the application

Here, we use the "Zrlog personal blog program" as an example;

3.1 copy the software package to the tomcat default project directory

Copy the "zrlog. war" package to "/var/lib/comcat8/webapps/" and restart tomcat.

 

Tomcat automatically expands the software package, which can be accessed through port 8080 (default tomcat port.

 

3.2 configure vhost

Edit the vhost configuration file

 

Add configuration options, restart Apache, and access through the vhost configured port (such as 80)

 

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.