看官方文档:
http://httpd.apache.org/docs/2.2/vhosts/name-based.html
示例:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
不熟悉的直接在 httpd.conf 结尾贴上上面一段就就好了。
不要问 * 指代什么,它不指代什么, * 就是 *,照着打就是了。
只需要修改 ServerName 为你自己想要的域名,DocumentRoot 为你想设定的 根目录值就好了。
更多的什么 CustomLog ErrorLog,自己照着写吧。