2017. 1. 10. 21:17 Linux Server/apache
[apache] 모듈 userdir
[userdir 모듈]
아파치를 사용하다보면 도메인 없이 여러개의 사이트를 구축하고 확인을 해보아야 할떄가 있다.
사용자 계정별로 디렉토리가 있으며, 사이트가 여러개가 있는 환경일 경우
mod_userdir 을 사용하면된다.
# ll /usr/local/apache/modules/ -> 해당 경로에 mod_userdir.so 모듈이 존재하는지 확인 (없을경우 설치)
# vi /usr/local/apache/conf/httpd.conf -> 해당 파일 열어서 주석처리 해제
#LoadModule userdir_module modules/mod_userdir.so -> 해당문구 주석처리 해제
#Include conf/extra/httpd-userdir.conf -> 해당문구 주석처리 해제
# vi /usr/local/apache/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
Require method GET POST OPTIONS
</Directory>
# /etc/init.d/apachectl restart -> 설정 마친 후 아파치 재시작
위처럼 설정을 마친후 사용자 디렉토리에 public_html 이라는 디렉터리를 만들고, 그 안에 소스파일을 넣어주면됨.
ex)
# mkdir /home/les/public_html
# vi index.html -> 해당 명령어로 해당파일 생성후 아래처럼 아무렇게나 글씨 작성
asdfkjlhasdfjkasdfh
url 에 아이피/~les 적으면 asdfkjlhasdfjkasdfh 이런식으로 나옴 (해당계정에 대한 페이지가 뜸)
'Linux Server > apache' 카테고리의 다른 글
[php 언어셋 문제] (0) | 2017.05.09 |
---|---|
[apache] cband 모듈설치 (0) | 2017.04.27 |
[apache] rewrite 모듈을 이용한 http -> https 포워딩 (0) | 2017.04.26 |
[apache] apache 소스설치 (2.4.3) (0) | 2016.09.21 |
[apache] mod_rewrite 설치 (0) | 2016.09.14 |