도메인을 소유하고 있지 않은 상태에서, 홈페이지를 띄우거나 자료를 링크할때, http://210.109.102.xxx/~계정 으로 웹 접속을 하거나, 자료를 링크 하는 것을 보신 적이 있을 것입니다.
위와 같이 접속을 하려면 아파치에서 mod_userdir 이 설정되어 있어야 합니다.
mod_userdir 설정하는 방법을 안내해 드리도록 하겠습니다.
1. httpd -l 명령으로 mod_userdir.c 확인
----------------------------------------------------------------------------------
[root@server21010910231 local]# /usr/local/apache2/bin/httpd -l
Compiled in modules:
~~
mod_userdir.c
~~
----------------------------------------------------------------------------------
FD 에서 설치해 드리는 apache에는 기본적으로 mod_userdir.c 가 포함되어 있습니다.
2. /usr/local/apache2/conf/httpd.conf 파일에서 아래 부분을 찾아서 Include부분의 주석을 제거한다.
# User home directories
#Include conf/extra/httpd-userdir.conf -> 주석(#) 제거
httpd.conf 파일에서 #Include conf/extra/httpd-userdir.conf 부분의 주석만 제거한 후 apache 데몬을 리스타트 하면, http://210.109.102.xxx/~계정 으로 웹상에서 접속을 할 수 있습니다.
/usr/local/apache2/conf/extra/httpd-userdir.conf 파일에 아래와 같이 설정된 부분을 확인 할 수 있습니다.
----------------------------------------------------------------------------------
UserDir public_html
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
----------------------------------------------------------------------------------
mod_userdir은 기본적으로 /home/*/public_html 디렉토리에서 동작하게 되어 있습니다.
useradd 명령으로 계정을 생성한 후 계정의 홈 디렉토리내에 public_html 디렉토리를 생성하고 public_html 디렉토리에 홈페이지 자료를 업로드 하게되면, http://210.109.102.xxx/~계정 으로 접속해서 확인을 할 수 있습니다.
- useradd 명령으로 계정을 생성하게되면, 계정의 홈 디렉토리 퍼미션이 기본적으로 700으로 되어 웹상에서 접근이 불가능 합니다. 계정을 생성한 후 웹상에서 접근이 가능하도록 하려면, 계정의 홈 디렉토리 퍼미션을 755나 751 등으로 변경한 후에 mod_userdir 설정을 하면 됩니다.
Trackback Address :: http://fduser.org/blog/trackback/62

