有人设置 tomcat 使用 mod_jk 运行虚拟主机吗

发布于 2024-08-04 22:21:02 字数 1309 浏览 6 评论 0原文

我在 OSX 上工作,主要使用 PHP。通常我在本地使用 MAMP 和 httpd.conf 中的虚拟主机设置进行工作,以便我可以将浏览器指向 http://some-project 并拥有我需要设置的尽可能多的项目。

我们有一个项目需要提供 JSP 页面,我想设置我的本地 apache 服务器仅向 Tomcat 提供 JSP 文件,而使用相同的虚拟主机设置将其他所有内容提供给 MAMP:

~/applications/MAMP/ conf/apache/httpd.conf

到目前为止我已经:

  1. 成功安装 Tomcat

  2. 将 mod_jd.so 放入

    ~/applications/MAMP/Library/modules/mod_jk.so

  3. 通过放置添加模块:

    LoadModule jk_module module/mod_jk.so

~/applications/MAMP/conf/apache/httpd.conf
  1. Created /Library/Tomcat/Home/conf/jk/workers.properties 并添加以下行:

    workers.tomcat_home=/库/Tomcat workers.java_home=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

    ps=/ Worker.list=ajp12, ajp13

    worker.ajp13.port=8009 工人.ajp13.host=本地主机 工人.ajp12.type=ajp13 worker.ajp13.mount=/*.jsp

  2. 添加了以下行:

    JkWorkersFile /Library/Tomcat/Home/conf/workers.properties JkLogFile /Library/Tomcat/Home/logs/mod_jk.log JkLogLevel debug

到 ~/applications/MAMP/conf/apache/httpd.conf

但是,当我的 httpd.conf 中出现最后两行时,我无法启动 MAMP。

有人这样工作吗?

有什么建议吗?

对我做错了什么有明确的想法吗?

I work in OSX primarily with mostly PHP. Normally I work locally using MAMP and virtual hosts setup in my httpd.conf so that I can point a browser to http://some-project and have as many projects as I need setup.

We have a project coming up where we need to serve JSP pages and I would like to set up my local apache server to serve only JSP files to Tomcat and everything else to MAMP using the same virtual hosts setup in:

~/applications/MAMP/conf/apache/httpd.conf

So far I have:

  1. Successfully installed Tomcat

  2. Placed mod_jd.so in

    ~/applications/MAMP/Library/modules/mod_jk.so

  3. Added the module by placing:

    LoadModule jk_module modules/mod_jk.so

in

~/applications/MAMP/conf/apache/httpd.conf
  1. Created /Library/Tomcat/Home/conf/jk/workers.properties
    and added the following lines:

    workers.tomcat_home=/Library/Tomcat
    workers.java_home=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

    ps=/
    worker.list=ajp12, ajp13

    worker.ajp13.port=8009
    worker.ajp13.host=localhost
    worker.ajp12.type=ajp13
    worker.ajp13.mount=/*.jsp

  2. added the following lines:

    JkWorkersFile /Library/Tomcat/Home/conf/workers.properties
    JkLogFile /Library/Tomcat/Home/logs/mod_jk.log JkLogLevel debug

to
~/applications/MAMP/conf/apache/httpd.conf

I cannot start my MAMP however when these last two lines are present in my httpd.conf.

Does anyone work like this?

Any tips?

Any clear ideas of what I'm doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘦怹 2024-08-11 22:21:02

我发现 MAMP 除非日志文件已经存在,否则它不会启动。我创建日志文件的路径,并放入一个与预期日志文件名称相同的空文本文档,它会立即启动。

I've found with MAMP that it won't start unless the log files already exist. I create the path to the log file and put in an empty text document named the same as the expected log file and it starts right up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文