zoukankan      html  css  js  c++  java
  • MAC 下虚拟主机的配置

    第一部分:httpd.conf

    1:找到这段,改成如下这样

    <Directory />
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>

    2:找到document root,改成如下

    DocumentRoot "/Users/ruanwenwu/web"
    <Directory "/Users/ruanwenwu/web">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/trunk/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
    # XAMPP
    Options Indexes FollowSymLinks ExecCGI Includes

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    #
    #AllowOverride None
    # since XAMPP 1.4:
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
    </Directory>

    3.打开下面这段代码的注释

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

    第二部分:http-vhost.conf配置如下

    <VirtualHost *:80>  
    # ServerAdmin postmaster@dummy-host.localhost
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
    ServerName localhost
    # ServerAlias www.Domain.com
    # ErrorLog "logs/Domain-error.log"
    # CustomLog "logs/Domain-access.log" combined
    </VirtualHost>

    <VirtualHost *:80>
    DocumentRoot "/Users/ruanwenwu/web/www.doubilaile.com"
    ServerName www.doubilaile.com
    RewriteEngine on
    RewriteRule ^/(d+)/?$ /Index/index/id/$1
    <Directory />
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    一个配置localhost,一个配置自己想要的主机。

    坚持!
  • 相关阅读:
    普通图片转ascii码字符图
    基于RAF的一个小动画框
    HTML5给我们带来了什么
    记坑
    以后的博客可能会偏向游戏开发方向
    总结:js中4类修改样式的方法
    小记:css特殊性
    css小记
    探究绑定事件的this指向以及event传参的小问题
    手把手教你图片转ASCII码图
  • 原文地址:https://www.cnblogs.com/doubilaile/p/4582264.html
Copyright © 2011-2022 走看看