apache虚拟主机配置
时间:2016-07-29 03:27 来源:linux.it.net.cn 作者:IT
apache虚拟主机配置
1.启用 httpd-vhosts.conf
在 httpd.conf文件中
# Virtual hosts 虚拟主机
Include conf/extra/httpd-vhosts.conf
启用
2.在httpd-vhosts.conf文件中做配置 路径conf/extra/httpd-vhosts.conf
在最后面加上
#配置我们自己的虚拟主机
<VirtualHost 127.0.0.1:80>
DocumentRoot "E:/wamp/www"
#这里配置欢迎首页面
DirectoryIndex index.html index.htm index.php
<Directory />
Options FollowSymLinks
#不许可别人修改我们的页面
AllowOverride None
#设置访问权限
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
3.修改hosts 文件 路径 C:\Windows\System32\Drivers\etc (注:浏览器寻找域名是 先找hosts文件下 找不到然后到dns上找)
后面加上 127.0.0.1 www.flydream.com 域名自己定义 (责任编辑:IT)
apache虚拟主机配置 1.启用 httpd-vhosts.conf 在 httpd.conf文件中 # Virtual hosts 虚拟主机 Include conf/extra/httpd-vhosts.conf 启用 2.在httpd-vhosts.conf文件中做配置 路径conf/extra/httpd-vhosts.conf 在最后面加上 #配置我们自己的虚拟主机 <VirtualHost 127.0.0.1:80> DocumentRoot "E:/wamp/www" #这里配置欢迎首页面 DirectoryIndex index.html index.htm index.php <Directory /> Options FollowSymLinks #不许可别人修改我们的页面 AllowOverride None #设置访问权限 Order allow,deny Allow from all </Directory> </VirtualHost> 3.修改hosts 文件 路径 C:\Windows\System32\Drivers\etc (注:浏览器寻找域名是 先找hosts文件下 找不到然后到dns上找) 后面加上 127.0.0.1 www.flydream.com 域名自己定义 (责任编辑:IT) |