Django on godaddy - 500内部服务器错误或禁止403 [英] Django on godaddy - 500 internal server error OR Forbidden 403
问题描述
我遵循这些教程: / p>
http://www.lichun.cc/blog/2012/06/setup-django-1-4-on-godaddy-linux-economy-host/
http://blurback.com/post/563604002/running-django-on-godaddy-sigh
但是我得到这个:
禁止
您没有访问此服务器的权限。
此外,尝试使用
时遇到404未找到错误ErrorDocument来处理请求。
Apache Server at www.gccfishing.com Port 80
$ b $我认为问题是python路径写在文件的第一行:#!/ usr / local / bin / python2.7
,因为当我尝试在SSH中执行一个文件时,我得到这个错误:
-bash:./test.py:/ usr / local / bin /python2.7^M:不好的解释器:没有这样的文件或目录。
其中test.py是一个示例测试文件,它是chmoded 。
这是godaddy上的我的文件夹配置:
home
内容
88
10907688
.pip
数据
error_logs
html
lib
scctmp
tmp
在 html
我正在放置文件到上面提到的教程是eit她的dispatch.py或.cgi文件。
在 lib
我有以下内容:
venv
bin
gccFishing(这是Django项目)
MySQLdb
python(文件类型:文件)
python2.7(文件类型:7文件)
django-admin.py
acitvate_this.py
包含
python2.7快捷文件夹
lib
python2.7
所有python库的快捷方式
site-packages(这是我下载Django的地方)
任何想法这里发生了什么?
Apache首先执行哪些文件?
我应该使用dispatch.py还是dispatch.cgi?
任何帮助/意见都将非常有帮助。谢谢。
看起来像你的行:
#!/ usr / local / bin / python2.7
在Windows中制作,然后上传。
-bash:./test.py:/usr/local/bin/python2.7^M:不好的翻译:否这样的文件或目录。
它包含^ M,它是一个Windows换行符。尝试在服务器上的VIM中进行编辑,您将看到它们。转换为UNIX文本文件。
如果您正在上传到Linux服务器,请确保在Windows上编辑文本文件以将其保存为UNIX格式。
I have a deluxe Linux hosting account on Godaddy and from the past 3 days I've been trying to host a Django website.
I followed these tutorials:
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
But I'm getting this:
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
I think the problem is with the python path which is written at the first line in files: #!/usr/local/bin/python2.7
, because when I try to execute a file in SSH I get this error:
-bash: ./test.py: /usr/local/bin/python2.7^M: bad interpreter: No such file or directory.
where test.py is a sample test file and it's chmoded.
This is my folder configuration on godaddy:
home
content
88
10907688
.pip
data
error_logs
html
lib
scctmp
tmp
In html
I'm placing files according to the above mentioned tutorials which are either dispatch.py or .cgi files.
In lib
I have the following:
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)
Any idea what's happening here?
Which files does Apache execute first?
Should I use dispatch.py or dispatch.cgi?
Any help/comments will be very helpful. Thank you.
It looks like your line:
#!/usr/local/bin/python2.7
was made in windows, then uploaded.
-bash: ./test.py: /usr/local/bin/python2.7^M: bad interpreter: No such file or directory.
It contains the ^M, which is a windows newline character. Try editing in VIM on the server and you will see them. Convert to UNIX text file.
Be sure when you edit text files on windows that you save them in UNIX format if you are uploading to a linux server.
这篇关于Django on godaddy - 500内部服务器错误或禁止403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!