Apache의 DocumentRoot 설정에 관해

pilspark의 이미지

Red Hat Linux 8.0을 깔고 기본 direcotry가 /var/www/html로 되어있는 것을 바꾸려고 다음과 같이 했습니다.
(/etc/httpd/conf/httpd.conf 파일을 다음과 같이 수정)

DocumentRoot "/home/httpd/html"

그리고 아래에도 다음과 같이 바꾼 후

<Directory "/home/httpd/html">

..............

</ Directory>

apachectl restart로 다시 시작했는데, 외부에서 접속해보면 다음 에러 메세지가 뜹니다.

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

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

뭔가 permission의 문제가 있는 것 같은데 어떻게 수정해야 하는지요?

jedi의 이미지

chmod 755 /home
chmod 755 /home/httpd
chmod 755 /home/httpd/html

이정도가 필요할듯 한데요..

+++ 여기부터는 서명입니다. +++
국가 기구의 존속을 위한 최소한의 세금만을 내고, 전체 인민들이 균등한 삶을
영위할 수 있는 착취가 없는 혁명의 그날은 언제나 올 것인가!
-- 조정래, <태백산맥> 중에서, 1986년

fender의 이미지

pilspark wrote:
Red Hat Linux 8.0을 깔고 기본 direcotry가 /var/www/html로 되어있는 것을 바꾸려고 다음과 같이 했습니다.
(/etc/httpd/conf/httpd.conf 파일을 다음과 같이 수정)

DocumentRoot "/home/httpd/html"

그리고 아래에도 다음과 같이 바꾼 후

<Directory "/home/httpd/html">

..............

</ Directory>

apachectl restart로 다시 시작했는데, 외부에서 접속해보면 다음 에러 메세지가 뜹니다.

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

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

뭔가 permission의 문제가 있는 것 같은데 어떻게 수정해야 하는지요?

일단 아파치가 돌아가는 계정(보통 nobody나 apache)을 httpd.conf의 User/Group 항목에서 확인한 후 해당 계정과 그룹에 /home/httpd/html까지 들어갈 수 있는 권한을 주시면 됩니다.

그럼~

----------------------------
[서명] 그놈 한국 사용자 모임 - 그놈에 대한 모든 것! - 게시판, IRC, 위키, 갤러리 등등...

pilspark의 이미지

/home이 막혀 있는지 모르고 괜히 엉뚱한 Apache 설정 file만 들여다 봤으니...