간혹 고객들 중에 “도메인 뒤에 계정이 있는 디렉토리로 연결되게 해주세요” 라는 요청이 있으면 처음 듣는 사람은 엄청 당혹 스럽습니다.
아래의 내용은 이러한 설정 방법에 대한 내용 입니다.
http://IP또는도메인/~계정 // 이렇게 접속하면 /home/계정/ 디렉토리로 접속이 된다.
[root@localhost /]# vi /usr/local/apache/conf/httpd.conf 에서
아래의 내용 주석 삭제
Include conf/extra/httpd-userdir.conf
UserDir /home/
[root@localhost /]# vi /usr/local/apache/conf/extra/httpd-userdir.conf
# Settings for user home directories
#
# Required module: mod_userdir
#
# UserDir: The name of the directory that is appended onto a user’s home
# directory if a ~user request is received. Note that you must also set
# the default access control for these directories, as in the example below.
#
UserDir /public_html/ 을 아래와 같이 수정
UserDir /home/ // 이 설정은 본인의 home/ 즉 웹소스가 있는 경로로 지정을 해준다.
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory “/home/*”> // 변경
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>
[root@localhost /]# /etc/init.d/apachectl restart // 아파치 재시작
http://접속도메인/~들어갈 디렉토리 명/
ex)
[root@localhost youmust]# cd /home/youmust/
[root@localhost youmust]# ll
total 8260
drwxr-xr-x 10 root root 20480 Jun 18 15:28 ./
drwxr-xr-x. 5 root root 4096 Apr 7 15:17 ../
-rw-r–r– 1 root root 17563 Jan 27 20:09 1
drwxr-xr-x 2 youmust users 4096 Mar 12 2014 HomeWork/
drwxr-xr-x 5 youmust users 4096 Jan 23 2014 Maildir/
-rw-r–r– 1 youmust users 1094886 Mar 4 2014 TFT????????????_????????????.pdf
-rw-r–r– 1 youmust users 21356 Nov 7 2014 Windows2008_???????????????_????????????.odt
-rw-r–r– 1 youmust users 34092 May 7 2014 apm_setup_script1.sh
drwxr-xr-x 2 youmust users 4096 May 9 2014 eaccelerator/
drwxr-xr-x 14 root root 4096 Apr 7 14:50 gnu/
drwx—rwx 4 root root 4096 Dec 16 2013 mrtg/
-rw-r–r– 1 root root 3048 Jul 4 2014 mrtg-l.png
-rw-r–r– 1 root root 3048 Jul 4 2014 mrtg-m.png
-rw-r–r– 1 root root 3048 Jul 4 2014 mrtg-r.png
drwxr-xr-x 5 root root 4096 Apr 7 15:20 wordpress/
-rw-r–r– 1 root root 7159143 Feb 19 08:42 wordpress-4.1.1-ko_KR.zip
drwx—rwx 20 root root 4096 Jun 4 13:22 xe/
drwxr-xr-x 2 root root 20480 Dec 27 2013 youmust/
-rw-r–r– 1 youmust users 27986 Mar 11 2014 ??????????????? ??????(0316??????).ods
-rw-r–r– 1 youmust users 1073 Mar 16 2014 ???????????? ??? apm config ??????.txt
http://dbjara.com/~youmust/ —> 로 접속 하면 아래와 같이 내용이 나온다.