方法1:
D:\wamp\bin\apache\Apache2.2.17\conf\httpd.conf文件下
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
下添加如下
NameVirtualHost *:80
<VirtualHost *:80>
ServerName aa.test.com
DocumentRoot "D:\wamp\www\test\aa"
<Directory "D:\wamp\www\test\aa">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
NameVirtualHost *:80
<VirtualHost *:80>
ServerName bb.test.com
DocumentRoot "D:\wamp\www\test\bb"
<Directory "D:\wamp\www\test\bb">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
方法2:
1.wamp\bin\apache\Apache2.2.17\conf 下编辑httpd.conf 将Include conf/extra/httpd-vhosts.conf,把前面注释符号“#”删掉。
2.编辑httpd-vhosts.conf,我把WAMPServer安装在D:/wamp,所以我这里的路径是D:\wamp\Apache2\conf \extra。
把里面的内容清空掉,换成下面的内容:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.host1.com
ServerAlias www.host1.com
DocumentRoot "D:/wamp/www/host1"
</VirtualHost>
<Directory "d:/wamp/www/host1">
Options Indexes FollowSymLinks
AllowOverride allOrder Allow,Deny
Allow from all
</Directory>
4.修改C:/WINDOWS/system3/drivers/etc/host这个文件,用记事本打开,加上如下内容:
127.0.0.1 www.host1.com
5.重启apache ok了
相关推荐
Apache站点绑定多个域名,用ServerAlias ,Apache站点绑定多个域名,用ServerAlias ,
关于apache域名绑定问题,Apache通过Rewrite实现绑定多个域名,如何在一个空间上建立多个相互独立的网站,怎样在一个虚拟主机空间上放多个网站,在一个服务器上设置多个网站
最近新装了个OJ系统,想着总是用ip访问挺难记得,就打算绑一个域名上去。在配置的过程中也遇到了一些问题,现在总结下面来分享给大家,方便有需要的朋友们参考学习。 方法如下 网上百度了很多教程,发现大家都是在...
apache设置域名绑定.docx
apache设置域名绑定 以及绑定不起作用的排查.docx
apache+tomcat整合以及域名绑定,教你发布javaweb网站
主要介绍了Lamp环境下设置绑定apache域名的方法,简单分析了Lamp环境下的Apache域名绑定设置相关属性、功能与操作技巧,需要的朋友可以参考下
apache 设置主机头,同一端口绑定多个域名和网站
这个是跟之前的一个个资源配套使用的,Linux PHP环境安装(可以查看我的资源),环境主要为Linux+Apache+PHP+MySQL,安装好环境以后,可以通过这个简单的配置,支持服务器多项目多域名的支持,只是简单的教程,仅供...
apache配置,只允许域名访问,不允许ip访问
【1】 打开文件路径:C:\Windows\System32\drivers\etc,修改hosts文件如下:【2】 打开路径:C:\wamp64\bin\apache\apache2.4.23\conf\original,打开httpd.conf文件,搜索 “Include conf/extra/httpd-vhosts.conf...
PHP服务器上配置apache绑定多域名[参考].pdf
一台服务器安装了APACHE,如何绑定多个域名和网站内容呢?最简单的方法当然就是不同的站用不同的端口。但这样就需在域名后加入端口号才能访问,不能直接以域名访问。另一个方法就是使用主机头名虚所主机了。打开...
主要为大家详细介绍了CentOS服务器apache绑定多个域名的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
apache+tomcat域名泛解析
windows2003下apache配置虚拟主机和绑定域名服务
配置环境 系统:win7 PHP版本:5.3.x MYSQL 版本:5.0.27 Apache:2.2.4 (Win32) 设置方法: 打开D:\wamp\bin\apache\Apache2.2.17\conf\httpd.conf 在最后添加 NameVirtualHost *:80 <VirtualHost> DocumentRoot “D:...
apache:一个ip绑定多个域名的问题 基于IP的虚拟主机使用连接的IP地址来决定相应的虚拟主机。这样,你就需要为每个虚拟主机分配一个独立的IP地址。 而基于域名的虚拟主机是根据客户端提交的HTTP头中标识主机名的...