ubuntu 16.04 laravel虚拟主机即使按照描述执行所有步骤也无法正常工作

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

Laravel在ubuntu 16.04中进行项目,并提供了如上所述创建虚拟主机的步骤,但即使在不同的端口上服务或没有服务也无法工作。

我的系统是ubuntu 16.04,启用了模式重写,在apache2.conf中允许覆盖以下所有位置:/ var / www / html / study / forum

以下是我的项目conf文件:

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName www.forum.dev
    DocumentRoot /var/www/html/study/forum/public

<Directory /var/www/html/study/forum/public/>
    Options -Indexes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
    <FilesMatch \.php$>
        # Change this "proxy:unix:/path/to/fpm.socket"
        # if using a Unix socket
        #SetHandler "proxy:fcgi://127.0.0.1:9000"
    </FilesMatch>
</Directory>

ErrorLog ${APACHE_LOG_DIR}/myapp.com-error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/myapp.com-access.log combined
</VirtualHost>

下面是我的/ etc / hosts文件:

127.0.0.1   localhost
127.0.1.1   dipak-Inspiron-560s
127.0.1.1   www.forum.dev
192.168.0.7 www.forum.dev
laravel ubuntu-16.04 hosting installation-package
2个回答
0
投票

你拥有forum.dev域名吗?

.dev域在开发环境中是no longer able can be used。尝试使用.local或其他域名。


0
投票

.dev域仅适用于HTTPS(端口443)。您的VirtualHost使用HTTP(端口80)设置。检查https://get.dev/#benefits

您需要安装SSL证书并使用443端口配置VirtualHost。

在DigitalOcean的社区上查看本教程:https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-16-04

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