php学习笔记五:使用 xampp 部署多个站点
来源:互联网 发布:linux 创建编辑c文件 编辑:程序博客网 时间:2024/05/21 22:50
1: 用记事本打开C:/WINDOWS/system32/drivers/etc/hosts文件,配置如下:
127.0.0.1 phptest
2:修改 httpd-vhosts.conf 文件
用记事本打开C:\xampp\apache\conf\httpd.conf文件,
找到Include conf/extra/httpd-vhosts.conf,确认前面没有加#.
3:C:\xampp\apache\conf\extra\httpd-vhosts.conf,在此文件末尾添加如下内容:
#如果修改过端口号,需要把 80 改为已经修改的值(查找 Listen xxx 的设置,xxx为端口号)
#虚拟站点-begin
<VirtualHost *:8081>
DocumentRoot "d:/xampp/htdocs/"
ServerName localhost
</VirtualHost>
#phptest 也可以设置为 www.test.com 等
<VirtualHost *:8081>
DocumentRoot "D:/WorkTest/Php"
ServerName phptest
</VirtualHost>
#虚拟站点-end
4:C:\xampp\apache\conf\httpd.conf,在此文件末尾添加如下内容:
<Directory "D:/WorkTest/Php">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
5:重启Apache服务。
6:访问测试(如果页面访问出现“Access forbidden!Error 403”错误继续往下看)
http://localhost:8081/
http://phptest:8081/
7:解决 Access forbidden!Error 403 问题
7.1 在 httpd.conf 里找到如下配置
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride none
Require all denied
</Directory>
7.2 修改为以下内容
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
#AllowOverride none
#Require all denied
Order deny,allow
Allow from all
</Directory>
127.0.0.1 phptest
2:修改 httpd-vhosts.conf 文件
用记事本打开C:\xampp\apache\conf\httpd.conf文件,
找到Include conf/extra/httpd-vhosts.conf,确认前面没有加#.
3:C:\xampp\apache\conf\extra\httpd-vhosts.conf,在此文件末尾添加如下内容:
#如果修改过端口号,需要把 80 改为已经修改的值(查找 Listen xxx 的设置,xxx为端口号)
#虚拟站点-begin
<VirtualHost *:8081>
DocumentRoot "d:/xampp/htdocs/"
ServerName localhost
</VirtualHost>
#phptest 也可以设置为 www.test.com 等
<VirtualHost *:8081>
DocumentRoot "D:/WorkTest/Php"
ServerName phptest
</VirtualHost>
#虚拟站点-end
4:C:\xampp\apache\conf\httpd.conf,在此文件末尾添加如下内容:
<Directory "D:/WorkTest/Php">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
5:重启Apache服务。
6:访问测试(如果页面访问出现“Access forbidden!Error 403”错误继续往下看)
http://localhost:8081/
http://phptest:8081/
7:解决 Access forbidden!Error 403 问题
7.1 在 httpd.conf 里找到如下配置
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride none
Require all denied
</Directory>
7.2 修改为以下内容
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
#AllowOverride none
#Require all denied
Order deny,allow
Allow from all
</Directory>
8:重启Apache服务后,执行 步骤6 查看结果。
0 0
- php学习笔记五:使用 xampp 部署多个站点
- php学习笔记四:使用 xampp-部署php网站
- 使用 xampp-部署php网站
- XAMPP 设置多个虚拟站点
- 安装xampp,并搭建多个站点
- xampp多站点配置
- xampp 多站点配置
- 怎么样在XAMPP上建立多个域名的站点
- 使用 xampp 来部署 php,mysql,apache 开发环境
- PHP学习笔记五
- tomcat部署多个站点方法
- nginx部署多个node站点
- PHP学习笔记2:WAMPServer多站点配置
- xampp/apache多站点配置
- XAMPP配置多站点过程
- 学习php-安装xampp
- php学习--xampp环境
- 使用XAMPP本地配置多个网站
- JavaScript高级程序设计之DOM 扩展之专有扩展之滚动第11.4.5讲
- 动态规划中的导弹拦截问题
- JS将秒转化成时分秒
- 生活中的小记录(2015.11.05)
- wpa_cli与wpa_supplicant的交互命令
- php学习笔记五:使用 xampp 部署多个站点
- Storyboard全解析-第二部分
- How to enable file sharing for my app?
- 视频直播Android端流程图
- AnjularJS初学(模拟输入限制)
- bootstrap
- mysql 加外键约束
- extjs操作组件的形式
- 全方位对比Mesos、Omega和Borg