doubi12138 2011-09-29 10:58
浏览 52
已采纳

将网站从tomcat指向Apache服务器

I have a website website1.com on Apache server developed using PHP and deployed in Apache Server.

Now I have implemented a new features/modules in Java and JSP technologies and deployed in Tomcat server. Now what ever I have implemented in Java J2EE techologies should point to the subdomain of actual website website1.com and it should look like subdomain1.website1.com

Both Apache Tomcat and Apache Server resides in the Same machine.

Is that possible? if yes can you please help me how to do that ?

All the environment is set up on LINUX based Server.

  • 写回答

1条回答 默认 最新

  • dsbezji539113152 2011-09-29 11:22
    关注

    You can try using a virtual host with a proxy pass rule. Core of the configuration would be:

    NameVirtualHost *:80
    
    # Default host to handle PHP and static content
    <VirtualHost *:80>
        DocumentRoot /var/www/www.website1.com
        ServerName www.website1.com
        # Other directives here
    </VirtualHost>
    
    # Tomcat redirector
    <VirtualHost *:80>
        DocumentRoot /var/www/subdomain1.website1.com
        ServerName subdomain1.website1.com
        # Other directives here
        ProxyPass / ajp://website1.com:8009
    </VirtualHost>
    

    Assuming you have enabled AJP connecter within your Tomcat configuration and that its running on port 8009.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!