[질문]리눅스 사용자 웹디렉토리 권한 설정(apache)
글쓴이: dictions / 작성시간: 수, 2007/03/07 - 2:40오전
사용자 웹디렉토리를 사용하기 위해 httpd.conf의 UserDir을 설정하고 홈디렉토리 권한을 설정 했습니다.
문제는 사용자 웹디렉토리에 접근이 안되는 것입니다.
더 의문스러운건 2개의 계정을 똑같이 권한 설정 했는데 하나는 되고 하나는 안됩니다.
사용자 웹디렉토리를 사용하기 위해 httpd.conf를 설정 했습니다.
#httpd.conf
<IfModule mod_userdir.c>
UserDir public_html
</IfModule>사용자 홈디렉토리 권한을 설정합니다. (711)
drwxr-xr-x 6 root root 4096 Mar 6 23:56 . drwxr-xr-x 23 root root 4096 Mar 6 19:13 .. drwx--x--x 22 dictions dictions 4096 Mar 6 22:04 dictions drwx--x--x 4 dow dow 4096 Mar 7 01:53 dow
dictions사용자의 웹 디렉토리 권한을 설정합니다. (755)
[root@gNei home]# la dictions total 18 drwx--x--x 22 dictions dictions 4096 Mar 6 22:04 . drwxr-xr-x 6 root root 4096 Mar 6 23:56 .. drwxr-xr-x 2 dictions dictions 4096 Mar 6 21:34 public_html_na drwxr-xr-x 2 dictions dictions 4096 Mar 6 22:20 public_html [root@gNei home]# [root@gNei home]# la dictions/public_html total 24 drwxr-xr-x 2 dictions dictions 4096 Mar 6 22:20 . drwx--x--x 22 dictions dictions 4096 Mar 6 22:04 .. -rw-r--r-- 1 dictions dictions 131 Mar 6 21:26 index.html
dow사용자의 웹디렉토리 권한을 설정합니다. (755)
[root@gNei home]# la dow total 80 drwx--x--x 4 dow dow 4096 Mar 7 01:53 . drwxr-xr-x 6 root root 4096 Mar 6 23:56 .. drwxr-xr-x 2 dow root 4096 Mar 6 22:16 public_html [root@gNei home]# [root@gNei home]# la dow/public_html total 24 drwxr-xr-x 2 dow root 4096 Mar 6 22:16 . drwx--x--x 4 dow dow 4096 Mar 7 01:53 .. -rw-r--r-- 1 dow root 131 Mar 6 22:16 index.html
dictions/public_html/index.html 접근됨
dictions/pulibc_html_na/index.html 접근 안됨 (디렉토리 이름을 public_html로 바꾸고 접근 시도)
dow/public_html/index.html 접근 안됨
Apache/2.2.3 (Redhat FC6)
아무것도 아닌 실수를 저지른게 아닐까 불안이 엄습합니다. ㅜㅜ
제가 잘 모르고 있는게 있나요? 이렇게 하면 된다고 하던데...
아파치 문서도 찾아보고 여러가지 시도해봤지만 해결 못해서 이렇게 질문 올립니다.
Forums:


Quote: dictions/public_html
어떻게 접근을 하신건지....
브라우저의 주소 줄에 http://localhost/~dictions/index.html, http://localhost/~dow/index.html
라고 입력하시면 접근이 될 것입니다.
한 걸음 더 가까이
원격으로
원격으로 작업하는거라 localhost로 한건 아니고 http://ip/~dictions/index.html로 접근 했습니다.
http://ip/~dow/index.html와
public_html_na를 public_html로 바꾼후 http://ip/~dictions/index.html에 접근하는 것이 403:forbidden 됩니다.
dictions/public_html은 접근 되고 dictions/public_html_na는 안되는걸 봐서는
public_html디렉토리의 무언가가 다른 것 같은데 그걸 모르겠어요...
[자답]chcon으로 디렉토리 설정
디렉토리 권한을 제대로 설정 했는데도 저의 경우처럼 외부에서 인식을 못하는 경우가 있다고 합니다.
그런 경우 chcon으로 해당 디렉토리를 설정해주면 된다고 합니다.
자세히는 모르고 아래의 명령으로 해결 했습니다.