簡體   English   中英

apache和mod_python的基本配置有什么問題?

[英]What's wrong with the Basic configuration of apache and mod_python?

apache的基本配置是:

LoadModule python_module /usr/lib64/httpd/modules/mod_python.so
<Location "/mysite/">
        SetHandler python-program
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE mysite.settings
        PythonOption django.root /mysite
        PythonDebug On
        PythonPath "['/var/www/html', '/usr/local/gdnsplus_conf/www/mysite'] + sys.path"
</Location>

我已經做好了:

ln -sf /usr/local/gdnsplus_conf/www/mysite /var/www/html/gdnsplus_conf

django的版本是:1.4.5
mod_python的版本是:3.3.1
的Django應用程序的目錄為:在/ usr /本地/ gdnsplus_conf / WWW / mysite的
應用程序的上下文是:

ll /usr/local/gdnsplus_conf/www/mysite
total 184
-rw-r--r-- 1 apache root  2970 Mar 25 16:20 conf.xml
-rw-r--r-- 1 apache root  4992 Apr 25 17:15 cv
-rw-r--r-- 1 apache root  4991 Apr 25 17:16 cv_all
-rw-r--r-- 1 apache root  6727 Mar 29 18:05 hand_xml.py
-rw-r--r-- 1 apache root     0 Mar 12 09:12 __init__.py
-rw-r--r-- 1 apache root   134 Mar 12 09:15 __init__.pyc
-rw-r--r-- 1 apache root  5720 Apr 17 15:27 settings.py
-rw-r--r-- 1 apache root  5400 Mar 12 09:33 settings.py.bk
-rw-r--r-- 1 apache root  3118 Apr 17 15:27 settings.pyc
-rw-r--r-- 1 apache root  2080 Apr 22 13:34 tags
drwxr-xr-x 2 apache root  4096 May  9 13:46 templates
-rw-r--r-- 1 apache root    62 Apr 27 11:05 test
-rw-r--r-- 1 apache root  1238 May  9 11:09 urls.py
-rw-r--r-- 1 apache root  1144 May  9 11:10 urls.pyc
-rw-r--r-- 1 apache root 34352 May  9 13:45 views.py
-rw-r--r-- 1 apache root 30384 Apr 16 09:06 views.py.bk
-rw-r--r-- 1 apache root 33425 May  9 14:55 views.pyc
-rw-r--r-- 1 apache root  1134 Mar 12 09:12 wsgi.py
-rw-r--r-- 1 apache root  1028 Mar 12 09:15 wsgi.pyc

urls.py的信息是:

urlpatterns = patterns('',
        (r'^conf_xml/$', receive),
        (r'^dc_list/$', listall),
        (r'^show_err/$', show_err),
        (r'^ipdb_file/$', ipdb_file),
        (r'^ipdb_update/$', ipdb_update),
        (r'^task_list/$', task_list),
        (r'^task_search/$', task_search),
        (r'^nip_set/$', nip_set),
        (r'^nip_del/$', nip_del),
        (r'^nip_update/$', nip_update),
        (r'^ns_set/$', ns_set),
        (r'^ns_list/$', ns_list),
        (r'^reversion_list/$', list_version),
        (r'^version_set/$', version_set),
        (r'^index/$', all_err),
        (r'^machine/$', show_machine),

問題是:

http://192.168.23.73/ns_list/

不起作用。錯誤消息是apache日志中的“文件不存在”。

怎么解決呢? 謝謝。

你應該在被訪問http://192.168.23.73/mysite/ns_list/作為評論的羅漢說。

這是因為在Apache配置中,您具有<Location "/mysite/">

你可以閱讀更多關於位置指令這里 從文檔:

在下面的示例中,使用尾部斜杠時,對/ private2 /和/private2/file.txt的請求將應用隨附的指令,但/ private2和/ private2other則不會。

<Location /private2/>
    # ...
</Location>

另外值得一提的是mod_python是正在積極發展不再和你應該看看使用modwsgi代替。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM