Contents

Views 51371 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
34 System/OS CentOS 에서 Cacti 설치하기 hooni 2015.01.02 1770
33 System/OS [linux] CentOS 에 APM 설치하기 hooni 2015.01.02 1696
32 System/OS [svn] SVN trunk 변경사항 되돌리기 (SVN Rollback) hooni 2014.11.27 1565
31 System/OS [svn] 하나의 SVN에서 멀티 저장소 (One svnserve, multiple repositories) hooni 2015.01.02 1549
30 System/OS [mac] OS X 요세미티 사용자가 많이 겪는 버그와 몇몇 불편사항 file hooni 2015.01.04 1534
29 System/OS OpenSSL로 ROOT CA 생성 및 SSL 인증서 발급하기 hooni 2017.10.28 1464
28 System/OS [mac] Mac OS에서 재생되는 사운드를 녹음하는 방법 file hooni 2016.10.03 1448
27 System/OS [linux] wget 명령 사용 예제 hooni 2020.05.26 1448
26 System/OS 무료로 HTTPS 적용하기 (Let's Encrypt) file hooni 2017.10.28 1407
25 System/OS SSH Passwordless Login Using SSH Keygen in 5 Easy Steps file hooni 2019.11.22 1395
24 System/OS RPA란? 어디에 어떻게 쓰이고 누가 만드나? file hooni 2020.01.28 1365
23 System/OS 네트워크 용어 정리 file hooni 2022.11.20 1352
Board Pagination Prev 1 ... 8 9 10 11 12 13 14 15 16 17 Next
/ 17