发布网站添加虚拟机"/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的更多相关文章

  1. wamp下Apache配置vhost

    1.由于后面虚拟机中需要用到Rewrite所以先编辑Apache的conf目录下的httpd.conf文件.(我的文件位置是:D:\Program Files\wamp\bin\apache\apac ...

  2. Windows下 wamp下Apache配置虚拟域名

    安装好wamp后  找到 找到  Include conf/extra/httpd-vhosts.conf   去掉前面的#   并保存 修改 DocumentRoot  和  ServerName ...

  3. CentOS下Apache配置多域名或者多端口映射

    CentOS下Apache默认网站根目录为/var/www/html,假如我默认存了一个CI项目在html文件夹里,同时服务器的外网IP为ExampleIp,因为使用的是MVC框架,Apache需开启 ...

  4. Linux下Apache配置HTTPS功能

    Apache配置HTTPS功能  转 https://www.cnblogs.com/liaojiafa/p/6028816.html 一.yum 安装openssl和openssl-devel,ht ...

  5. phpstudy集成下Apache配置部署https安全证书

    一..先申请到安全证书.(腾讯云或者阿里云申请免费1年的安全证书),怎么申请这里也说下(以腾讯云为例): 1.登录腾讯云QQ或微信登录都行,第一次登录要通过实名认证,点击[产品]---[ss证书l] ...

  6. windows下apache配置https

    1.下载带有openSSL的apache安装包,我下载的为apache_2.2.11-win32-x86-openssl-0.9.8i.msi,安装后确认一下bin路径下的openssl.exe,ss ...

  7. windows下Apache配置SSL安全连接

    什么是SSL? SSL(Secure Socket Layer): 是为Http传输提供安全的协议,通过证书认证来确保客户端和网站服务器之间的数据是安全.Open SSL下载地址:http://www ...

  8. windows下apache配置ssl(https)服务器

    SSl是为Http传输提供安全的协议,通过证书认证来确保客户端和网站服务器之间的数据是安全, 可以通过apache自带的openssl进行配置: 步骤如下: 1.安装有openssl模板的apache ...

  9. Windows下Apache配置域名

    1.打开httpd.conf 找到“Include conf/extra/httpd-vhosts.conf”这一行,取消前面的#号注释并保存 2.修改httpd-vhosts.conf文件 进入ap ...

随机推荐

  1. grid search 超参数寻优

    http://scikit-learn.org/stable/modules/grid_search.html 1. 超参数寻优方法 gridsearchCV 和  RandomizedSearchC ...

  2. java发送post 的json请求

    package com.elink.estos.mq.mqmanager; import java.io.IOException; import java.io.InputStream; import ...

  3. java多线程的操作

    上篇博客简单了介绍了Java的多线程的概念,与进程的区别,两种创建方式,状态及获取线程名称等内容.这篇文章接着介绍Java的多线程.主要从一下几方面介绍. 1 线程类的常用方法 1.1 start() ...

  4. spring的一些配置和重要的接口和类

    spring的配置文件 通常是applicationContext.xml(具体的bean配置会在后面内容中详解) setter方法注入: <property name=“” value=“ja ...

  5. [.net 多线程]Barrier

    当需要[一组任务]并行地运行一连串的阶段,但是每一个阶段都要等待所有他任务完成前一阶段之后才能开始,可以通过Barrier实例来同步这一类协同工作.Barrier初始化后,将等待特定数量的信号到来,这 ...

  6. 基于任务的异步编程模式(TAP)

    异步编程是C#5.0的一个重要改进,提供两个关键字:async和await.使用异步编程,方法的调用是在后台运行(通常在线程或任务的帮助下),但不会阻塞调用线程.异步模式分为3种:异步模式.基于事件的 ...

  7. hadoop中常用的hdfs代码操作

    一:向HDFS中上传任意文本文件,如果指定的文件在HDFS中已经存在,由用户指定是追加到原有文件末尾还是覆盖原有的文件: package hadoopTest; import org.apache.h ...

  8. soapui

    webservice 的请求可使用工具:soapui 天气预报的接口地址:http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsd ...

  9. 【spring boot】FilterRegistrationBean介绍

    前言 以往的javaee配置过滤器是在web.xml中配置的,如下代码 <filter> <filter-name>TestFilter</filter-name> ...

  10. pycharm 不显示代码提示

    1.检查是否代码本身有问题. 2.检查代码提示是否成功开启. 3.检查IDE省电模式是否关闭状态. 4.使用快捷键:ctrl+j.ctrl+space.alt+/ 其他(不能安装): 1.检查是否Py ...