차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
tech:apache_virtual_host [2012/10/03 13:12] – 새로 만듦 14.32.18.124tech:apache_virtual_host [2016/07/12 09:26] (현재) – 바깥 편집 127.0.0.1
줄 1: 줄 1:
 +{{tag>apache_virtual_host}}
 +======Apache Virtual Host======
 +
 +
 +
 +000-default 의 기본 설정이라면 
 +
 +<code config>
 +<VirtualHost *:80>
 +        ServerAdmin webmaster@localhost
 +
 +        DocumentRoot /home/www/html
 +        ServerName m.vaslor.net
 +        <Directory />
 +                Options FollowSymLinks
 +                AllowOverride None
 +        </Directory>
 +        <Directory /home/www/html>
 +                Options Indexes FollowSymLinks MultiViews
 +                AllowOverride None
 +                Order allow,deny
 +                allow from all
 +        </Directory>
 +
 +        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
 +        <Directory "/usr/lib/cgi-bin">
 +                AllowOverride None
 +                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
 +                Order allow,deny
 +                Allow from all
 +        </Directory>
 +
 +        ErrorLog ${APACHE_LOG_DIR}/error.log
 +
 +        # Possible values include: debug, info, notice, warn, error, crit,
 +        # alert, emerg.
 +        LogLevel warn
 +
 +        CustomLog ${APACHE_LOG_DIR}/access.log combined
 +
 +    Alias /doc/ "/usr/share/doc/"
 +    <Directory "/usr/share/doc/">
 +        Options Indexes MultiViews FollowSymLinks
 +        AllowOverride None
 +        Order deny,allow
 +        Deny from all
 +        Allow from 127.0.0.0/255.0.0.0 ::1/128
 +    </Directory>
 +
 +</VirtualHost>
 +</code>
 +
 +두번째 가상 서버는 별도의 파일로 다음과 같이 해준다.
 +
 +<code>
 +<VirtualHost *:80>
 +        ServerAdmin webmaster@localhost
 +
 +        DocumentRoot /home/www/chat
 +        ServerName chat.vaslor.net
 +        <Directory />
 +                Options FollowSymLinks
 +                AllowOverride None
 +        </Directory>
 +        <Directory /home/www/chat>
 +                Options Indexes FollowSymLinks MultiViews
 +                AllowOverride None
 +                Order allow,deny
 +                allow from all
 +        </Directory>
 +
 +        LogLevel warn
 +
 +
 +</VirtualHost>
 +
 +</code>
 +
 +chat.vaslor.net 으로 접속하는 경우 /home/www/chat 으로 가게 되고 나머지는 첫 서버로 간다.
 +
 +
 +
 +  * http://cafe.naver.com/webprogrammer2/118
 +
 +=====where is other_vhosts_access.log configured?=====
 +etc/apache2/conf.d/other-vhost-access-log
 +
 +<code># Define an access log for VirtualHosts that don't define their own logfile
 +CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined</code>
 +
 +
 +Comment out the last line.
 +
 +
 +^  누구나 수정하실 수 있습니다.  문법은 [[wiki:syntax]]참조하세요. ^
 +