Apache Virtual Host
000-default 의 기본 설정이라면
<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>
두번째 가상 서버는 별도의 파일로 다음과 같이 해준다.
<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>
chat.vaslor.net 으로 접속하는 경우 /home/www/chat 으로 가게 되고 나머지는 첫 서버로 간다.
where is other_vhosts_access.log configured?
etc/apache2/conf.d/other-vhost-access-log
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined
Comment out the last line.
| 누구나 수정하실 수 있습니다. 문법은 Formatting Syntax참조하세요. |
|---|