简体   繁体   English

此apache2.4和laravel设置的合适虚拟主机是什么?

[英]What is the appropriate virtual host for this apache2.4 and laravel setup?

I have an internal site I call eaglets . 我有一个内部站点,称为eaglets I use it to host a bunch of javascript calculators and such. 我用它来托管一堆JavaScript计算器等。 I want to use a laravel app and have the address look like http://eaglets/playground . 我想使用laravel应用,地址看起来像http://eaglets/playground

I have the playground folder in my var/www/html directory, which is my default document root. 我的var/www/html目录中有“游乐场”文件夹,这是我的默认文档根目录。

If I put a dummy index.html in my var/www/html/playground/ folder and go http://eaglets/playground , it comes up fine. 如果我在var/www/html/playground/文件夹中放置一个虚拟index.html并转到http://eaglets/playground ,它将很好。 This leads me to believe my vhost is not pointing correctly to the var/www/html/playground/public folder. 这使我相信我的虚拟主机未正确指向var/www/html/playground/public文件夹。

This is my virtual host file: 这是我的虚拟主机文件:

  1 <VirtualHost *:80>
  2
  3         ServerName eaglets/playground
  4         ServerAlias eaglets/playground
  5         DocumentRoot /var/www/html/playground/public
  6         <Directory /var/www/html/playground/public>
  7                 Options -Indexes +FollowSymLinks +MultiViews
  8                 AllowOverride All
  9                 Require all granted
 10         </Directory>
 11
 12         ErrorLog ${APACHE_LOG_DIR}/playground-error.log
 13         CustomLog ${APACHE_LOG_DIR}/playground-access.log combined
 14
 15 </VirtualHost>

Any ideas? 有任何想法吗?

If I do apachectl -SI get: 如果我使用apachectl -SI,则会得到:

    VirtualHost configuration:
*:80 is a NameVirtualHost
default server eaglets (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost eaglets (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost eaglets/playground (/etc/apache2/sites-enabled/playground.conf:1)
alias eaglets/playground
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"

I have same usecase and here is config(names&paths changed to yours): 我有相同的用例,这里是config(名称和路径更改为您的):

<VirtualHost *:80>
    ServerName eaglets
    Alias /playground /var/www/html/playground/public

    <Directory /var/www/html/playground/public>
        Options FollowSymLinks
        AllowOverride All
    </Directory>
</VirtualHost>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM