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

    1、apache 的配置文件 httpd.conf;找到  

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

    把include前的#注释去掉;

    2、找到 apache conf 配置文件下extra文件夹下的 httpd-vhosts.conf 配置文件   

    # Virtual Hosts
    #
    
    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot D:/mydocument/wamp/wamp64/www
        <Directory  "D:/mydocument/wamp/wamp64/www/">
            Options +Indexes +Includes +FollowSymLinks +MultiViews
            AllowOverride All
            Require local
        </Directory>
    </VirtualHost>
    

    #配置的虚拟主机 myhome <VirtualHost *:80> ServerName myhome DocumentRoot D:/mydocument/sentCMS <Directory "D:/mydocument/sentCMS/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost> #

    3、解析域名找到 C:WindowsSystem32driversetc下的 hosts 配置

    # 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 bandicam.com
    127.0.0.1 ssl.bandisoft.com
    
    127.0.0.1       localhost
    #配置的myhome
    127.0.0.1 myhome

    注意 修改hosts 文件需要以管理员的身份访问  可以这样解决  右击鼠标 找到属性  到安全 、点编辑、   组名用户名选users、users  权限  勾修改 写入 应用即可!

    第一次 访问时 前边加上HTTP//myhome/index.php

  • 相关阅读:
    2020牛客寒假算法基础集训营4-I 匹配星星【贪心】
    P1880 [NOI1995]石子合并【区间dp】
    P1280 尼克的任务
    P1041 传染病控制【暴搜】
    Heavy Transportation POJ
    【空间】C++内存管理
    【编译器】G++常用命令
    【NOIP2011】【Luogu1003】铺地毯
    【Luogu1739】表达式括号匹配
    【Luogu1160】队列安排
  • 原文地址:https://www.cnblogs.com/kevin2016/p/6285015.html
Copyright © 2011-2022 走看看