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

    1、首先打开apache的配置文件httpd.conf,并去掉#Include conf/extra/httpd-vhosts.conf前面的#,启用虚拟主机功能

    2、先把localhost配置好,免得以后访问localhost出现问题,我的wamp项目根目录是D:wampwww。将下面信息添加到apache的apache/conf/extra下的配置文件httpd-vhosts.conf后面即可;

    <VirtualHost *:80>
            DocumentRoot "D:/wamp/www"
            ServerName localhost
            <Directory "D:/wamp/www">
                Options Indexes FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
            </Directory>
    </VirtualHost>

    3、配置其他项目虚拟主机:比如配置www.tp5.com,打开该链接即可直接访问D:/wamp/www/tp5目录。“DirectoryIndex index.PHP”的意思是访问该目录默认打开“index.php”文件

    <VirtualHost *:80>
            DocumentRoot "D:/wamp/www/tp5"
            ServerName www.tp5.com
            DirectoryIndex index.php
            <Directory />
                Options Indexes FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
            </Directory>
    </VirtualHost>

    4、修改C:WindowsSystem32driversetc下的host文件,用记事本打开,添加 127.0.0.1       www.tp5.com  ,重启apache即可。

  • 相关阅读:
    [luoguU48834][count]
    [ZROJ110][假如战争今天爆发]
    [luogu4860][Roy&October之取石子II]
    [luogu4018][Roy&October之取石子]
    [luoguU48574][藏妹子之处]
    [20181025晚][模拟赛]
    [20181025上午][模拟赛]
    ElasticSearch业务逻辑案例
    ElasticSearch安装及使用
    面试必问:ACID/CAP
  • 原文地址:https://www.cnblogs.com/wesky/p/6924168.html
Copyright © 2011-2022 走看看