phpstudy如何创建虚拟主机

来源:互联网 发布:淘宝能刷信用卡吗 编辑:程序博客网 时间:2024/04/29 03:04

1: 打开虚拟主机配置,打开D:\phpStudy\Apache\conf下的 httpd.conf文件去掉#Include conf/extra/httpd-vhosts.conf前面的#保存即可。在D:\WWW目录下建立web应用例如 classmath。

2: 打开D:\phpStudy\Apache\conf\extra下的httpd-vhosts.conf文件 删除该文件中的所有内容

<VirtualHost *:80>

 DocumentRoot "D:\WWW\classmath"

 ServerName web.classmath.com

</VirtualHost>

<Directory "D:\WWW\classmath">

    Options Indexes FollowSymLinks Includes ExecCGI

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

3: 添加一下代码 不要动

<VirtualHost *:80>

    ServerAdmin webmaster@dummy-host2.example.com

    DocumentRoot "D:\WWW"   #WWW.文件夹位置

    ServerName localhost

    ServerAlias localhost

    ErrorLog "logs/dummy-host2.example.com-error.log"

    CustomLog "logs/dummy-host2.example.com-access.log" common

</VirtualHost>


0 0