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 ...
随机推荐
- laravel查询最后执行的一条sql语句
- SpringMVC——概述
Spring 为展现层提供的基于 MVC 设计理念的优秀的Web 框架,是目前最主流的 MVC 框架之一 Spring3.0 后全面超越 Struts2,成为最优秀的 MVC 框架 Spring MV ...
- 如何获取.properties配置文件
如何获取.properties配置文件 分析思路: 先使用流和文件关联,即读取文件 再读取文件内容,一行一行读取 字符分割“=” 键值对 然后把键值对放到集合中去 但是Properties类里面有方 ...
- 编写高质量代码改善C#程序的157个建议——建议2: 使用默认转型方法
建议2: 使用默认转型方法 除了字符串操作外,程序员普遍会遇到的第二个问题是:如何正确地对类型实现转型.在上一个建议中,从int转型为string,我们使用了类型int的ToString方法.在大部分 ...
- Mac OS X 下android环境搭建
安装jdk6.0版本以支持eclipse的安装 安装eclipse 安装jdk8.0版本,实际开发中用到的jdk 配置java环境变量 打开shell命令窗口(终端) 检测输入java -versio ...
- c#winform pictureBox使用url加载图片
string url = "http://b.hiphotos.baidu.com/image/pic/item/03087bf40ad162d93b3a196f1fdfa9ec8b13cd ...
- vi—终端中的编辑器
*:first-child { margin-top: 0 !important; } .markdown-body>*:last-child { margin-bottom: 0 !impor ...
- spring boot日志及Log4j日志配置
1.默认实现的日志配置 Spring boot默认已经集成了logging,同时也是默认开启的,如果想根据自己的需求对日志进行配置,方法很简单--只需要在配置文件中进行相应设置,这里提供我自己的配置如 ...
- 类4(可变数据成员/基于const的重载)
可变数据成员: 有时我们希望能修改某个类的数据成员,即使是在一个 const 成员函数内.可以通过在变量的声明中加入 mutable 关键字来声明一个可变数据成员.mutable 是为突破 const ...
- python函数作用域,闭包,装饰器
第一:函数作用域: L:local 函数内部作用域 E:enclosing 函数内部与内嵌函数之间(闭包) G:global 全局作用域 B:build_in ...