0

私は自分のいくつかのプロジェクトを新しいサーバーにデプロイしました。あるプロジェクトは問題なく表示できますが、次のプロジェクトに移動すると、前のプロジェクトの設定が引き続き使用されているようです。

たとえば、jacobvalenta.netとdev.pawndaddy.orgはどちらもサーバー上のプロジェクトであるため、2つを切り替えると、設定が混同される可能性があります。

SGIPythonPath /home/projects/pawndaddy:/home/projects/jacobvalenta:/home/projects/sailcast:/home/projects/tryfecta:/home/projects/midiscribe

NameVirtualHost *:80

<VirtualHost *:80>
        ServerName jacobvalenta.net
        ServerAlias *.jacobvalenta.net

        DocumentRoot /home/projects/jacobvalenta
        WSGIScriptAlias / /home/projects/jacobvalenta/jacobvalenta/wsgi.py

        <Directory /home/projects/jacobvalenta/jacobvalenta>
                <Files wsgi.py>
                        Order deny,allow
                        Allow from all
                </Files>
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName sailcast.org
        ServerAlias *.sailcast.org

        DocumentRoot /home/projects/sailcast
        WSGIScriptAlias / /home/projects/sailcast/sailcast/wsgi.py

        <Directory /home/projects/sailcast/sailcast>
                <Files wsgi.py>
                        Order deny,allow
                        Allow from all
                </Files>
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName pawndaddy.org
        ServerAlias *.pawndaddy.org

        DocumentRoot /home/projects/pawndaddy/
        WSGIScriptAlias / /home/projects/pawndaddy/pawndaddy/wsgi.py

        <Directory /home/projects/pawndaddy/pawndaddy>
                <Files wsgi.py>
                        Order deny,allow
                        Allow from all
                </Files>
        </Directory>
</VirtualHost>
4

1 に答える 1

0

もう少しファイルを読むべきだった!

wsgi.py内で、コメントは次のように述べています。

# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "project.settings"

したがって、デフォルト環境の設定に関する行を削除するだけで、すべてがうまくいくはずです。

于 2013-04-05T18:54:37.960 に答える