Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
docs:apache_web_server:virtual_hosts [2008/08/03 00:25] – external edit 127.0.0.1 | docs:apache_web_server:virtual_hosts [2016/03/27 14:10] (current) – removed billh | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Virtual Hosts ====== | ||
- | ===== httpd.conf ===== | ||
- | * virtual hosts (find and uncomment this line)< | ||
- | # Virtual hosts | ||
- | Include conf/ | ||
- | </ | ||
- | |||
- | ===== hosts file or dns configuration ===== | ||
- | * add hostname and ip combinations< | ||
- | 192.168.1.1 | ||
- | 192.168.1.1 | ||
- | </ | ||
- | |||
- | ===== httpd-vhosts.conf ===== | ||
- | * virtual hosts< | ||
- | # | ||
- | # Virtual Hosts | ||
- | # | ||
- | # If you want to maintain multiple domains/ | ||
- | # machine you can setup VirtualHost containers for them. Most configurations | ||
- | # use only name-based virtual hosts so the server doesn' | ||
- | # IP addresses. This is indicated by the asterisks in the directives below. | ||
- | # | ||
- | # Please see the documentation at | ||
- | # < | ||
- | # for further details before you try to setup virtual hosts. | ||
- | # | ||
- | # You may use the command line option ' | ||
- | # configuration. | ||
- | |||
- | # | ||
- | # Use name-based virtual hosting. | ||
- | # | ||
- | NameVirtualHost *:80 | ||
- | |||
- | # | ||
- | # VirtualHost example: | ||
- | # Almost any Apache directive may go into a VirtualHost container. | ||
- | # The first VirtualHost section is used for all requests that do not | ||
- | # match a ServerName or ServerAlias in any < | ||
- | # | ||
- | #< | ||
- | # ServerAdmin webmaster@dummy-host.example.com | ||
- | # DocumentRoot "/ | ||
- | # ServerName dummy-host.example.com | ||
- | # ServerAlias www.dummy-host.example.com | ||
- | # ErrorLog " | ||
- | # CustomLog " | ||
- | #</ | ||
- | # | ||
- | #< | ||
- | # ServerAdmin webmaster@dummy-host2.example.com | ||
- | # DocumentRoot "/ | ||
- | # ServerName dummy-host2.example.com | ||
- | # ErrorLog " | ||
- | # CustomLog " | ||
- | #</ | ||
- | |||
- | |||
- | < | ||
- | DocumentRoot "/ | ||
- | ServerName localhost | ||
- | </ | ||
- | |||
- | < | ||
- | DocumentRoot "/ | ||
- | ServerName www.example.local | ||
- | ServerAlias example.local | ||
- | </ | ||
- | |||
- | </ |