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

  • 相关阅读:
    openstack对接VMware浅析
    一键部署 Docker Datacenter ---简化docker数据中心安装步骤
    基于Kubernetes(k8s)网络方案演进
    kubernetes1.4 基础篇:Learn Kubernetes 1.4 by 6 steps
    使用Netsil监控Kubernetes上的微服务
    Kubernetes(k8s)容器运行时(CRI)
    在Openstack上创建并访问Kubernetes集群
    html5--canvas绘制简单的时钟
    html5——canva 绘图1简单图形
    html5 兼容火狐 ev的事件
  • 原文地址:https://www.cnblogs.com/kevin2016/p/6285015.html
Copyright © 2011-2022 走看看