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
170 System/OS [linux] apache, php, jsp 환경설정하기.. hooni 2003.04.23 15237
169 System/OS [linux] APM(apache, php, mysql) + gd 설치순서.. hooni 2003.04.23 18851
168 System/OS [linux] awk 명령어 hooni 2014.03.11 4955
167 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 4843
166 System/OS [linux] CentOS 6.x Cati 설치 (yum) hooni 2014.01.17 48594
165 System/OS [linux] CentOS Apache Httpd에 https 적용 hooni 2014.03.05 4480
164 System/OS [linux] CentOS 에 APM 설치하기 hooni 2015.01.02 1692
163 System/OS [linux] CentOS 터미널 언어 설정(한글/영어) hooni 2013.12.22 18513
162 System/OS [linux] DHCP(Dynamic Host Configuration Protocol) 서버 hooni 2003.04.23 13023
161 System/OS [linux] DNS(Domain Name System) 설치, 설정 hooni 2003.04.23 12438
160 System/OS [linux] GD 라이브러리 설치 방법.. file hooni 2013.04.23 11373
159 System/OS [linux] iconv를 이용하여 euc-kr 문서를 utf-8로 대량으로 변환하기 file hooni 2014.01.09 12219
158 System/OS [linux] ipchains 사용예(패킷 필터링) hooni 2003.04.23 14175
157 System/OS [linux] ipchains 옵션 hooni 2003.04.23 13615
156 System/OS [linux] ipfwadm를 이용한 패킷필터링(구버전) hooni 2003.04.23 13019
155 System/OS [linux] iptables 명령어 매뉴얼(options) hooni 2003.04.23 11339
Board Pagination Prev 1 2 3 4 5 ... 13 Next
/ 13