donglu9898 2015-04-07 14:28
浏览 156

将Tomcat 7 80重定向到Apache 8080

I have a problem with my server, I know I can do Apache 80 to Tomcat 8080, but I need Tomcat 7 port 80 to Apache port 8080.

this is possible?

now: www.my-java-web.com and www.my-php-web.com:8080

final: www.my-java-web.com and www.my-php-web.com

Edit: opposite like this How do I redirect from Apache to Tomcat?

  • 写回答

1条回答 默认 最新

  • dtxb75622 2015-04-10 00:32
    关注

    It's not 100% clear what you really want to do but I will try to achieve an answer for you which already works on my system:

    now: www.my-java-web.com and www.my-php-web.com:8080

    final: www.my-java-web.com and www.my-php-web.com

    So you will have 2 different domain. Still apache needs to run on 80 simply change that in the apache2.conf or httpd.conf by adding LISTEN 80 because that will be the entry port.

    You than can create a VirtualHost in the Apache which allows you to redirect the domain www.my-java-web.com directly to you java backend without and of course you then also need to change the tomcat port to another one than 80 because that's already in use by apache - no way to get rid of that task.

    <VirtualHost *>
       ServerAdmin xx@example.com
       ServerName www.my-java-web.com
       ProxyPreserveHost On
       # setup the proxy
       <Proxy *>
          Order allow,deny
          Allow from all
       </Proxy>
       ProxyPass / http://localhost:{your new tomcat port}/
       ProxyPassReverse / http://localhost:{your new tomcat port}/
    </VirtualHost>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退