<-
Apache > HTTP Server > Documentation > Version 2.2 > How-To / Tutorials

Please note

This document refers to a legacy release (2.2) of Apache httpd. The active release (2.4) is documented here. If you have not already upgraded, please follow this link for more information.

You may follow this link to go to the current version of this document.

사용자별 웹디렉토리

가능한 언어:  en  |  ja  |  ko  |  tr 

이 문서는 최신판 번역이 아닙니다. 최근에 변경된 내용은 영어 문서를 참고하세요.

여러 사용자가 있는 시스템에서 UserDir 지시어를 사용하면 각 사용자는 자신의 홈디렉토리 안에 웹사이트를 만들 수 있다. URL http://example.com/~username/에 접근하면 사용자 "username"의 홈디렉토리에서 UserDir 지시어로 지정한 하위디렉토리에 있는 페이지를 가져오게 된다.

참고

top

사용자별 웹디렉토리

top

UserDir로 파일경로 지정하기

UserDir 지시어는 사용자별 페이지를 가져올 디렉토리를 지정한다. 이 지시어의 사용법은 여러가지다.

슬래쉬로 시작하지않는 경로를 지정하면 각 사용자의 홈디렉토리에 상대적인 디렉토리 경로로 처리한다. 예를 들어, 아래 설정의 경우:

UserDir public_html

URL http://example.com/~rbowen/file.html은 파일 경로 /home/rbowen/public_html/file.html을 뜻한다.

슬래쉬로 시작하는 경로를 지정하면 지정한 디렉토리에 사용자명을 더한 디렉토리 경로를 사용한다. 예를 들어, 아래 설정의 경우:

UserDir /var/html

URL http://example.com/~rbowen/file.html은 파일 경로 /var/html/rbowen/file.html을 뜻한다.

별표 (*)를 포함한 경로를 지정하면 별표를 사용자명으로 대체한 경로를 사용한다. 예를 들어, 아래 설정의 경우:

UserDir /var/www/*/docs

URL http://example.com/~rbowen/file.html은 파일 경로 /var/www/rbowen/docs/file.html을 뜻한다.

top

기능을 이용할 사용자 제한하기

UserDir 문서에 있는 문법을 사용하여 사용자별 웹디렉토리 기능을 이용할 수 있는 사용자를 제한할 수 있다:

UserDir enabled
UserDir disabled root jro fish

위 설정은 disabled 문장에 열거한 사람을 제외하고 모든 사용자에게 웹디렉토리 기능을 허락한다. 또, 다음과 같이 몇몇 사용자를 제외하고 기능을 허락하지 않을 수도 있다:

UserDir disabled
UserDir enabled rbowen krietz

UserDir 문서에 있는 다른 예들도 참고하라.

top

각 사용자별 cgi 디렉토리 지정하기

사용자마다 cgi-bin 디렉토리를 부여하려면 <Directory> 지시어를 사용하여 사용자 홈디렉토리의 특정 하위디렉토리를 cgi 가능하게 만든다.

<Directory /home/*/public_html/cgi-bin/>
Options ExecCGI
SetHandler cgi-script
</Directory>

UserDirpublic_html이라고 가정하면, 다음과 같이 그 안에 있는 cgi 프로그램 example.cgi를 실행할 수 있다.

http://example.com/~rbowen/cgi-bin/example.cgi

top

사용자가 설정을 변경할 수 있도록 만들기

사용자가 자신의 웹공간에 대한 웹서버 설정을 수정하려면, .htaccess 파일을 사용할 수 있어야 한다. AllowOverride를 사용자가 수정할 수 있는 지시어에 적합한 값으로 설정하라. 어떻게 동작하는지에 대한 자세한 졍보는 .htaccess 투토리얼을 참고하라.

가능한 언어:  en  |  ja  |  ko  |  tr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.
Comments are disabled for this page at the moment.