gracece
V2EX  ›  Django

部署Django的问题

  •  
  •   gracece ·
    gracece · Dec 13, 2013 · 5743 views
    This topic created in 4533 days ago, the information mentioned may be changed or developed.
    最近想用django写个web应用,版本用了1.6.1。想在服务器上跑起来,服务器是ubuntu server 12.04,装的是apache2.2 ,跑着几个php站点。试着用mod_python,搞了半天才发现,1.6版本已经抛弃了mod_python。

    然后试试试官方推荐的WSGI,搞了半天,编译完了启动模块启动虚拟主机,然后apache就挂了。WSGI不支持这样操作?

    接下来想试试FastCGI, SCGI, or AJP,看哪种能成功。

    在折腾之前特地来问问比较推荐哪种方式比较好配置且使用起来方便(比如每次加urlconf之后不需要重启apache2)

    谢谢!
    Supplement 1  ·  Dec 14, 2013
    最后还是用的 mod_wsgi ,看的是这里https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/
    12 replies    1970-01-01 08:00:00 +08:00
    ericls
        1
    ericls  
       Dec 13, 2013   ❤️ 2
    推荐 uwsgi + supervisord + nginx之类
    gracece
        2
    gracece  
    OP
       Dec 13, 2013
    @ericls 因为现有的php站点中有一些依赖于apache的东西,所以如果要用apache的话,有没有好一点的方法?谢谢。
    shiny
        3
    shiny  
    PRO
       Dec 13, 2013   ❤️ 1
    @gracece apache 也可以做反向代理
    okidogi
        4
    okidogi  
       Dec 13, 2013   ❤️ 1
    gunicorn : http://gunicorn.org/
    + nginx

    apache做php服务器跟这个不冲突,可以用nginx反向代理,一个到你的php服务(apache),一个到你的django服务器(gunicorn)
    ericls
        5
    ericls  
       Dec 13, 2013   ❤️ 1
    @gracece 那就换apache反代吧
    gracece
        6
    gracece  
    OP
       Dec 13, 2013
    @ericls
    @okidogi
    @shiny 谢谢各位,我回头试试。
    mrluanma
        7
    mrluanma  
       Dec 13, 2013   ❤️ 1
    mod_wsgi
    inyfee
        8
    inyfee  
       Dec 14, 2013   ❤️ 1
    我也一直用 uwsgi + supervisord 作进程管理 + nginx 反向代理 这样子来做
    sfdye
        9
    sfdye  
       Dec 14, 2013   ❤️ 1
    lwj0012
        10
    lwj0012  
       Dec 14, 2013
    gunicorn +1
    borneo
        11
    borneo  
       Dec 15, 2013
    @gracece Apache is weak. Nginx is strong. Solid. Pure.

    @ericls is correct.

    For legacy PHP sides use PHP-fcgi + nginx.
    ericls
        12
    ericls  
       Dec 20, 2013
    @borneo
    hey .
    you interested in confucius?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2913 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 104ms · UTC 15:22 · PVG 23:22 · LAX 08:22 · JFK 11:22
    ♥ Do have faith in what you're doing.