2013-03-12 84 views
0

我已經將我的幾個項目部署到我的新服務器上。似乎正在發生的事情是我可以查看一個項目,但是一旦我轉到下一個項目,前一個項目的設置仍在使用中。2 Djangos 1服務器

例如,jacobvalenta.net和dev.pawndaddy.org都是服務器上的項目,在兩者之間翻轉會導致設置混淆。

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> 
+0

好的。現在,你會發布你的設置的任何細節,以便我們可以幫助你調試嗎? – 2013-03-12 14:13:28

+0

@DanielRoseman有配置。其他一切都是默認的Apache設置 – 2013-03-12 14:17:07

+0

「在兩者之間翻轉會導致設置混淆。」請更具體的*翻轉*和*混合起來*。如果您看到跨越虛擬託管站點的數據出現,則應確保您使用的是Django安裝的不同數據庫和文件系統位置。 – gertvdijk 2013-03-12 15:12:32

回答

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" 

所以只是刪除有關設置默認環境就行了,都應該是不錯的。