2013-07-17 98 views
0

我在Godaddy上有一個豪華的Linux託管帳戶,從過去的3天我一直試圖託管一個Django網站。Godaddy上的Django - 500內部服務器錯誤或Forbidden 403

我跟着這些教程:

http://www.lichun.cc/blog/2012/06/setup-django-1-4-on-godaddy-linux-economy-host/

Installing a django site on GoDaddy

http://blurback.com/post/563604002/running-django-on-godaddy-sigh

但我發現了這一點:

Forbidden

You don't have permission to access/on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache Server at www.gccfishing.com Port 80

我認爲這個問題是與蟒蛇PA #!/usr/local/bin/python2.7,因爲當我嘗試在SSH執行文件,我得到這個錯誤:這是在文件的第一行寫個

-bash: ./test.py: /usr/local/bin/python2.7^M: bad interpreter: No such file or directory.

其中test.py是一個樣本測試文件,它的chmoded。

這是GoDaddy的我的文件夾配置:

home 
    content 
     88 
      10907688 
       .pip 
       data 
       error_logs 
       html 
       lib 
       scctmp 
       tmp 

html我根據上面提到的教程,要麼dispatch.py​​或.cgi文件放置文件。

lib我有以下幾點:

venv 
    bin 
     gccFishing (this is the Django project) 
     MySQLdb 
     python (file type: File) 
     python2.7 (file type: 7 File) 
     django-admin.py 
     acitvate_this.py 
    include 
     shortcut folder of python2.7 
    lib 
     python2.7 
      shortcuts to all python libraries 
      site-packages(this is where I downloaded Django) 

任何想法,這裏發生了什麼?

Apache首先執行哪些文件?

我應該使用dispatch.py​​還是dispatch.cgi?

任何幫助/意見將是非常有益的。謝謝。

回答

0

它看起來像你的線路:

#!/usr/local/bin/python2.7 

在Windows製成,然後上傳。

-bash: ./test.py: /usr/local/bin/python2.7^M: bad interpreter: No such file or directory. 

它包含^ M,它是一個Windows換行符。嘗試在服務器上的VIM中進行編輯,您將看到它們。轉換成UNIX文本文件。

如果您正在上傳到Linux服務器,請務必在Windows上編輯文本文件,以UNIX格式保存它們。

+0

是的,這是問題。謝謝。 – Hammad