Views 51368 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
1. 포트(Port) 알리아싱

    $ vi /usr/local/apache/conf/http.conf
       Listen 9090
       <VirtualHost _default_:9090>
            DocumentRoot /usr/local/apache/htdocs/Hotel
       </VirtualHost> 


2. 주소(IP) 알리아싱 - IP 주소는 다르고 도메인 이름이 다른경우

    $ ifconfig eth0:0 172.20..7.203
    $ ifconfig eth0:1 172.20..7.204
    $ ifconfig eth0:2 172.20..7.205


3. 도메인(Domain) 알리아싱 - IP 주소는 하나인데 도메인 이름이 다른경우

    도메인 네임서버에 요청하여 서로다른 이름이라 할지라도 같은 IP 주소를 가리키게 할 수있다. 
    단지 도메인 네임 서버( /etc/resolve.conf /etc/host.conf) 에 제대로 이름을 등록하면 된다.

    httpd.conf에 가상 호스트 한경을 설정한다.
    
    NameVirtualHost www.modelhouses.co.kr
    
    <VirtualHost www.modelhouses.co.kr>
    DocumentRoot /usr/local/apache/htdocs/www.modelhouses.co.kr
    ServerName www.modelhouses.co.kr
    ServerAlias modelhouses.co.kr *.modelhouses.co.kr
    ServerAdmin n639@localhost
    ErrorLog /var/log/www.modelhouses.co.kr.log
    TransferLog /var/log/www.modelhouses.co.kr.log
    </VirtualHost>
    
    
    추가설명 :  도메인네임 대신 IP가 올수 있다. NameVirtualHost 111.22.33.44 <VirtualHost 111.22.33.44>
                        DocumentRoot   웹루트
                            ServerName   서버이름
                            ServerAlias   유사한 도메인
                            ServerAdmin  메일
                            ErrorLog   로그기록 남길곳
                            TransferLog
                            
            - 특정문서로 시작되게하기.
        DocumentRoot /usr/local/apache/htdocs/www.modelhouses.co.kr
        RewriteEngine On
        RewriteRule ^/.* /usr/local/apache/htdocs/www.modelhouses.co.kr/index.html

        - 서브디렉토리에서 시작되게 하기.
        DocumentRoot /usr/local/apache/htdocs/www.modelhouses.co.kr/subdir
        ServerName www.modelhouses.co.kr
        ServerPath /subdir/
        RewriteEngine On
        RewriteRule ^(/subdir/.*) /usr/local/apache/htdocs/www.modelhouses.co.kr$1 
        
        사용자가 www.modelhouses.co.kr 를 요청하면 ServerPath 에 의해 /subdir 로 넘어 가고 
        또 RewriteRule 에 의해 결국은 원래 DocumentRoot 에 설정되어져 있는 디렉토리로 넘어간다는 것이다. 
        ^(/sub2/.*) /usr/local/apache/htdocs/www.modelhouses.co.kr/subdir가 된다. 
        Rewrite 모듈을 사용함으로써 클라이언트가 확실히 접속할 수 있도록 해주고 있다.

?

List of Articles
No. Category Subject Author Date Views
58 System/OS [linux] CentOS Apache Httpd에 https 적용 hooni 2014.03.05 4480
57 System/OS [linux] 쉘스크립트 expr hooni 2014.03.11 15618
56 System/OS [linux] awk 명령어 hooni 2014.03.11 4955
55 System/OS [linux] split 명령어 hooni 2014.03.11 4305
54 System/OS HTTPS와 SSL 인증서 file hooni 2014.03.11 7546
53 System/OS [mac] 맥OSX에서 NTFS 쓰기 기능 활성화 hooni 2014.03.12 4286
52 System/OS [mac] 맥(OSX)에서 NTFS, 윈도우에서 HFS+ 사용하기 file hooni 2014.03.12 5117
51 System/OS [linux] CentOS 6.5 에서 "Bringing up interface eth0: Determining if ip address 121.78.127.197 is already in use for device eth0..." hooni 2014.04.05 4838
50 System/OS [linux] resolv.con 초기화 되는 문제 hooni 2014.04.05 4616
49 System/OS [linux] yum 업데이트 시 커널 제외하기 hooni 2014.09.11 1258
48 System/OS SVN(Subversion) 설치와 설정 (sasl 인증 적용 포함) file hooni 2014.09.11 5666
47 System/OS [svn] SVN trunk 변경사항 되돌리기 (SVN Rollback) hooni 2014.11.27 1564
46 System/OS [svn] Can't convert string from native encoding to 'UTF-8' 메시지가 나오는 경우 hooni 2014.12.18 993
45 System/OS iptime 공유기 해킹 기술문서 4 file hooni 2015.01.01 1941
44 System/OS [svn] 하나의 SVN에서 멀티 저장소 (One svnserve, multiple repositories) hooni 2015.01.02 1549
43 System/OS CentOS 에서 Cacti 설치하기 hooni 2015.01.02 1762
Board Pagination Prev 1 ... 8 9 10 11 12 13 Next
/ 13