绑定域名
NameVirtualHost *:80 <VirtualHost *:80>ServerName www.server110.com
DocumentRoot "C:/web"
ServerAlias www.server110.com pic.server110.com #多个不同域名用空格隔开
</VirtualHost>
注:配置文件一定要有这一行NameVirtualHost *:80,如果只有<VirtualHost》结点,则绑定的域名不起作用,仍然是以IP为基础访问的。 NameVirtualHost *:80 <VirtualHost *:80>
ServerName 76.164.231.214
ProxyPass / ajp://127.0.0.1:8009/
ProxyPassReverse / ajp://127.0.0.1:8009/
DirectoryIndex index.jsp
</VirtualHost> <VirtualHost *:80>
ServerName www.server110.com #ProxyPass / http://76.164.231.214:82
#ProxyPassReverse / http://76.164.231.214:82
ProxyPass / ajp://127.0.0.1:8209/
ProxyPassReverse / ajp://127.0.0.1:8209/
</VirtualHost> 如果绑定不起作用,可能启用了ProxyPass 却.没有开放相关MODEL,在HTTPD.CONF中. 可以查看日志.会有提示.
如果觉得《apache设置域名绑定教程》不错,可用分享工具分享给您的朋友!