phpstudy中apache的默认根目录的配置

 2023-02-25    392  

  默认配置文件是:vhosts.conf。

  安装laravel后需要把根目录配置到public。

phpstudy中apache的默认根目录的配置

  下面的配置需要在本地计算机的host文件配置域名,一个是“localhost”,一个是“www.gohosts.com”域名。下面第一个配置是“localhost”访问,第二个配置是“www.gohosts.www”域名访问。

<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>

 

以上所述是小编给大家介绍的phpstudy中apache的默认根目录的配置,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持!

原文链接:https://77isp.com/post/34384.html

=========================================

https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。