我的Laravel项目拟使用lsapp.test(的httpd的虚拟主机+ .hosts)时WAMP主页

问题描述 投票:-1回答:1

我试图使用域lsapp.test访问我的Laravel项目WAMP。我可以用localhost/lsapp/public访问该网站,但是当我使用上面,我是送至WAMP首页。

这是对WAMP版本3.1.3与Apache 2.4.33,PHP 7.2.4。下面是我在httpd的虚拟主机文件。

<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot "C:/wamp64/www/lsapp/public/"
  ServerName lsapp.test
</VirtualHost>

Windows主机文件:

127.0.0.1 localhost
::1 localhost
127.0.0.1 lsapp.test
::1 lsapp.test

我搜索了一段时间,但没能找到任何与此特定问题的帮助。

laravel wamp
1个回答
1
投票

你应该有公共路径为DirectoryRoot为好。这是该格式。

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "C:/wamp64/www/lsapp/public"
    ServerName lsapp.test
    ServerAlias *.lsapp.test

    <Directory "C:/wamp64/www/lsapp/public">
        Options All
        AllowOverride All
        Require local

    </Directory>

</VirtualHost>

编辑:重新启动Apache服务器建立虚拟主机后生效

© www.soinside.com 2019 - 2024. All rights reserved.