问题使用WSGIApplicationGroup%{}全球的Apache配置 [英] problem using WSGIApplicationGroup %{GLOBAL} in apache configuration

查看:174
本文介绍了问题使用WSGIApplicationGroup%{}全球的Apache配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Django与Apache和mod_wsgi的IM
我面临的一个问题,当我在Apache配置文件(.conf文件)使用WSGIApplicationGroup%{} GLOBAL。我不知道我是否正确地使用这个指令或者我需要另一种方式来使用它,问题是,我需要添加该指令定为Xapian的一个问题,因为在这一单中描述(的 http://trac.xapian.org/ticket/185 ) ,这意味着SITE1内容上site2.when我删除WSGIApplicationGroup%{} GLOBAL出现,网站将再次正确呈现,但搜索停止工作。

im using django with apache and mod_wsgi i am facing a problem when i use WSGIApplicationGroup %{GLOBAL} in apache configuration file (.conf) . i dont know if i am using this directive correctly or i need to use it in another way , the problem is that i needed to add this directive to fix a problem for xapian as described in this ticket (http://trac.xapian.org/ticket/185) after that the search started to work but all my sites contents got mixed up, meaning site1 content appears on site2.when i removed WSGIApplicationGroup %{GLOBAL} , sites are rendering properly again but search stopped working.

这是我的.conf文件的内容:

here is my .conf file contents:

NameVirtualHost my_ip_address:80
WSGIApplicationGroup %{GLOBAL}
<VirtualHost my_ip_address:80>
ServerName www.site1.com
ServerAlias site1

WSGIScriptAlias / "/home/sa/www/site1/apache/django.wsgi"
<Directory "/home/sa/www/site1/apache">
    Allow from all
</Directory>

Alias /site_media/ "/home/sa/www/site1/media/"
<Directory "/home/sa/www/site1/media/">
    Order allow,deny
    Options Indexes FollowSymLinks
    Allow from all
    IndexOptions FancyIndexing
</Directory>


</VirtualHost>

WSGIApplicationGroup %{GLOBAL}

<VirtualHost my_ip_address:80>
ServerName www.site2.com
ServerAlias site2

WSGIScriptAlias / "/home/sa/www/site2/apache/django.wsgi"
<Directory "/home/sa/www/site2/apache">
    Allow from all
</Directory>

Alias /site_media/ "/home/sa/www/site2/media/"
<Directory "/home/sa/www/site2/media/">
    Order allow,deny
    Options Indexes FollowSymLinks
    Allow from all
    IndexOptions FancyIndexing
</Directory>

Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/"
<Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/">
    Order allow,deny
    Options Indexes FollowSymLinks
    Allow from all
    IndexOptions FancyIndexing
</Directory>

</VirtualHost>



WSGIApplicationGroup %{GLOBAL}

< VirtualHost my_ip_address:80 >
ServerName www.site3.com
ServerAlias site3

WSGIScriptAlias / "/home/sa/www/site3/apache/django.wsgi"
<Directory "/home/sa/www/site3/apache">
    Allow from all
</Directory>

Alias /site_media/ "/home/sa/www/site3/media/"
<Directory "/home/sa/www/site3/media/">
    Order allow,deny
    Options Indexes FollowSymLinks
    Allow from all
    IndexOptions FancyIndexing
</Directory>

Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/"
<Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/">
    Order allow,deny
    Options Indexes FollowSymLinks
    Allow from all
    IndexOptions FancyIndexing
</Directory>

</VirtualHost>


WSGIApplicationGroup %{GLOBAL}

<VirtualHost my_ip_address:80>

ServerName www.site4.com
ServerAlias site4

WSGIScriptAlias / "/home/sa/www/site4/apache/django.wsgi"
<Directory "/home/sa/www/site4/apache"> 
    Allow from all 
</Directory>

Alias /site_media/ "/home/sa/www/site4/media/"
<Directory "/home/sa/www/site4/media/">
    Order allow,deny
    Options Indexes FollowSymLinks
    Allow from all
    IndexOptions FancyIndexing
</Directory>

Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/"
<Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/">
    Order allow,deny
    Options Indexes FollowSymLinks
    Allow from all
    IndexOptions FancyIndexing
</Directory>

</VirtualHost>


WSGIApplicationGroup %{GLOBAL}

<VirtualHost my_ip_address:80>
ServerName www.site5.com
ServerAlias site5

WSGIScriptAlias / "/home/sa/www/site5/apache/django.wsgi"
<Directory "/home/sa/www/site5/apache">
    Allow from all
</Directory>

Alias /site_media/ "/home/sa/www/site5/media/"
<Directory "/home/sa/www/site5/media/">
    Order allow,deny
    Options Indexes FollowSymLinks
    Allow from all
    IndexOptions FancyIndexing
</Directory>

Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/"
<Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/">
    Order allow,deny
    Options Indexes FollowSymLinks
    Allow from all
    IndexOptions FancyIndexing
</Directory>

</VirtualHost>

有没有人遇到这个问题
任何建议

has anybody faced this issue any suggestions

感谢

推荐答案

Django的执行prevents在同一间preTER(应用程序组)运行多个Django的实例。因此,如果在运行同一个Apache服务器上的多个Django的网站,且必须设置为WSGIApplicationGroup%{} GLOBAL,则必须使用守护进程模式,并委托各Django的网站到一个单独的守护进程组。守护进程模式是无论如何pferred $ P $。

Django's implementation prevents multiple Django instances running in same interpreter (application group). Thus if running multiple Django sites on same Apache server and must set WSGIApplicationGroup to %{GLOBAL}, then you MUST use daemon mode and delegate each Django site to a separate daemon process group. Daemon mode is preferred anyway.

确保您阅读:

<一个href=\"http://$c$c.google.com/p/modwsgi/wiki/QuickConfigurationGuide\">http://$c$c.google.com/p/modwsgi/wiki/QuickConfigurationGuide
  <一href=\"http://$c$c.google.com/p/modwsgi/wiki/ReloadingSource$c$c\">http://$c$c.google.com/p/modwsgi/wiki/ReloadingSource$c$c

后者解释为什么部分daemon模式是好的,只要使code重装更轻松。

The latter explaining part why daemon mode is good as far as making code reloading easier.

这篇关于问题使用WSGIApplicationGroup%{}全球的Apache配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆