码迷,mamicode.com
首页 > 其他好文 > 详细

配置虚拟主机

时间:2015-08-07 16:29:27      阅读:88      评论:0      收藏:0      [点我收藏+]

标签:配置虚拟主机

配置虚拟主机

  1. 在apache的httpd.conf文件末添加如下代码:

<VirtualHost *:80>

 ServerName 修改成自己的域名

 DocumentRoot "修改成自己的项目路径"

 <Directory "修改成自己的项目路径"> 

  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 All

  Order Deny,Allow 

  Allow from all 

 </Directory>

</VirtualHost>

示例:

 说明:www.ff.com 是我自己预定义的域名

<VirtualHost *:80>

 ServerName www.ff.com

 DocumentRoot "E:/wamp/www/demo"

<Directory "E:/wamp/www/demo"> 

 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 All

 Order Deny,Allow 

 Allow from all 

</Directory>

</VirtualHost>

在系统文件C:\Windows\System32\drivers\etc\hosts中添加如下配置

127.0.0.1 www.ff.com

本文出自 “素颜” 博客,请务必保留此出处http://suyanzhu.blog.51cto.com/8050189/1682636

配置虚拟主机

标签:配置虚拟主机

原文地址:http://suyanzhu.blog.51cto.com/8050189/1682636

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!