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.

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

报告相同问题?

悬赏问题

  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条