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] CentOS 에 APM 설치하기 hooni 2015.01.02 1688
169 System/OS CentOS 에서 Cacti 설치하기 hooni 2015.01.02 1762
168 System/OS [mac] 맥에서 기본 실행 앱 변경하기 file hooni 2018.03.02 1804
167 System/OS 맥 OS X 에서 스크린 화면 캡쳐 단축키 (Mac Print Screen) hooni 2015.07.21 1898
166 System/OS iptime 공유기 해킹 기술문서 4 file hooni 2015.01.01 1941
165 System/OS 서버 확장을 위한 두 가지 방법 file hooni 2018.08.29 2098
164 System/OS [mac][추천 무료앱] 구름 입력기 - 국내 맥 사용자를 위한 한글 대안 입력기 1 file hooni 2015.01.04 2148
163 System/OS 무료로 HTTPS 적용하기 (Lets' Encrypt) file hooni 2017.02.16 2174
162 System/OS Apache CORS 설정 1 hooni 2020.09.04 2710
161 System/OS How to Setup an Email Server on CentOS 7 hooni 2018.04.05 2779
160 System/OS [android] 초간단 HTTP, POST 전송 샘플 1 file hooni 2017.02.16 3449
159 System/OS Mac에서 Node.js 설치하기 file hooni 2018.09.28 4187
158 System/OS [mac] 맥OSX에서 NTFS 쓰기 기능 활성화 hooni 2014.03.12 4286
157 System/OS [linux] split 명령어 hooni 2014.03.11 4305
156 System/OS [linux] 초간단 SquirrelMail 설치/설정 (다람쥐 메일) hooni 2017.12.11 4457
155 System/OS [linux] CentOS Apache Httpd에 https 적용 hooni 2014.03.05 4478
Board Pagination Prev 1 2 3 4 5 ... 13 Next
/ 13