[Apache] 디렉토리임에도 DocumentRoot 에러 날 때 > 기술자료

본문 바로가기

사이트 내 전체검색

[Apache] 디렉토리임에도 DocumentRoot 에러 날 때 > 기술자료

Linux [Apache] 디렉토리임에도 DocumentRoot 에러 날 때

페이지 정보


본문

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

아파치의  httpd.conf 에서  기본 폴더를 변경후 위와 같은 오류가 발생할때


아파치 웹서버의 저장소 위치를 /var/www/html/  에서 /home/MyID/www/html 로 변경하고자 합니다.
기존의 알려진 방법에 의하면

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
# DocumentRoot "/var/www/html"
DocumentRoot "/home/MyID/www"

이 부분과

# This should be changed to whatever you set DocumentRoot to.
#
# <Directory "/var/www/html">
<Directory "/home/MyID/www">

을 변경을 해주면 됩니다. 하지만 다음과 같은 에러가 발생할 것입니다.

[root@localhost selinux]# /etc/init.d/httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: Syntax error on line 275 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
                                                           [FAILED]
[root@localhost selinux]#


문제는 SELinux 보안 정책때문에 해당 디렉토리가 있음에도 찾지 못한 것입니다.
아래와 같이 아파치에서 이 디렉토리를 읽을 수 있는 권한을 부여합니다.
( SELinux 참고자료 : http://blworks.textcube.com/69 )

[root@localhost selinux]# chcon -R -t httpd_user_content_t /home/MyID/www


selinux 의 기능을 아래와 같이 OFF합니다.
[root@localhost selinux]# find / -name selinux -print
[root@localhost selinux]# vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
#SELINUX=enforcing
SELINUX=disabled  # 기능 작동을 중단합니다
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted


Seliunx 를 사용하지 않지 않는데도 에러가 난다면...
# vi /usr/local/apache/conf/httpd.conf
...
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all   -->   이것을 사용안하도록 변경  #Deny from all
</Directory>


참고자료
http://www.linux.co.kr/home/superuserboard/view.html?id=1628&code=apache 
http://withover.com/197
http://blworks.textcube.com/69 
http://cafe.naver.com/himss.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=943 
http://blog.naver.com/zezepurr?Redirect=Log&logNo=120031210919

댓글목록

등록된 댓글이 없습니다.


Total 2,644건 97 페이지
  • RSS
기술자료 목록
열람
Linux   32184  2009-06-04 14:32 ~ 2009-08-19 00:00  
723
Linux   13900  2009-06-03 12:52 ~ 2009-11-03 00:00  
722
메이크샵   11791  2009-06-02 05:15  
721
HTML   18742  2009-05-22 10:16  
720
일반   13635  2009-05-20 19:54  
719
일반   32939  2009-05-20 19:00  
718
HTML   24219  2009-05-20 18:42  
717
일반   23767  2009-05-19 19:44 ~ 2009-05-20 00:00  
716
ClassicASP   29783  2009-05-19 13:00  
715
MSSQL   16901  2009-05-08 09:43  
714
MSSQL   18755  2009-05-08 08:28  
713
호스팅   15789  2009-05-06 18:47  
712
호스팅   17605  2009-05-03 13:20 ~ 2011-08-19 00:00  
711
그누보드   12416  2009-05-03 03:26  
710
Linux   13223  2009-05-01 18:15  
709
그누보드   11936  2009-05-01 14:20  
708
호스팅   11968  2009-05-01 12:29  
707
HTML   26779  2009-04-30 12:01 ~ 2013-01-13 00:00  
706
그누보드   12165  2009-04-30 11:12  
705
JavaScript   24700  2009-04-28 12:28  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2025 해피정닷컴. All Rights Reserved.