phpstudy中apache的默認根目錄的配置

  默認配置文件是:vhosts.conf。php

  安裝laravel後須要把根目錄配置到public。laravel

  下面的配置須要在本地計算機的host文件配置域名,一個是「localhost」,一個是「www.gohosts.com」域名。下面第一個配置是「localhost」訪問,第二個配置是「www.gohosts.www」域名訪問。ide

<VirtualHost _default_:80>
DocumentRoot "C:\phpStudy\PHPTutorial\WWW\public"
    ServerName localhost
    ServerAlias localhost
  <Directory "C:\phpStudy\PHPTutorial\WWW\public">
#下面被註釋的代碼,用「localhost」訪問時會禁止訪問
#Options -Indexes -FollowSymLinks +ExecCGI Options FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "C:\phpStudy\PHPTutorial\WWW\public" ServerName www.gohosts.com ServerAlias gohosts.com <Directory "C:\phpStudy\PHPTutorial\WWW\public"> Options FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost>
相關文章
相關標籤/搜索