Apache+tomcat configuration static and dynamic separation (one Apache, one tomcat, no cluster)

Source: Internet
Author: User

1. Download Apache HTTP server,tomcat,mok_jk.so

apache:http://httpd.apache.org/download.cgi

Tomcat:http://tomcat.apache.org/index.html

jk:https://tomcat.apache.org/connectors-doc/

2. Unzip the downloaded file and copy the mod_jk.so to the Apache24/modules directory

3. Modify the httpd.conf under the Apache24/conf folder

Change the service root path of line 39 to the path you just unzipped: Define srvroot "F:/tomcat/apache24"

At the back of the file, add:

LoadModule jk_module modules/mod_jk.sojkworkersfile "f:/tomcat/apache24/conf/worker.properties" JkLogFile "F:/ Tomcat/apache24/conf/mod_jk.log "Jkloglevel infojklogstampformat" [%a%b%d%h:%m:%s%Y] "jkmount/mytest/* worker1

4. Create a new worker.properties under the Apache24/conf folder and write to it in the file:

# indicate Tomcat's installation path for MOD_JK module workers.tomcat_home=f:/tomcat/apache-tomcat-7.0.69-httpd/apache-tomcat-7.0.69# to Mod_ The JK module indicates the installation path of the JDK Workers.java_home=c:/program files/java/jdk1.7.0_79# add a worker to the worker list worker.list=worker1# Set each parameter # work port for Worker1, Tomcat's default connector listening port, you can see port= "8009" in Tomcat Server.xml worker.worker1.port=8009# Tomcat machine, if installed in a different machine than Apache, you need to set the type of ipworker.worker1.host=localhost# worker, the allowed values are AJP13, AJP14, LB, status, etc. AJP13 is the preferred way for mod_jk to connect webserver and Tomcat (i.e. using a socket as a communication channel) worker.worker1.type=ajp13# load Balancing factor worker.worker1.lbfactor=1

5. Create the project under Tomcat's WebApps folder mytest

6. Launch Tomcat to see if mytest can be accessed, then continue

7. Start Apache, enter the command under Apache/bin httpd.exe-k start, the browser opens http://localhost see if you can access the Apache default static page, you can indicate that Apache is booting normally, Enter http://localhost/mytest/to see if you can access the items under Tomcat

Note: When accessing the project under Tomcat http://localhost/mytest/final/must add, otherwise you may be prompted not to find MyTest

The Apache static page is placed under the Apache/htdocs folder, which is configured on the 245 line of the httpd.conf

  

This should be the simplest kind of motion separation ...

Apache+tomcat configuration static and dynamic separation (one Apache, one tomcat, no cluster)

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.