Apache配置虚拟主机(2)
2015-08-18 13:52
976 查看
为了实现像百度那样可以用www.baidu.com访问页面也不是用IP地址访问,在Apache上需要配置如下信息:
1.在httpd.conf文件中开启虚拟主机功能:
2.在conf/extra目录下的httpd-vhosts.conf文件中加入如下代码:
3.C:\Windows\System32\drivers\etc目录下修改host文件,加入IP地址与域名的映射即可
#在win10系统中是不能修改这个文件的,所以要在属性中更改一下文件访问权限即可
1.在httpd.conf文件中开启虚拟主机功能:
2.在conf/extra目录下的httpd-vhosts.conf文件中加入如下代码:
#配置自定义虚拟主机 <VirtualHost 127.0.0.1:80> DocumentRoot "D:/XAMPP/httpd-2.4.16-win64-VC14/MyServer" DirectoryIndex index.html intex.htm index.php <Directory /> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost>
3.C:\Windows\System32\drivers\etc目录下修改host文件,加入IP地址与域名的映射即可
#在win10系统中是不能修改这个文件的,所以要在属性中更改一下文件访问权限即可
相关文章推荐
- (0) 什么是Apache Hadoop
- 2.4.16版本Apache配置虚拟目录(1)
- linux 下 apache启动、停止、重启命令
- 禁止apache显示目录索引的常见方法
- Apache Maven 入门篇(下)
- Apache Maven 入门篇 ( 上 )自己已亲测!!
- Apache性能监控
- Apache Maven 入门篇 ( 上 )
- apache和IIS同时存在,apache建立多个网站
- install Apache Hadoop 2.6.0 in Ubuntu
- Apache 启动失败 VisualSvn 端口占用问题
- [翻译]Apache Spark入门简介
- object hbase is not a member of package org.apache.hadoop
- redhat下svn+apache搭建
- ubuntu 12.04下搭建web服务器(MySQL+PHP+Apache) 教程
- Importing Apache mod_rewrite Rules
- 在Ubuntu下使用Apache2建立虚拟主机
- 借助Apache Cordova构建混合移动应用程序
- Apache 的BeanUtils 拷贝日期对象转换问题
- Apache通用日志工具commons-logging和Log4j使用总结