ubnutu 16.04 laravel虚拟主机即使按照说明执行所有步骤也无法工作

时间:2019-04-25 03:15:45

标签: laravel ubuntu-16.04 hosting installation-package

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

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

下面是我的项目conf文件:

<VirtualHost *:80>
    ServerAdmin dipaks_id@yahoo.co.in
    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

2 个答案:

答案 0 :(得分:0)

您拥有forum.dev域吗?

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

答案 1 :(得分:0)

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

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

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