리눅스상 아파치에 Alias 로 여러가지 폴더별 경로 지정하기

Posted by Albert 4872Day 18Hour 2Min 1Sec ago [2011-12-18]

우선 테스트 하기위하여 사용자를 추가한다.

[root@localhost users]' mkdir /a /b

[root@localhost users]' useradd -d /a/albert1 albert1

[root@localhost users]' useradd -d /b/albert2 albert2
[root@localhost /]' tail -2 /etc/passwd
albert:x:505:506::/a/albert1:/bin/bash
albert2:x:506:507::/b/albert2:/bin/bash

사용자 계정 생성후 

[root@localhost /]' vi /etc/httpd/conf/httpd.conf

위명령을 실행하여 httpd.conf 파일에서 아래와 같은 항목을 추가하면 된다.

    Alias /user1/ "/a/albert1/"

    Alias /user2/ "/b/albert2/"

        Options FollowSymLinks

        AllowOverride None

        Order allow,deny

        Allow from all

        Options FollowSymLinks

        AllowOverride None

        Order allow,deny

        Allow from all



설정저장후 
[root@localhost /]' service httpd restart
httpd 아파치서버를 재부팅하면  httpd://domain/user1/   과 httpd://domain/user2/  페이지에서 내용을 확인할수있다.




LIST

Copyright © 2014 visionboy.me All Right Reserved.