zoukankan      html  css  js  c++  java
  • apache服务器—虚拟目录+虚拟主机

    -------【虚拟目录设置】------
    1、打开apache的conf目录下httpd.conf
    2、注释#DocumentRoot "D:/apache2.2/htdocs"
    3、在<IfModule dir_module>后添加代码
    <IfModule dir_module>
        #欢迎页面
        DirectoryIndex index.html index.htm index.php
        #站点的别名
        Alias /myblog "D:/myblog"
        <Directory d:/myblog>
        #访问权限
        Order allow,deny
        Allow from all
        </Directory>
    </IfModule>
    4、访问http://localhost:80/myblog
    -----------【虚拟主机设置】---------
    1、启动 httpd-vhosts.conf
    在 httpd-conf 文件中打开
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
    2、在httpd-vhosts.conf文件中做配置
    <VirualHost 127.0.0.1:80>
        DocumentRoot "d:/myblog"
        DirectoryIndex index.html index.htm index.php
        <Directory d:/myblog>
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
        </Directory>
    </VirtualHost>
    3、修改hosts文件 C:WINDOWSsystem32driversetchosts
    127.0.0.1  www.bkk.com
    4、访问www.bkk.com

  • 相关阅读:
    SpringBoot定制修改Servlet容器
    springboot配置i18n
    idea properties编码问题
    多线程分页查询
    浏览器 私有属性&内核
    css添加样式的四种方式
    html、css、js注释
    JS中的 变量提升
    ECMAScript
    NOSCRIPT标签的用处
  • 原文地址:https://www.cnblogs.com/king-/p/4076976.html
Copyright © 2011-2022 走看看