PHP 配置多站点多目录
Apache配置httpd.conf
#增加监听端 可以通过netstat -n -a查看端口是否开启
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
Listen 8081
#开启虚拟站点
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
配置conf/extra/httpd-vhosts.conf
<VirtualHost *:8081>
ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "E:\Ken\work_space\PHP\e4"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
<Directory "E:\Ken\work_space\PHP\e4">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
就这样重启服务就可以了。
可能会碰到xampp Apache Access forbidden! Error 403 错误。
方法:配置httpd.conf
<Directory />
#AllowOverride none
#Require all denied
Order deny,allow
Allow from all
</Directory>
重启服务,搞定!
方法2:配置conf/extra/httpd-vhosts.conf
<VirtualHost *:>
ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "E:\Ken\work_space\PHP\e4"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
<Directory "E:\Ken\work_space\PHP\e4">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
PHP 配置多站点多目录的更多相关文章
- 使用Let’s Encrypt轻松配置https站点
使用Let's Encrypt轻松配置https站点 https不仅能提高网站安全,更是被搜索引擎纳入排名的因素之一. 2015年10月份,微博上偶然看到Let's Encrypt 推出了beta版, ...
- WampServer 在 httpd.conf 中配置多站点 (IP 配置法:不用每次修改 hosts 文件 + 域名配置法 )
因为要用 ThinkPHP 的当前最新版本 3.2.2,对应要求 PHP 的版本要高于 5.3.0,所以安装了 WampServer 2.2 ( Apache 2.2.21,PHP 5.3.10,My ...
- 服务器资源共享--IIS站点/虚拟目录中访问共享目录(UNC)
本文重点描述如何使用IIS访问共享资源来架设站点或执行 ASP.Net 等脚本. 通常情况下,拥有多台服务器的朋友在使用IIS建立站点的时候,会遇到如何把多台服务器的资源合并到一起的问题.如何让A服务 ...
- Windows下phpStudy配置独立站点详细步骤
本文讲如何在phpStudy下配置 域名->站点 步骤. 开始之前,我们先添加几个本地域名(host文件),如果有域名映射到主机此步可以跳过,直接看后面的phpStudy配置部分. 首先打开ho ...
- linux配置https站点
配置https站点呢,那就需要https证书,证书从何而来,花钱买?no,no,no,阿里有免费的,只是比较难发现,下面就图文解说一下怎么买免费的阿里https证书 首先阿里云,登录,购买链接———— ...
- ubuntu apache2配置多站点
ubuntu下使用sudo apt-get install apache2方法安装时,配置文件主要在/etc/apache2/目录下.主要有: apache2.conf : 主配置文件,会通过incl ...
- phpStudy配置多站点多域名和多端口的方法
切记:要想多个域名指向同一个项目,必须将phpstudy的根目录指向你项目所指的地方(原根目录是WWW),修改位置(其他菜单选项 - 软件设置 - 端口常规设置 - 网站目录) 站点:类似于 WWW ...
- 005.Nginx配置下载站点
一 下载站点 1.1 下载站点配置 语法:autoindex on | off; 默认值:autoindex off; 配置段:http,server,location Nginx默认不允许列出整个目 ...
- 阿里云服务器Linux CentOS安装配置(零)目录
阿里云服务器Linux CentOS安装配置(零)目录 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 阿里云服务器Linux CentOS安装配置(二)yum安装svn 阿里云服 ...
随机推荐
- js中元素更新value页面体现不出来的原因
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- python读取数据
#读取一行数据,去掉头尾空格 line = sys.stdin.readline().strip() #line类型为字符串 #字符串变成列表 line = sys.stdin.readline(). ...
- React Hook:使用 useEffect
React Hook:使用 useEffect 一.描述 二.需要清理的副作用 1.在 class 组件中 2.使用 effect Hook 的示例 1.useEffect 做了什么? 2.为什么在组 ...
- field.getModifiers() 返回值
field.getModifiers() 返回值 public static final 的值是 25 private 的值是2 测试如下 Class clazz=MyModel.class; F ...
- thinkphp 级联菜单实现
养殖场->栋舍级联菜单 //获取默认养殖场和栋舍信息 public function sbjr(){ $yzc_model=M("Yzc"); $list = $yzc_mo ...
- Java连接MySql数据库之JDBC
1.首先创建一个java Project项目 2.起一个英文的项目名 3.此窗口点击NO 4.此时项目状态如下 5.创建一个文件夹,并将mysql-connector-java-5.1.8-bin.j ...
- HDU 5632 Rikka with Array [想法题]
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5632 ------------------------------------------------ ...
- 小程序页面间传值(处理传值为对象,简单传值直接用options.XX的形式获取)
bookgoods:function(){ var Json = JSON.stringify(this.data.goods) wx.navigateTo({ url: '/pages/bookgo ...
- Dapper(一) 简介和性能
Dapper的简介 Dapper是.NET下一个micro的ORM,它和Entity Framework或Nhibnate不同,属于轻量级的,并且是半自动的.Dapper只有一个代码文件,完全开源,你 ...
- [AGC028D](dp计数)
题解点我 Code #include <bits/stdc++.h> typedef long long LL; typedef unsigned long long uLL; #defi ...