【问题标题】:How to setup apache with 2 laravel project如何使用 2 laravel 项目设置 apache
【发布时间】:2019-03-13 09:26:23
【问题描述】:

首先我复制 000-default.conf

cp 000-default.conf 演示

然后我将演示链接到站点可用

ln -s ../sites-available/demo demo

这是我的000-default.conf 我想在 www.example.com 设置项目运行

<VirtualHost *:80>
     ServerName example.com
     ServerAlias demo.example.com/
     DocumentRoot /var/www/html/test/
     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combin
    </VirtualHost>

这是我想在 demo.example.com 中运行的演示文件

<VirtualHost *:80>
 ServerName www.example.com
 DocumentRoot /var/www/html/main/public
 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined
 <Directory /var/www/html/main/public>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Require all granted
        </Directory>
</VirtualHost>

之后我运行 service apache2 restart 我只能进入 www.example.com 但我不能进入 demo.example.com 。我不确定我做错了什么

【问题讨论】:

    标签: laravel apache ubuntu apache2


    【解决方案1】:

    所以我觉得有必要说几件小事 - 首先,我总是将 .conf 留在复制的文件上。其次,我总是使用a2ensitea2dissite 来启用和禁用任何网站。

    如果您使用的是example.com 域名,我也会在这种情况下禁用默认站点。如果您的默认站点当前未启用,这就是您无法访问 demo.example.com 的原因 - 如果您要访问该站点,则需要通过运行 a2ensite 000-default 来启用它

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-19
      • 1970-01-01
      • 1970-01-01
      • 2016-07-07
      • 1970-01-01
      • 1970-01-01
      • 2015-12-07
      • 2020-05-20
      相关资源
      最近更新 更多