inyfee
V2EX  ›  问与答

discuz 和 django 同服务器的 apache 配置问题?

  •  
  •   inyfee · May 11, 2014 · 3850 views
    This topic created in 4416 days ago, the information mentioned may be changed or developed.
    现在有一台服务器,有django提供我自己的web应用 ,但同时想挂一个discuz 论坛。
    我想问,apache如何配置才能支持这样:
    www.domain.com 访问django (这个已经配置完成,mod_wsgi )
    www.domain.com/bbs 访问 discuz ,以 /bbs 开头的都匹配discuz .

    对apache 很不熟,求教配置方法。

    不要吐槽一台服务器又供python,又供php ,我只是想学习一下这种情况怎么配置 。^.^
    4 replies    2014-05-12 01:16:44 +08:00
    cjou
        1
    cjou  
       May 11, 2014
    建议用 Nginx + uWSGI,支持 Python 和 PHP
    ritksm
        2
    ritksm  
       May 11, 2014
    关键字...ProxyPass
    给你个文档 http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

    当然我觉得如果要用代理/反代不如就Nginx好了
    AstroProfundis
        3
    AstroProfundis  
       May 11, 2014
    貌似也可以考虑 mod_python, 但 nginx 做反代应该是最理想的,配置也要简单些
    laogui
        4
    laogui  
       May 12, 2014
    我目前是php nodejs,用apache的反向代理

    NameVirtualHost *:80
    <VirtualHost *:80>
    ServerName abc.com
    ServerAlias www.abc.com
    ProxyRequests off
    ProxyPass / http://127.0.0.1:8000/
    ProxyPassReverse / http:/127.0.0.1:8000/
    </VirtualHost>
    <VirtualHost *:80>
    ServerName abcd.com
    ServerAlias abcd.com
    ProxyRequests off
    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
    </VirtualHost>
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3002 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 02:45 · PVG 10:45 · LAX 19:45 · JFK 22:45
    ♥ Do have faith in what you're doing.