zoukankan      html  css  js  c++  java
  • WAMPSERVER多站点配置

    1.配置wamp网站地址:

    找到wamp的安装目录,如~wampinapacheApache2.4.4confextrahttpd-vhosts.conf

    打开httpd-vhosts.conf文件

    其中有默认的样例:

    <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 "e:demo/test01"  (这里是要设置站点的路径)
    ServerName test01.com   (这里是要设置站点的域名)
    </VirtualHost>

    设置好后保存,有任何改动了配置的操作都要重新启动wamp

    2.配置Apache:

    打开httpd.conf文件,可参考:http://www.cnblogs.com/junglexj/p/6016755.html

    将其中

    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf

    第二行“#”去掉,表示允许;

    再找到之前<Directory "e:/demo">里,设置成

    # onlineoffline tag - don't remove
    Order Deny,Allow
    Allow from all
    #Allow from 127.0.0.1

    3.配置hosts文件

    目录:C:WindowsSystem32driversetchosts

    在最下面添加一行  

    127.0.0.1       test01.com

    保存退出,若无法保存请copy一份hosts文件到桌面编辑,再替换到C:WindowsSystem32driversetc目录下即可。

    可以在新建一个php文件测试,e:/demo/test01/index.php

    其中index.php的内容为:

    <?php
    echo "hello world";
    ?>

    保存,在浏览器访问http://test01.com/test01/便可显示 "hello world" ;

    注意,若是修改过默认端口,访问时要在域名后面加端口号,比如:http://test01.com:8080/test01/

    参考:http://www.imooc.com/video/3521

  • 相关阅读:
    使用svn diff的-r参数的来比较任意两个版本的差异
    mysql client常见error总结
    mysql 中 unix_timestamp,from_unixtime 时间戳函数
    hyperledger explorer 结合 fabric1.4 搭建 区块链浏览器 踩坑记录
    fabric1.4 网络操作
    通过配置连接池大小来提升性能
    docker基本操作及介绍
    InnoDB 引擎中的索引类型
    MySQL互联网业务使用建议
    mysql InnoDB引擎是否支持hash索引
  • 原文地址:https://www.cnblogs.com/junglexj/p/6017208.html
Copyright © 2011-2022 走看看