phpstudy如何創建虛擬主機

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 [email protected]

    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>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章