[아파치 + mod_wsgi]httpd를 service로 실행 했을때와, root권한으로 init.d/httpd를 실행했을때의 차이점
django1.4개발을 위해 mod_wsgi를 아파치와 연동하려고 하는데
아파치를 "service httpd start"로 기동하면
Forbidden You don't have permission to access /test2 on this server.
라는 에러가 뜨고,
"/etc/rc.d/init.d/httpd -k start"로 했을 경우에는 제대로 뜨는데 이유 아시면 가르쳐주세요.
그리고 "service httpd start"로 아파치를 기동하여 제대로 뜨게 하는 방법아시면 좀 가르쳐주세요.
밑의 내용과 같이 하면 Forbidden You don't have permission to access /test2 on this server.라고 에러가 뜹니다.
=================================================
http://rudepeklo.blogspot.jp/2010/02/running-django-on-shared-hosting-with.html
1.위 사이트 "Simple WSGI script"에 써져있는 소스를 "/django/hello.py"에 작성.
2.httpd.conf에 "WSGIScriptAlias /test2 /django/hello.py"를 추가
3.아파치를 "service httpd start"로 기동
4.브라우저로 "http://도메인/test2" 접속
=================================================
하지만, 아파치 기동을 "/etc/rc.d/init.d/httpd -k start"로 했을 경우나,
파일을 "/var/www/cgi-bin/hello.py"에 작성하여, "WSGIScriptAlias /test /var/www/cgi-bin/hello.py"로 설정해서 브라우저로 보면 제대로 "Hello world"라고 뜹니다.
파일이나 디렉토리의 모든 권한은 755로 설정하였습니다.
댓글 달기