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 配置多站点多目录的更多相关文章

  1. 使用Let’s Encrypt轻松配置https站点

    使用Let's Encrypt轻松配置https站点 https不仅能提高网站安全,更是被搜索引擎纳入排名的因素之一. 2015年10月份,微博上偶然看到Let's Encrypt 推出了beta版, ...

  2. 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 ...

  3. 服务器资源共享--IIS站点/虚拟目录中访问共享目录(UNC)

    本文重点描述如何使用IIS访问共享资源来架设站点或执行 ASP.Net 等脚本. 通常情况下,拥有多台服务器的朋友在使用IIS建立站点的时候,会遇到如何把多台服务器的资源合并到一起的问题.如何让A服务 ...

  4. Windows下phpStudy配置独立站点详细步骤

    本文讲如何在phpStudy下配置 域名->站点 步骤. 开始之前,我们先添加几个本地域名(host文件),如果有域名映射到主机此步可以跳过,直接看后面的phpStudy配置部分. 首先打开ho ...

  5. linux配置https站点

    配置https站点呢,那就需要https证书,证书从何而来,花钱买?no,no,no,阿里有免费的,只是比较难发现,下面就图文解说一下怎么买免费的阿里https证书 首先阿里云,登录,购买链接———— ...

  6. ubuntu apache2配置多站点

    ubuntu下使用sudo apt-get install apache2方法安装时,配置文件主要在/etc/apache2/目录下.主要有: apache2.conf : 主配置文件,会通过incl ...

  7. phpStudy配置多站点多域名和多端口的方法

    切记:要想多个域名指向同一个项目,必须将phpstudy的根目录指向你项目所指的地方(原根目录是WWW),修改位置(其他菜单选项 - 软件设置 - 端口常规设置 - 网站目录) 站点:类似于  WWW ...

  8. 005.Nginx配置下载站点

    一 下载站点 1.1 下载站点配置 语法:autoindex on | off; 默认值:autoindex off; 配置段:http,server,location Nginx默认不允许列出整个目 ...

  9. 阿里云服务器Linux CentOS安装配置(零)目录

    阿里云服务器Linux CentOS安装配置(零)目录 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 阿里云服务器Linux CentOS安装配置(二)yum安装svn 阿里云服 ...

随机推荐

  1. [JSOI2004]平衡点 / 吊打XXX 题解

    预备概念: 金属退火:将金属缓慢加热到一定温度,保持足够时间,然后以适宜速度冷却 温度:一个逐渐减小的参数,表示接受次优解的概率 模拟退火是一种解决复杂问题的算法,相当于贪心,但以一个逐渐减小的该率接 ...

  2. python_012

    一.内置函数 1.sorted()排序函数 a:语法sorted(Iterable,key = None,reverse = False) Iterable:可迭代对象;key:排序规则(函数) ls ...

  3. Codeforces Round #585 (Div. 2) E. Marbles (状压DP)

    题目:https://codeforc.es/contest/1215/problem/E 题意:给你一个序列,你可以交换相邻的两个数,要达到一个要求,所有相同的数都相邻,问你交换次数最少是多少 思路 ...

  4. 刷leetcode之路

    写的不是很好,仅记录自己所写的,仅供参考. 第七题: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = ...

  5. HDU 6024 Building Shops (简单dp)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6024 题意:有n个room在一条直线上,需要这这些room里面建造商店,如果第i个room建造,则要总 ...

  6. HDU6672 Seq(找规律)

    HDU6672 Seq 对于递推式 \(a_n = (\sum_{i = 1}^{n-1}a_i * i)\%n\) 打表列出 \(a_i\) 的前 \(100\) 项,发现有以 \(6\) 为循环的 ...

  7. $_POST,$_GET,$_REQUEST区分

    PHP $_REQUEST PHP $_REQUEST 用于收集 HTML 表单提交的数据. 下面的例子展示了一个包含输入字段及提交按钮的表单.当用户通过点击提交按钮来提交表单数据时, 表单数据将发送 ...

  8. package和import语句_1

    package 和 import语句   >为便于管理大型软件系统中数目众多的类,解决类的命名冲突问题,Java引入包(package)机制,提供类的多重类命名空间. >package语句 ...

  9. jQuery基础--音乐视频操作

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  10. Pikachu漏洞练习平台实验——RCE(五)

    1.概述 RCE(Remote Command/Code Execute) 给攻击者向后台服务器远程注入操作系统命令或者代码,从而控制后台系统. 远程系统命令执行一般出现这种漏洞,是因为应用系统从设计 ...