新浪微博虚拟机开发配置步骤及介绍。
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
# <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 <VirtualHost> block.
#
<VirtualHost *:80>
    #管理员邮箱
    ServerAdmin  jiangfeng3@staff.sina.com.cn 
    #项目根目录   
    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]
</VirtualHost>
4、编辑本地host文件,以windows为例
进入C:/Windows/System32/drivers/etc
记事本打开hosts文件
最后添加
 127.0.0.1       localhost
 127.0.0.1       test.t.sina.com.cn
例子:
# 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       test.t.sina.com.cn
保存退出
5、重启apache,浏览器输入http://test.t.sina.com.cn

转载请注明原文地址:http://www.server110.com/apache/201309/1615.html

Apache服务器中配置虚拟机的方法的更多相关文章

  1. Nginx服务器中配置非80端口的端口转发方法详解

    这篇文章主要介绍了Nginx服务器中配置非80端口的端口转发方法详解,文中使用到了Nginx中的proxy_pass配置项,需要的朋友可以参考下 nginx可以很方便的配置成反向代理服务器: 1 2 ...

  2. 【转】Apache服务器安全配置

    源URL:http://foreversong.cn/archives/789 偶然下载了今年ISC大会360应急响应中心的一个ppt,在最后有个攻防领域专家注册考试目录,其中有很大一块就是中间件的安 ...

  3. 分享:linux下apache服务器的配置和管理

    linux下apache服务器的配置和管理. 一.两个重要目录: Apache有两个重要的目录:1.配置目录/etc/httpd/conf:2.文档目录/var/www: 二.两种配置模式: Apac ...

  4. delphi7开发webservice部属在apache服务器中 转

    delphi7开发webservice部属在apache服务器中 delphi7 webservice apache 用Delphi7开发Web Service程序,并把服务程序放在apache We ...

  5. django项目部署在Apache服务器中,静态文件路径的注意点

    django Apache部署静态文件的路径注意点 静态文件放在对应的 app 下的 static 文件夹中 或者 STATICFILES_DIRS 中的文件夹中. 当 DEBUG = True 时, ...

  6. Windows操作系统Apache服务器下配置PHP

    在Apache web服务器上发布PHP项目之前,需要进行相应的配置,服务器才能解析php文本,正常显示php动态页面内容.在进行php配置之前默认已经在Windows系统下安装好了Apache服务器 ...

  7. Windows下Apache服务器中自动配置二级子域名

    今天我们介绍的这个办法,只需要简单修改 httpd-vhosts.conf 文件,配合 .htaccess 文件即可实现自动配置二级域名. 我们这里以 wpchina.com 为例,以下代码中的 wp ...

  8. Apache服务器中运行CGI程序的方法,文中以Perl脚本作为示例

    关于apache与CGI在这里就不解释了. 1.apache下面以2.0.63为例介绍运行CGI程序的配置.(http://www.nklsyy.com) 2.下载Windows下的Perl解释器Ac ...

  9. iOS学习系列-Apache服务器的配置

    配置Apache服务器 一.目的 能够有一个测试的服务器,不是所有的特殊网络服务都能找到免费得! 二.为什么我们要用"Apache"? Apache是目前使用最广的web服务器 M ...

随机推荐

  1. 第二百八十六天 how can I 坚持

    bug不断啊,头疼. 今天早上到的倒是挺早. 中午吃的黄焖鸡,晚上加了会班. 勇江的鱼都死了,杨建的还剩3条,晚上到家都快十点了,还洗了衣服,没捞出来呢, 希望可以请下来假吧. 晾上衣服睡觉.

  2. Spring入门(2)-通过构造器注入Bean

    Spring入门(2)-通过构造器注入Bean 前一篇文章将了最基本的spring例子,这篇文章中,介绍一下带有参数的构造函数和通过构造器注入对象引用. 0. 目录 带有参数的构造函数 通过构造器注入 ...

  3. 分析nginx access log日志的命令

    统计访问最多的ip 1. tail -n 10000 xxaccess_log | cut -d " " -f 1 |sort|uniq -c|sort -rn|head -10 ...

  4. [支付]微信NATIVE扫码支付JAVA实现

    步骤: 1.预订单 2.接受微信返回的url 3.将url转为二维码显示到页面上 4.扫码支付 5.接收微信的异步通知,在这步修改订单的状态 6.收到异步通知的同时给微信返回指定数据,告知对方已成功处 ...

  5. 利用CSS3实现页面淡入动画特效

    利用CSS3动画属性"@keyframes "可实现一些动态特效,具体语法和参数可以网上自行学习.这篇文章主要是实践应用一下这个动画属性,实现页面淡入特效,在火狐24版.chrom ...

  6. TypeScript学习笔记(四):函数

    这篇笔记我们来看看TypeScript中的函数. 函数类型 在JavaScript中存在两种定义函数的方法,如下: //命名函数 function add(x, y) { return x+y; } ...

  7. HttpWebRequest和HttpWebResponse用法小结

    http://www.cnblogs.com/willpan/archive/2011/09/26/2176475.html http://www.cnblogs.com/lip0121/p/4539 ...

  8. iOS开发-轻点、触摸和手势

    一.响应者链 以UIResponder作为超类的任何类都是响应者.UIView和UIControl是UIReponder的子类,因此所有视图和所有控件都是响应者. 初始相应器事件首先会传递给UIApp ...

  9. WebView自适应并嵌套在ScrollView里

    大致思路:通过流的形式把网页抓取下来,然后对webView进行设置. 1.对webView进行设置 web.setWebViewClient(new WebViewClient() { @Overri ...

  10. rsync服务架设(数据同步|文件增量备份)

        近期由于业务需要,需要将两台服务器数据保持同步.方案有很多,rsync是其中一种解决方案,本文对rsync的安装及配置进行简单说明,其他实现方式有兴趣可以研究.以下是本文提纲,供参考: rsy ...