[질문]리눅스 사용자 웹디렉토리 권한 설정(apache)

dictions의 이미지

사용자 웹디렉토리를 사용하기 위해 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)

아무것도 아닌 실수를 저지른게 아닐까 불안이 엄습합니다. ㅜㅜ
제가 잘 모르고 있는게 있나요? 이렇게 하면 된다고 하던데...

아파치 문서도 찾아보고 여러가지 시도해봤지만 해결 못해서 이렇게 질문 올립니다.

세이군의 이미지

Quote:

dictions/public_html/index.html 접근됨
dictions/pulibc_html_na/index.html 접근 안됨 (디렉토리 이름을 public_html로 바꾸고 접근 시도)
dow/public_html/index.html 접근 안됨

어떻게 접근을 하신건지....

브라우저의 주소 줄에 http://localhost/~dictions/index.html, http://localhost/~dow/index.html
라고 입력하시면 접근이 될 것입니다.

한 걸음 더 가까이

dictions의 이미지

원격으로 작업하는거라 localhost로 한건 아니고 http://ip/~dictions/index.html로 접근 했습니다.

http://ip/~dow/index.html
public_html_na를 public_html로 바꾼후 http://ip/~dictions/index.html에 접근하는 것이 403:forbidden 됩니다.

Forbidden
You don't have permission to access /~dow on this server.
 
 
--------------------------------------------------------------------------------
 
Apache/2.2.3 (Fedora) Server at 210.123.39.232 Port 80

dictions/public_html은 접근 되고 dictions/public_html_na는 안되는걸 봐서는
public_html디렉토리의 무언가가 다른 것 같은데 그걸 모르겠어요...

dictions의 이미지

디렉토리 권한을 제대로 설정 했는데도 저의 경우처럼 외부에서 인식을 못하는 경우가 있다고 합니다.
그런 경우 chcon으로 해당 디렉토리를 설정해주면 된다고 합니다.
자세히는 모르고 아래의 명령으로 해결 했습니다.

[root@gNei home]# chcon -R -t httpd_user_content_t /home/user/public_html

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.