我不能在 Apache 中使用别名权限被拒绝

i can't alias in Apache permission denied

为什么我不能在 Apache 权限被拒绝中使用别名?

这是我的代码:

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        ServerName ayandap.com
        ServerAlias www.ayandap.com
        Alias /home /public_html/Login

        <Directory /public_html/Login>
          Order allow,deny
          Allow from all
          Require all granted
        </Directory>

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

</VirtualHost>

您的虚拟主机配置不正确。您没有定义文档根目录。请参考下面的示例配置。

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName ayandap.com
    ServerAlias www.ayandap.com
    DocumentRoot /var/www/public_html/Login

    Alias /home /var/www/public_html/Login

    <Directory /var/www/public_html/Login>
      Order allow,deny
      Allow from all
      Require all granted
    </Directory>

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

如果仍然出现错误,请尝试注释掉最后两行,

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