zoukankan      html  css  js  c++  java
  • wamp 虚拟目录的设置(转载)

    现在先来配置虚拟主机:
    1.先打开apache的配置文件httpd.conf,并去掉#Include conf/extra/httpd-vhosts.conf前面的#!!
    2.打开apache的apache/conf/extra下的次配置文件httpd-vhosts.conf
    3.将此文件下的原有的扩展配置文件(如下):删除一个或两个
        <VirtualHost *:80>
                ServerAdmin webmaster@dummy-host2.localhost
                DocumentRoot /www/docs/dummy-host2.localhost
               ServerName dummy-host2.localhost
               ErrorLog logs/dummy-host2.localhost-error_log
               CustomLog logs/dummy-host2.localhost-access_log common
        </VirtualHost>
    4.在httpd-vhosts.conf文件的末尾添加上:
      <VirtualHost *:80>
            DocumentRoot D:/wamp/website/a.com
            ServerName www.a.com
            <Directory "D:/wamp/website/a.com">
                Options Indexes FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
            </Directory>
      </VirtualHost>
    5.打开在C:/WINDOWS/system32/drivers/etc中的hosts文件中加上如下的内容
        127.0.0.1    www.a.com
    6.这样我们就配置好了名为wamp的虚拟主机,重启一下我们在浏览器中输入wamp就可以

        查看到D:/wamp/www目录下的内容了!!

    7.但是这样localhost访问则出现了问题,这时需要我们,同样将localhost设为虚拟主机

    <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>

    8:为了让其他电脑用IP访问电脑,需要在httpd.conf 中搜索127.0.0.1 修改为all

  • 相关阅读:
    CentOS7.4 chrony时间同步服务器部署(替代NTPD)
    Zabbix Agent for Windows部署(五)
    Zabbix3.4.5部署安装(二)
    Zabbix概术及基础介绍(一)
    修改zabbix为中文,并解决乱码问题(三)
    ZABBIX 3.4 监控Nginx 状态(七)
    PXE+Kickstart 全自动安装部署CentOS7.4
    Zabbix Agent for Linux部署(四)
    不能在 DropDownList 中选择多个项 原因分析及解决方法
    IE浏览器下的CSS问题
  • 原文地址:https://www.cnblogs.com/cpugege/p/3421087.html
Copyright © 2011-2022 走看看