zoukankan      html  css  js  c++  java
  • ajp方式整合,配置apache2.2 + tomcat6

    先看httpd.conf 文件配置:

    1 ##########################apache + tomcat start 
    2 LoadModule proxy_module modules/mod_proxy.so
    3 LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    4 LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    5 LoadModule proxy_connect_module modules/mod_proxy_connect.so
    6 LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    7 LoadModule proxy_http_module modules/mod_proxy_http.so
    8 ##########################apache + tomcat end

    虚拟主机配置,还是httpd.conf文件:

    ################################################apache tomcat vhost
    Include conf/extra/httpd-vhosts.conf

    最后在httpd.conf文件最后加入:

    #************************************************
    
    ProxyPass / ajp://127.0.0.1:8009/
    ProxyPassReverse / ajp://127.0.0.1:8009/

    关于vhost配置文件:

    <VirtualHost *:80>
        ServerAdmin webmaster@dummy-host.thinkdee.com
        DocumentRoot "D:/workspace/apache-tomcat-6.0.36/webapps/qiye"
        ServerName www.thinkdee.com
        ServerAlias thinkdee.com
       
    
        ProxyPass /static !
        ProxyPass /html ! 
        ProxyPass /js !
    
        ProxyPass / balancer://thinkdee/
        <Proxy balancer://thinkdee/>
        BalancerMember ajp://www.thinkdee.com:8080/
    #    BalancerMember ajp://server2:8080/
    #    BalancerMember ajp://server3:8080/
        </Proxy>
     ErrorLog "logs/dummy-host.thinkdee.com-error.log"
        CustomLog "logs/dummy-host.thinkdee.com-access.log" common
    </VirtualHost>

    在本地hosts文件中加入了

    127.0.0.1 www.thinkdee.com

    配置好,重新启动apache就行了,

    本地的tomcat6,端口仍是8080,没有变化,

    运行apache只要没有错,基本上就成功了,

    tomcat启动起来,

    测试如下:直接访问http://www.thinkdee.com:8080/showlogin 可以正常访问,

    不要8080端口也可以访问,http://www.thinkdee.com/showlogin 可以正常访问,

  • 相关阅读:
    CodeForces Round #521 (Div.3) B. Disturbed People
    CodeForces Round #521 (Div.3) A. Frog Jumping
    Lyft Level 5 Challenge 2018-Final Round(Open Div.2) B. Taxi drivers and Lyft
    #Leetcode# 2. Add Two Numbers
    #Leetcode# 29. Divide Two Integers
    #Leetcode# 122. Best Time to Buy and Sell Stock II
    #Leetcode# 121. Best Time to Buy and Sell Stock
    #LeetCode# 48. Rotate Image
    #Leetcode# 5. Longest Palindromic Substring
    原理优先的重要性_就signal探讨
  • 原文地址:https://www.cnblogs.com/atyou/p/3097078.html
Copyright © 2011-2022 走看看