(二)php apache wamp 修改运行主目录

右下角运行的软件

左键单击

选择Appache (版本号)----》httpd.conf 选中打开

全局搜索 ctrl+f

DocumentRoot
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
    #
    # 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/2.4/mod/core.html#options
    # for more information.
    #
    Options +Indexes +FollowSymLinks +Multiviews

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

    #
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don't remove
    Require local
</Directory>

修改

${INSTALL_DIR}/www

成自己像要的目录即可

H:\demo

这样再次访问

127.0.0.1就变成了H:\demo目录

 

两个位置都要修改

Apache服务器网站根目录配置是个比较基本的操作,之前经常用,现在记一下笔记

  打开Apache的配置文件,一般在Apache安装目录下的conf/httpd.conf配置文件中修改,

  找到 DocumentRoot "E:/abc"  把后面的路径改成我们的根目录

  然后找到 <Directory "E:/abc">  把这个路径改成和上面的完全一样

  保存httpd.conf文件,重启Apache服务器即可生效

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

安果移不动

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
>