什么是在Linux上安装mod_jk的给Tomcat前运行Apache的最佳方式 [英] What is the best way to install Mod_jk on linux to run apache in front of tomcat

查看:274
本文介绍了什么是在Linux上安装mod_jk的给Tomcat前运行Apache的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Word preSS为我的博客和我的主要项目是Java中使用Tomcat服务器,以便
我想每个请求来我的服务器去通过Apache。

I am using Wordpress for my blog and my main project is in java using tomcat server so I want each request coming to my server to go through apache.

有关为例,如果我的网站使用 www.sample.com 我想发送请求到Tomcat
如果是 www.sample.com/word$p$pss 发送到阿帕奇

For exemple if my site uses www.sample.com I would like to send the request to tomcat and if it is www.sample.com/wordpress send it to apache

感谢

推荐答案

安装modjk:

sudo apt-get install libapache2-mod-jk
sudo a2enmod jk

创建workers.properties文件:

Create workers.properties file:

worker.list=tomcat,tstatus
worker.tomcat.type=ajp13
worker.tomcat.host=[TOMCAT-IP HERE]
worker.tomcat.port=[TOMCAT-AJP-PORT HERE]
#status information (optional)
worker.tstatus.type=status

这到httpd.conf:

Add this to httpd.conf:

JkWorkersFile   /PATH-TO-YOUR-FILE/workers.properties
JkLogFile       /var/log/apache2/mod_jk.log  
JkShmFile       /tmp/jk-runtime-status
JkLogLevel      info

JkMount /YourJavaAppName       tomcat
JkMount /YourJavaAppName/*     tomcat

JkMount /modjkstatus tstatus

现在,你应该能够访问:

Now you should be able to access:

http://YOUR-IP/wordpress
http://YOUR-IP/YourJavaAppName (redirected)
http://YOUR-IP/modjkstatus (redirected)

这篇关于什么是在Linux上安装mod_jk的给Tomcat前运行Apache的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆