在XAMPP、WAMP等集成环境中配置虚拟站点
本文最后更新于 3171 天前,其中的信息可能已经有所发展或是发生改变。

对于不喜欢折腾运行环境的同学来说,集成环境包绝对是好东西。由于WAMP上php5.6版本有点小坑,现在已转向XAMPP的怀抱。

给apache服务器授权

打开Apache的配置文件httpd.conf,找到下面的节点

DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
    #
    # 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 Includes ExecCGI

    #
    # 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.
    #
    Require all granted
</Directory>

可以看到已经在C:/xampp/htdocs目录下授权了,你可以把多个项目放在该目录下。我一般习惯在非系统盘放置项目,此时将C:/xampp/htdocs改为自定义目录就可以。

接着查看是否加载了vhost的配置文件。若你的配置文件没有这一行,你可以手动添加上去并在对应目录新建httpd-vhosts.conf配置文件。

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

添加虚拟站点

打开httpd-vhosts.conf文件,为每个项目添加如下节点即可

<VirtualHost *:80>
    DocumentRoot "G:\WWWROOT\entersgu"
    ServerName 127.0.0.2
</VirtualHost>

 

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇