首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >用httpd.conf和mod_proxy_ajp将两个tomcat实例解析为两个不同的目录

用httpd.conf和mod_proxy_ajp将两个tomcat实例解析为两个不同的目录
EN

Server Fault用户
提问于 2014-05-05 22:50:54
回答 2查看 1K关注 0票数 0

请原谅我对这个话题的无知。我读过、读过、查过、搜过、查过、查过、搜过、查过、搜过、查过、查过、搜过、查过、搜过、查

我正在尝试设置我的httpd.conf以允许一个域,使用两个目录来解析两个不同的tomcat实例。

www.example.com/first

代码语言:javascript
运行
复制
<VirtualHost "ip address":80>
        ServerName example/first
        ErrorLog /var/log/httpd/first_error.log
        CustomLog /var/log/httpd/first_access.log combined

        <Proxy *>
                AddDefaultCharset off
                Order deny,allow
                Allow from all
        </Proxy>

        ProxyPass / ajp://localhost:8009/
        ProxyPassReverse / ajp://localhost:8009/
</VirtualHost>

www.example.com/second

代码语言:javascript
运行
复制
<VirtualHost "ip address":80>
        ServerName example/second
        ErrorLog /var/log/httpd/second_error.log
        CustomLog /var/log/httpd/second_access.log combined

        <Proxy *>
                AddDefaultCharset off
                Order deny,allow
                Allow from all
        </Proxy>

        ProxyPass / ajp://localhost:8010/
        ProxyPassReverse / ajp://localhost:8010/
</VirtualHost>

我知道这是错误的,我认为我应该使用<Directory>,或者我应该在以下文件中指定tomcat实例:

ProxyPass /example1 ajp://localhost:8010/

ProxyPass /example2 ajp://localhost:8009/

请派人帮忙。供应/士气低落。

或者链接到例子..。谢谢你!!

EN

回答 2

Server Fault用户

回答已采纳

发布于 2014-05-06 22:26:31

解决了。

代码语言:javascript
运行
复制
<VirtualHost "ip address":80>
            ServerName example.com
            ErrorLog /var/log/httpd/error.log
            CustomLog /var/log/httpd/access.log combined

            ProxyPass /first/ ajp://localhost:8009/first/

            ProxyPass /second/ ajp://localhost:8010/second/

</VirtualHost>
票数 0
EN

Server Fault用户

发布于 2014-05-06 01:12:39

对于第一个拆分URI代理,我建议您避免使用<Location><Directory>。目录映射到实际的文件系统目录,而位置映射到URI路径。后者是您想要完成的,但是您实际上并不需要一个容器来完成这个任务。(它只会使配置变得更干净)

使用单个<VirtualHost>,与ProxyPass /first ajp://localhost:8009ProxyPass /second ajp://localhost:8010一起使用。我可以给你一个完整的配置,但我希望你再努力一点。如果你解决了上面的困惑,你就很接近完成这个任务了。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/593282

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档