Apache VirtualHost 설정 방법
/etc/httpd/conf/httpd.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#NameVirtualHost *:80 NameVirtualHost SERVER_IP:80 #<VirtualHost *:80> # ServerAdmin webmaster@dummy-host.example.com # DocumentRoot /www/docs/dummy-host.example.com # ServerName dummy-host.example.com # ErrorLog logs/dummy-host.example.com-error_log # CustomLog logs/dummy-host.example.com-access_log common #</VirtualHost> <VirtualHost *:80> <VirtualHost HOST_NAME:80> |
위의 셈플을 참고하여 수정한다.
Apache SSL VirtualHost 설정 방법
※아래와 같은 설정은 * SSL을 취득했을때 가능한 방법이다.
/etc/httpd/conf.d/ssl.conf
1 2 3 4 5 6 7 8 9 10 |
NameVirtualHost SERVER_IP:443 #<VirtualHost _default_:443> <VirtualHost SERVER_IP:443> #DocumentRoot "/var/www/html" DocumentRoot "/var/www/html" #ServerName www.example.com:443 ServerName HOST_NAME:443 </VirtualHost> |