WAMP下Apache配置Vhost (2
发布网站添加虚拟机"/usr/local/apache/conf/extra/httpd-vhost.conf"的最下面:
<VirtualHost *:80>
ServerName test.wordpress.com
DocumentRoot "F:\wwwroot\wordpress"
SetEnv APPLICATION_ENV "development"
<Directory
"F:\wwwroot\wordpress">
DirectoryIndex index.php
AllowOverride All
Order
allow,deny
Allow from
all
</Directory>
</VirtualHost>
1、由于后面虚拟机中需要用到Rewrite所以先编辑Apache的conf目录下的httpd.conf文件。(可根据实际需要操作)
添加mod_rewrite.so模块支持。去掉下列行中前面的#号。
LoadModule rewrite_module modules/mod_rewrite.so
2、配置apache支持虚拟机。这一步很重要。
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
找到 上面相关文本,去掉#Include conf/extra/httpd-vhosts.conf前的#。
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
保存退出。
3、编辑conf目录下extra文件夹下的httpd-vhosts.conf。
去掉实例配置,添加新有配置。以新浪微博为例,配置文件如下:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most
configurations
# use only name-based virtual hosts so the server doesn't need to
worry about
# IP addresses. This is indicated by the asterisks in the
directives below.
#
# Please see the documentation at
# <<A
href="http://httpd.apache.org/docs/2.2/vhosts/">URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual
host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost
container.
# The first VirtualHost section is used for all requests that do
not
# match a ServerName or ServerAlias in any block.
#
#管理员邮箱
ServerAdmin admin@admin.com
#项目根目录
DocumentRoot
"D:/htdocs/frame_export"
#域名
ServerName
test.t.sina.com.cn
#别名
ServerAlias
test.t.sina.com.cn
#错误日志路径
ErrorLog
"logs/test.t.sins.com.cn-error.log"
CustomLog
"logs/test.t.sins.com.cn-access.log" common
RewriteEngine on
#重写规则,可根据实际需要添加
RewriteRule
^/(.*)$
/apps/index.php [L]
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/jiangfeng08/archive/2010/07/26/5766932.aspx
WAMP下Apache配置Vhost (2的更多相关文章
- wamp下Apache配置vhost
1.由于后面虚拟机中需要用到Rewrite所以先编辑Apache的conf目录下的httpd.conf文件.(我的文件位置是:D:\Program Files\wamp\bin\apache\apac ...
- Windows下 wamp下Apache配置虚拟域名
安装好wamp后 找到 找到 Include conf/extra/httpd-vhosts.conf 去掉前面的# 并保存 修改 DocumentRoot 和 ServerName ...
- CentOS下Apache配置多域名或者多端口映射
CentOS下Apache默认网站根目录为/var/www/html,假如我默认存了一个CI项目在html文件夹里,同时服务器的外网IP为ExampleIp,因为使用的是MVC框架,Apache需开启 ...
- Linux下Apache配置HTTPS功能
Apache配置HTTPS功能 转 https://www.cnblogs.com/liaojiafa/p/6028816.html 一.yum 安装openssl和openssl-devel,ht ...
- phpstudy集成下Apache配置部署https安全证书
一..先申请到安全证书.(腾讯云或者阿里云申请免费1年的安全证书),怎么申请这里也说下(以腾讯云为例): 1.登录腾讯云QQ或微信登录都行,第一次登录要通过实名认证,点击[产品]---[ss证书l] ...
- windows下apache配置https
1.下载带有openSSL的apache安装包,我下载的为apache_2.2.11-win32-x86-openssl-0.9.8i.msi,安装后确认一下bin路径下的openssl.exe,ss ...
- windows下Apache配置SSL安全连接
什么是SSL? SSL(Secure Socket Layer): 是为Http传输提供安全的协议,通过证书认证来确保客户端和网站服务器之间的数据是安全.Open SSL下载地址:http://www ...
- windows下apache配置ssl(https)服务器
SSl是为Http传输提供安全的协议,通过证书认证来确保客户端和网站服务器之间的数据是安全, 可以通过apache自带的openssl进行配置: 步骤如下: 1.安装有openssl模板的apache ...
- Windows下Apache配置域名
1.打开httpd.conf 找到“Include conf/extra/httpd-vhosts.conf”这一行,取消前面的#号注释并保存 2.修改httpd-vhosts.conf文件 进入ap ...
随机推荐
- SqlServer——神奇代码1之Update
说明:一个带有update的循环的代码.很简单,但是在QQ群里问了,应该说是很少有人注意这个问题,也就是很少有人真的理解SQL中的Update. 代码如下: if object_id('tempdb. ...
- ubuntu扩展屏幕
1.了解设置的名称 直接运行xrandr(不带任何参数)就可以显示出当前的显示设备及设备的模式. xdj@xdj-Presario-CQ42-Notebook-PC:~$ xrandr Screen ...
- Linux命令累积
常用命令 ipconfig -查看本机ip.接口等信息 ping ip -ping远程服务器或终端 cd ~ -返回根目录 cd .. 返回上级目录 cd ../.. 返回上两级目录 ...
- MongoDB整理笔记のGridFS
GridFS 是一种将大型文件存储在MongoDB 数据库中的文件规范.所有官方支持的驱动均实现了GridFS 规范. GridFS是MongoDB中的一个内置功能,可以用于存放大量小文件. 官网学习 ...
- 【C#】is 和 as
看个例子: public class User { } public class Group { } class Program { static void Main(string[] args) { ...
- C# 可变参数
class Program { static void Main(string[] args) { //常规使用方法 Console.WriteLine(Add(, , , , , , , , })) ...
- 游戏中遇到的BUG
(1)bug描述:战斗中有英雄死亡,一方掉线之后再次上线,仍然可以看到死亡英雄空血条(英雄受到攻击才会显示血条) 解决方案:原来 当前血量小于英雄血量最大值时,证明英雄受到伤害,血条显示为true I ...
- B. Spreadsheets(进制转换,数学)
B. Spreadsheets time limit per test 10 seconds memory limit per test 64 megabytes input standard inp ...
- 洛谷P4015 运输问题(费用流)
传送门 源点向仓库连费用$0$,流量为储量的边,商店向汇点连费用$0$,流量为需求的边,然后仓库向商店连流量$inf$,费用对应的边,跑个费用流即可 //minamoto #include<io ...
- Web 安全入门-书籍及建议
https://www.jianshu.com/p/6dcebd54fb24 (本文源于转载或摘抄整理) 2016-06-12 Fooying 优主张 最近比较忙,灵感稍微有点缺乏,本着宁缺毋滥的想法 ...