开放访问权限

D:\wamp\bin\apache\apache2.4.9\conf  里的 httpd.conf

搜索www   把 Require local 改为 Require all granted

DocumentRoot "d:/wamp/www/"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
AllowOverride none
Require all denied
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

<Directory "d:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all

#
# Controls who can get stuff from this server.
#

# onlineoffline tag - don't remove
Require all granted
</Directory>

设置虚拟域名

D:\wamp\bin\apache\apache2.4.9\conf  里的 httpd.conf

搜索 vhost      把Include conf/extra/httpd-vhosts.conf 和 LoadModule vhost_alias_module modules/mod_vhost_alias.so 前的注释去掉

【注: httpd.conf 里有时候也要打开这个模块   LoadModule rewrite_module modules/mod_rewrite.so】

D:\wamp\bin\apache\apache2.4.9\conf\extra  里的  httpd-vhosts.conf

去掉:

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

如果只是想设置虚拟域名,没有同时开放权限就不用去掉,到如果要同时开放权限,就要去掉,不然开放不了。

<VirtualHost *:80>
DocumentRoot "D:/wamp/www/pros/"
ServerName pros.com
<Directory "D:/wamp/www/pros/">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "D:\wamp\www\test"
ServerName test.com

ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" combined
<Directory "D:\wamp\www\test">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

这两个种方式都可以设置虚拟域名,哪个项目(域名)放前面(第一个),对外开放权限就是哪个项目。

非第一个的就只能在内部访问时用虚拟域名访问(还有localhost不能用了,被第一个域名替换了,所以外部也只能访问第一个域名【当然你可以把第一个域名设置的地址直接为www,那就所以项目都可以访问得到了】)

C:\Windows\System32\drivers\etc  里的 hosts

修改本地访问

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

127.0.0.1 localhost
127.0.0.1 pros.com
127.0.0.1 test.com

wamp 2.5 开放访问权限和设置虚拟域名的更多相关文章

  1. Linux 下指定端口开放访问权限

    Linux 下指定端口开放访问权限 作者:Grey 原文地址: 博客园:Linux 下指定端口开放访问权限 CSDN:Linux 下指定端口开放访问权限 环境 CentOS 系和 Debian 系的防 ...

  2. wamp2.5怎么设置虚拟域名

    换了台电脑~好不顺手.老大的机器上装的是wamp.几年没用差点连怎么设置虚拟域名都忘记了.自己写点东西~做个备忘吧. 首先,版本 然后在网上百度一堆七七八八的.做的时候没那么复杂.跟phpstudy差 ...

  3. MongoDB设置访问权限、设置用户(转)

    MongoDB已经使用很长一段时间了,基于MongoDB的数据存储也一直没有使用到权限访问(MongoDB默认设置为无权限访问限制),今天特地花了一点时间研究了一下,研究成果如下: 注:研究成果基于W ...

  4. MongoDB设置访问权限、设置用户

    MongoDB已经使用很长一段时间了,基于MongoDB的数据存储也一直没有使用到权限访问(MongoDB默认设置为无权限访问限制),今天特地花了一点时间研究了一下,研究成果如下: 注:研究成果基于W ...

  5. MongoDB 3.0以上版本设置访问权限、设置用户

    定义:创建一个数据库新用户用db.createUser()方法,如果用户存在则返回一个用户重复错误. 语法:db.createUser(user, writeConcern)    user这个文档创 ...

  6. MongoDB 2.6设置访问权限、设置用户

    MongoDB已经使用很长一段时间了,基于MongoDB的数据存储也一直没有使用到权限访问(MongoDB默认设置为无权限访问限制),今天特地花了一点时间研究了一下,研究成果如下: 注:研究成果基于W ...

  7. [转载]MongoDB设置访问权限、设置用户

    MongoDB已经使用很长一段时间了,基于MongoDB的数据存储也一直没有使用到权限访问(MongoDB默认设置为无权限访问限制),今天特地花了一点时间研究了一下,研究成果如下: 注:研究成果基于W ...

  8. mysql数据库访问权限限制设置

    ---只能本地访问,设置随意访问 update user set host='%' where host='localhost': flush privileges; ---随意访问,设置只能本地访问 ...

  9. windows访问lnmp配置的虚拟域名

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://linuxzkq.blog.51cto.com/9379412/1630217 实 ...

随机推荐

  1. 大数运算(python2)

    偶然又遇到了一道大数题,据说python大数运算好屌,试了一发,果然方便-1 a = int( raw_input() ); //注意这里是按行读入的,即每行只读一个数 b = int( raw_in ...

  2. CLR via C#学习笔记---类型

    类的内存分配:http://www.cnblogs.com/JimmyZhang/archive/2008/01/31/1059383.html 关键字: abstract     (类)该类不能构建 ...

  3. CLR via C#(09)-扩展方法

    对于一些现成的类,如果我们想添加一些新的方法来完善功能,但是不想改变已有的封装,也不想使用派生类,那么该怎么办呢?这里我们可以使用扩展方法. 一见钟情--初识扩展 扩展方法使您能够向现有类型“添加”方 ...

  4. C#的匿名函数

    using System; using System.Collections; using System.Collections.Generic; using System.IO; using Sys ...

  5. ss + pac

    浅析PAC,教你动手修改你的PAC文件及user-rule文件实现自动代理 - 推酷http://www.tuicool.com/articles/V77jyu shadowsocks自定义代理规则u ...

  6. Shell编程基础教程1--Shell简介

    1.Shell简介 1.1.查看你系统shell信息 cat /etc/shell 命令可以获取Linux系统里面有多少种shell程序 echo $SHELL 命令可以查看当前你所使用的shell是 ...

  7. 图结构练习——判断给定图是否存在合法拓扑序列(dfs算法(第一个代码),邻接矩阵(前两个代码),邻接表(第三个代码))

    sdut 2140 图结构练习——判断给定图是否存在合法拓扑序列 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述  给定一个有向图 ...

  8. [SVN] SVN在Eclipse里的各个状态解释

    中文意义: A代表添加D代表删除U代表更新C代表合并,并且合并中有冲突G代表合并,合并中没有冲突 每个字母代表的意义: U = item (U)pdated to repository version ...

  9. Web开发基本准则-55实录-Web访问安全

    Web开发工程师请阅读下面的前端开发准则,这是第一部分,强调了过去几年里我们注意到的Web工程师务须处理的Web访问安全基础点.尤其是一些从传统软件开发转入互联网开发的工程师,请仔细阅读,不要因为忽视 ...

  10. js获取今天明天

    目的:记录中展现"今天","明天",除外展现月日. 借鉴: <html> <head> <meta http-equiv=&quo ...