phpStudy 2014的Apache虚拟主机配置
2015-06-25 10:18
676 查看
1.打开虚拟主机配置,打开D:\phpStudy\Apache\conf下的 httpd.conf文件去掉#Include conf/extra/httpd-vhosts.conf前面的#保存即可。在D:\WWW目录下建立web应用例如 classmath。
2.打开D:\phpStudy\Apache\conf\extra下的httpd-vhosts.conf文件,复制以下代码在文件最后粘贴即可。
<VirtualHost *:80>
DocumentRoot "D:\WWW\classmath"
ServerName web.classmath.com
</VirtualHost>
<Directory "D:\WWW\classmath">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
3.
打开C:\Windows\System32\drivers\etc下的hosts文件添加
127.0.0.1 web.classmath.com
然后重启Apache,然后,,你发现,localhost不能正常使用了!
4.在http-vhosts.conf文件中添加以下代码,并在hosts文件中添加 127.0.0.1 localhost,,然后重启
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:\WWW"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
2.打开D:\phpStudy\Apache\conf\extra下的httpd-vhosts.conf文件,复制以下代码在文件最后粘贴即可。
<VirtualHost *:80>
DocumentRoot "D:\WWW\classmath"
ServerName web.classmath.com
</VirtualHost>
<Directory "D:\WWW\classmath">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
3.
打开C:\Windows\System32\drivers\etc下的hosts文件添加
127.0.0.1 web.classmath.com
然后重启Apache,然后,,你发现,localhost不能正常使用了!
4.在http-vhosts.conf文件中添加以下代码,并在hosts文件中添加 127.0.0.1 localhost,,然后重启
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:\WWW"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
相关文章推荐
- Apache Felix环境配备
- Apache--Rewrite
- apache安装webalizer步骤
- Apache Shiro权限框架在SpringMVC+Hibernate中的应用
- CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)
- CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)
- Java发送Email—使用org.apache.commons.mail
- win7(64位)php5.5-Apache2.4-mysql5.6环境安装
- Apache Shiro 使用手册(五)Shiro 配置说明
- Apache Shiro 使用手册(四)Realm 实现
- Apache Shiro 使用手册(二)Shiro 认证
- Apache Shiro 使用手册(一)Shiro架构介绍
- Apache简介——极客学院学习笔记
- How-to: resolve hbase "org.apache.hadoop.hbase.TableExistsException: hbase:namespace"
- apache2 + git + gerrit + mysql 配置、简单git操作
- Java +apache+wget下载例子
- apache2部署django的错误
- apache是容器么,作用是什么? .
- windows下apache+php+mysql 环境配置方法
- windows 下 apache启动不了