ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Apache V-host 설정
    # WEB | Apache 2024. 1. 23. 14:26

    1. httpd-vhosts.conf 파일 Include

    $ vi [Apache_install_dir]/conf/httpd.conf

     

    # Include conf/extra/httpd-vhosts.conf -> 주석해제

     

    2. vhost 설정파일 작성

    $ vi /sw/web/apache2.4/conf/extra/httpd-vhosts.conf

     

    # aaa.t.com 로 접속하면 /sw/web/apache2.4/webpage 디렉토리의 파일을 읽어서 응답한다는 뜻.
    # VirtualHost 태그의 *은 IP를 의미하고 , NameVirtualHost에서 설정해준 IP와 동일하게 설정해야 한다. 
    
    < VirtualHost *:80>
        DocumentRoot "/sw/web/apache2.4/webpage"
        ServerName aaa.t.com
        ErrorLog "logs/extralog/t.com-error_log"
        CustomLog "logs/extralog/t.com-access_log" common
       <Directory />
        Require all granted
       </Directory>
       JKMount /*.jsp lb
    </VirtualHost>
    
    # Require all granted 는 모든 엑세스의 접근을 허용하는 설정입니다.

     

    3. DocumentRoot 에 index.html 파일 만들기

    $ cd /sw/web/apache2.4/webpage

    $ mkdir index.html

     

     

    4. 로컬 DNS 등록

    메모장의 [파일] – [열기]에서 ‘C:\Windows\System32\drivers\etc’ 경로의 ‘hosts’ 파일 열기

     

     

     

     

    5. apache 서버 재기동 

     

    $ ./[Apache_install_dir]/bin/apachectl restart

     

    6. 페이지 호출 

     

    '# WEB | Apache' 카테고리의 다른 글

    apache workers.properties 옵션  (0) 2025.04.22
    apache jkstatus 상태 테스트  (0) 2025.04.22
    Tomcat-Apache 연동 (mod_proxy_ajp)  (0) 2022.08.19
    Apache-Tomcat 연동 (mod_proxy)  (0) 2022.08.17
    Tomcat Apache 연동 (mod_jk)  (0) 2022.08.12
Designed by Tistory.