Laravel无法在Localhost上显示Apache默认页面.虚拟主机更改失败



我必须制作laravel应用程序并传递dockerfile,但我真的坚持了下来。在此之前,我在机器上安装了Laravel的噩梦。

我正在尝试获取Dockervel图像,并且我正在关注此处的步骤:http://www.spiralout.eu/2015/12/dockervel-laravel-development.html

i在之前遇到了问题,然后进行更改:错误启动userland代理:听tcp0.0.0.0.0.0:3306:bind:bind:已使用的地址

一切都很好,直到步骤

修复权限: dpermit 现在您有一个注册系统活动。去 到localhost 并注册新用户以查看DB运行正常。

当我去local主机时,我会得到:apache2 ubuntu默认页面https://assets.digitalocean.com/articles/lamp_1404/default_apache.png

我已经抓住了这个:当我运行

$ dcomposer-create
It gets to the end but I get this 
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "/usr/bin/composer self-update" to get the latest version.
Installing laravel/laravel (v5.2.31)
  - Installing laravel/laravel (v5.2.31)
    Downloading: 100%         
Created project in /var/www
> php -r "copy('.env.example', '.env');"

shoud我在安装eith上移动或首先修复此操作?

i Alredy具有> var/www/laravel 中的Laravel项目(在本地Laravel环境上)。和我的etc/hosts文件看起来像:

127.0.0.1   laravel.example.com
127.0.1.1   me-Lenovo-Z50-75
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1  laravel.example.com

$ dcomposer-create dockervel/www/中创建应用程序。

我现在已经制作了 dockervel.example.com.conf in/etc/apache2/stites-abailable

<VirtualHost *:80>
        ServerName dockervel.example.com
        DocumentRoot /home/me/Desktop/dockerlaravel/dockervel/www/public
        DirectoryIndex index.php
        <Directory /home/me/Desktop/dockerlaravel/dockervel/www>
                Options FollowSymLinks
                AllowOverride None
        </Directory >
        <Directory >
                AllowOverride All
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

和更改/etc/hosts

127.0.0.1  dockervel.example.com
127.0.1.1   me-Lenovo-Z50-75
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1  dockervel.example.com

我也运行:

$ a2ensite dockervel.example.com
$ sudo service apache2 reload

我运行时:

apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost dockervel.example.com (/etc/apache2/sites-enabled/dockervel.example.com.conf:1)
         port 80 namevhost laravel.example.com (/etc/apache2/sites-enabled/laravel.example.com.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

,当我继续使用stustal

$ dnodejs nmp install - this is ok 
$ dnodejs gulp install
[17:40:09] Using gulpfile /var/www/gulpfile.js
[17:40:09] Task 'install' is not in your gulpfile
[17:40:09] Please check the documentation for proper gulpfile formatting

如您所见,所有都进入/var/www ,但我希望它在我的工作目录中/home/me/me/desktop/dockerlaravel/dockervel

我看不出问题是什么?

由于您已将端口更改为" 8084",您应该转到Localhost:8084如果您看到apache默认值,则可能正在浏览另一台服务器,因为dockervel是在nginx上构建的。
您也可能在Docker上有一些差距。不要将本地存储与Docker存储混合在一起。/var/www在容器中与您的本地/var/www不同。在docker-compose.yml中,您将本地〜/dockervel/www安装到容器/var/www。
我建议您再次重新开始,并恢复您对Apache服务器的更改。将其关闭,您不需要它。Dockervel将为您提供容器中的NGINX服务器。

最新更新