2012-01-25 30 views
0

mod_wsgiでApache上で動作するDjangoアプリケーションを取得しようとしています。/staticと/(Djangoアプリ)のファイルの両方に403(Forbidden)があります。 apacheユーザーはwsgi.pyの権限を持ち、/ apps/{DIR}/staticをリストできます。/apps/{DIR}のすべてのファイル/ディレクトリのユーザーとグループを変更しました。私はsudoのユーザーがwsgi.pyに移動することができます。私は手動でApacheをhttpd -Xでデバッグモードにすることができ、すべて正常に動作します! (私はDjangoのアプリと静的なコンテンツにアクセスすることができます)しかし、私は通常、それが動作しない、それを実行したとき、私はRHEL 6.2 403Apacheとmod_wsgiでDjangoが403(禁止されている)

を取得し、 のPython 2.6.6は、 Djangoの1.3は、 のhttpd-2.2。 15、 のmod_wsgi-3.2

ある/etc/httpd/conf/httpd.conf:

WSGIScriptAlias//apps/{DIR}/{APP_NAME}/apache/wsgi.py 
WSGIPythonPath /apps/{DIR}/{APP_NAME} 

<Directory /apps/{DIR}/{APP_NAME}/apache> 
    <Files wsgi.py> 
    Order deny,allow 
    Allow from all 
    </Files> 
</Directory> 

Alias /static /apps/{DIR}/static 
<Directory /apps/{DIR}/static> 
    Order allow,deny 
    Options Indexes 
    Allow from all 
    IndexOptions FancyIndexing 

    #Options FollowSymLinks 
    AllowOverride None 
</Directory> 

エラーのhttpd/error_logに

[...] [error] [client x.x.x.x] (13)Permission denied: access to/denied 
[...] [error] [client x.x.x.x] (13)Permission denied: Can't open directory for index: /apps/{DIR}/static/ 

誰にもアイデアはありますか? ありがとう

+0

問題をどのように修正しましたか?私はCentOSに非常に問題があります。 'sudo /etc/init.d/httpd'を使ってhttpdを起動するときに' sudo/usr/sbin/httpd'を実行したときには禁止されています – Fedor

答えて

0

SELinuxを有効にしていますか?

ディレクトリー自体だけでなく、「/」から「スタティック・メディア・ディレクトリー」から「Apacheユーザー」までのすべてのディレクトリーがありますか?

+0

はい、SELinuxが実行されていました。私はSELinuxを修正し、現在はうまくいきます。 ありがとう – user1167710

関連する問題