Contents

Views 51368 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
202 System/OS 해커스랩 깨기.. 후후.. ㅋㅋ file hooni 2013.04.23 18413
201 System/OS 콘솔에서 패스워드 걸린 zip 압축하는 명령 hooni 2018.03.02 937
200 System/OS 컴파일러 수업 자료(교재 : 컴파일러 입문) file hooni 2003.04.23 21966
199 System/OS 아파치(Apache) 인증사용(htaccess)으로 특정 디렉토리에 암호걸기 hooni 2013.04.23 13659
198 System/OS 서버 확장을 위한 두 가지 방법 file hooni 2018.08.29 2098
197 System/OS 무선 인증 서버.. 김도.. ㅋㅋ file hooni 2013.04.23 17595
196 System/OS 무료로 HTTPS 적용하기 (Lets' Encrypt) file hooni 2017.02.16 2174
195 System/OS 무료로 HTTPS 적용하기 (Let's Encrypt) file hooni 2017.10.28 1401
194 System/OS 맥에서 포트 확인하고 닫기 (mac) hooni 2022.03.22 890
193 System/OS 맥에서 파일공유 (윈도우,맥) file hooni 2013.04.25 37301
192 System/OS 맥북에서 MAC/윈도우 멀티부팅시 시간 설정 file hooni 2013.04.23 29759
191 System/OS 맥 OS X 에서 스크린 화면 캡쳐 단축키 (Mac Print Screen) hooni 2015.07.21 1898
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17