• 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,一个配置自己想要的主机。

    坚持!
  • 相关阅读:
    SQL多表合并查询结果
    无法访问请求的页面,因为该页的数据的相关配置数据无效
    网站运行的时候编译成功但是程序浏览器的页面不会显示怎么回事啊
    EasyUI 在textbox里面输入数据敲回车后查询和普通在textbox输入数据敲回车的区别
    搭建Go开发及调试环境(LiteIDE + GoClipse) -- Windows篇
    Python开发工具安装
    jQuery 插件写法2
    jQuery插件面向对象开发
    Jquery插件学习
    Maven 仓库
  • 原文地址:https://www.cnblogs.com/doubilaile/p/4582264.html
Copyright © 2020-2023  润新知