这里的Laravel配置文件的apache2域名和目录根目录是什么?

时间:2018-08-15 07:51:56

标签: php laravel

我正在按照此处的说明安装Laravel:https://websiteforstudents.com/install-laravel-php-framework-on-ubuntu-16-04-17-10-18-04-with-apache2-and-php-7-2-support/

大约说到一半,“然后将下面的内容复制并粘贴到文件中并保存。将突出显示的行替换为您自己的域名和目录根目录。”请查看下面的注释突出显示的行:

<VirtualHost *:80>   
  ServerAdmin admin@example.com
     DocumentRoot /var/www/html/MyProject/public
     ServerName example.com //This line here

     <Directory /var/www/html/MyProject/public>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

所以我查看了000-default.conf文件,它看起来像这样:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port t$
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

我认为我的目录根目录是/var/www/html,但是我不知道域名是什么(localhost?),以及如何在正确的一行上输入这两个内容格式。

编辑:这是针对本地开发版本的吗?我只是在尝试使用框架PHP和Mysql进行练习。

很抱歉,如果这是一个愚蠢的问题,但我是新手,需要从下个月在日本札幌(Sapporo)开始的新编码工作中学习该知识。

顺便说一句,我的面试官要我帮助他雇用更多的英语工程师。我们的堆栈是PHP与Laravel,Ruby on Rails,在后端使用AWS的Javascript,在Confluence和Bitbucket上使用Jira。

这不是官方的,所以我不能输入公司名称,但是请注意,这里的薪水往往较低。

1 个答案:

答案 0 :(得分:0)

对于这样的新手问题,我们感到抱歉,但是通过反复试验,我能够在下面的链接中安装以下说明。包含phpmyadmin的安装说明,因为它们包含在站点上的Laravel安装说明中。

Laravel和Phpadmin安装说明

Laravel instructions

phpadmin:

phpmyadmin instructions