wamp 2.5 开放访问权限和设置虚拟域名
开放访问权限
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 开放访问权限和设置虚拟域名的更多相关文章
- Linux 下指定端口开放访问权限
Linux 下指定端口开放访问权限 作者:Grey 原文地址: 博客园:Linux 下指定端口开放访问权限 CSDN:Linux 下指定端口开放访问权限 环境 CentOS 系和 Debian 系的防 ...
- wamp2.5怎么设置虚拟域名
换了台电脑~好不顺手.老大的机器上装的是wamp.几年没用差点连怎么设置虚拟域名都忘记了.自己写点东西~做个备忘吧. 首先,版本 然后在网上百度一堆七七八八的.做的时候没那么复杂.跟phpstudy差 ...
- MongoDB设置访问权限、设置用户(转)
MongoDB已经使用很长一段时间了,基于MongoDB的数据存储也一直没有使用到权限访问(MongoDB默认设置为无权限访问限制),今天特地花了一点时间研究了一下,研究成果如下: 注:研究成果基于W ...
- MongoDB设置访问权限、设置用户
MongoDB已经使用很长一段时间了,基于MongoDB的数据存储也一直没有使用到权限访问(MongoDB默认设置为无权限访问限制),今天特地花了一点时间研究了一下,研究成果如下: 注:研究成果基于W ...
- MongoDB 3.0以上版本设置访问权限、设置用户
定义:创建一个数据库新用户用db.createUser()方法,如果用户存在则返回一个用户重复错误. 语法:db.createUser(user, writeConcern) user这个文档创 ...
- MongoDB 2.6设置访问权限、设置用户
MongoDB已经使用很长一段时间了,基于MongoDB的数据存储也一直没有使用到权限访问(MongoDB默认设置为无权限访问限制),今天特地花了一点时间研究了一下,研究成果如下: 注:研究成果基于W ...
- [转载]MongoDB设置访问权限、设置用户
MongoDB已经使用很长一段时间了,基于MongoDB的数据存储也一直没有使用到权限访问(MongoDB默认设置为无权限访问限制),今天特地花了一点时间研究了一下,研究成果如下: 注:研究成果基于W ...
- mysql数据库访问权限限制设置
---只能本地访问,设置随意访问 update user set host='%' where host='localhost': flush privileges; ---随意访问,设置只能本地访问 ...
- windows访问lnmp配置的虚拟域名
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://linuxzkq.blog.51cto.com/9379412/1630217 实 ...
随机推荐
- myeclipse 8.5 注册码
刚才启动突然发现MyEclipse原来是收费的...汗一把,到弹出注册框我才知道.....老天啊我活的该有多窝囊.. 弹框很烦人,我一个穷书生既想继续学习又囊中羞涩无力购买,只好用盗版了(找个理由辩解 ...
- IOS之计算器实现
本文利用ios实现计算器app,后期将用mvc结构重构 import UIKit class CalculViewController: UIViewController { @IBOutlet we ...
- hadoop2.x NameNode 的共享存储实现
过去几年中 Hadoop 社区涌现过很多的 NameNode 共享存储方案, 比如 shared NAS+NFS.BookKeeper.BackupNode 和 QJM(Quorum Journal ...
- 20145206《Java程序设计》实验三实验报告
20145206<Java程序设计>实验三实验报告 实验内容 XP基础 XP核心实践 相关工具 实验步骤 (一)敏捷开发与XP 软件工程是把系统的.有序的.可量化的方法应用到软件的开发.运 ...
- Page Object Model (Selenium, Python)
时间 2015-06-15 00:11:56 Qxf2 blog 原文 http://qxf2.com/blog/page-object-model-selenium-python/ 主题 Sel ...
- Eclipse的使用及Java程序的标识符和关键字
Eclipse的使用 (1)创建Java项目 选择“文件”/“新建”/“Java项目”命令,在弹出的“新建Java项目”对话框输入项目名,然后点击“下一步”,最后单击“完成”. (2)创建Java类文 ...
- sql server 常用的函数小汇
摘录些许sqlserver 常用到的一些函数,便于日常学习使用 一.字符转换函数1.ASCII()返回字符表达式最左端字符的ASCII 码值.在ASCII()函数中,纯数字的字符串可不用‘’括起来,但 ...
- 昨晚值班将发dla的程序改好后放入正式环境
可是在修改的topic的发送文件中出现有节点没有对应,整个过程陆续调至有20分钟最后11电把新程序换掉.
- php重修
阅读顺序: http://www.laruence.com/2008/08/11/147.html 深入浅出php http://www.laruence.com/2008/06/18/221.ht ...
- Spring+Hibernate+Oracle中的Clob操作配置
bean对象配置: <!-- 此处用于指定当前JDBC的实现,详见下面注解① --> <bean id="nativeJdbcExtractor" class=& ...