zoukankan      html  css  js  c++  java
  • PHP虚拟主机的配置

    今天配置了一下虚拟目录,以下是我的配置方法。

     1  编辑httpd.conf,查找Include conf/extra/httpd-vhosts.conf,把前面注释符号“#”删掉。
     2  编辑httpd-vhosts.conf,我把WAMPServer安装在D:/wamp,所以我这里的路径是D:wampApache2confextra。  

    把里面的内容清空掉或者注释,换成下面的内容:

    NameVirtualHost *:80

    这个是新增的努力目录
    <VirtualHost *:80>
    ServerName www.cms.com
    ServerAlias www.cms.com
    DocumentRoot "F://workplace"
    </VirtualHost>

    原来默认的目录
    <VirtualHost *:80>
        ServerName localhost
        ServerAlias localhost
        DocumentRoot "D:/wamp/www"
    </VirtualHost>

    3 编辑httpd.conf,找到DocumentRoot "d:/wamp/www/"这项,这是默认根目录路径,但是要更改的不是这个,一直往下找,找到<Directory "d:/wamp/www">,然后在该</Directoory>后加上如下内容:

      <Directory "F://workplace">

        Options Indexes FollowSymLinks

        AllowOverride all
        Order Allow,Deny
        Allow from all
        </Directory>

        <Directory "D:/wamp/www">
        Options Indexes FollowSymLinks
         AllowOverride all
        Order Allow,Deny
        Allow from all
        </Directory>

    4  修改C:/WINDOWS/system32/drivers/etc/host这个文件,用记事本打开,加上如下内容:
       127.0.0.1  www.cms.com

    好了,然后重启apache,在浏览器里面输入www.cms.com,看看访问到的内容是不是workplace这个目录呢。
  • 相关阅读:
    老罗的OLLYMACHINE
    VGA寄存器一览表
    常用的I/O地址
    使用VESA示例
    打开A20
    Linux 2.2 Framebuffer Device Programming Tutorial
    Linux驱动
    基于Linux核心的汉字显示的尝试
    汉字的动态编码与显示方案
    AT&T语法(一)
  • 原文地址:https://www.cnblogs.com/lixiuran/p/3756542.html
Copyright © 2011-2022 走看看