我在 Apache Ubuntu 中不断收到 403 错误,与 Apache 2.4 中的别名有关

我在 Apache Ubuntu 中不断收到 403 错误,与 Apache 2.4 中的别名有关

我做了几个小时的研究。我正在运行 Ubuntu 22.04,使用的是最新版本,我没有对我的电脑做任何特殊或花哨的事情。我已经成功地让我的页面正确显示 PHP,所以这不是问题。我认为找到文档以成功创建别名会很容易。我注意到他们的图书馆里有一些来自 LinkedIn Learning 的课程,但它们是 2018 年的。我对 Apache 很警惕,尤其是当我在其他地方读到 Apache 2.2 版和 2.4 版之间发生了变化时。这是我到目前为止的代码。当我输入 test1 时,它没有链接到文件。这些是到目前为止我的文件的权限

4-rw-r--r-- 1 jake jake 19 Jun 13 02:30 index. 
4-rw-rw-r-- 1 jake jake 19 Jun 13 02:46 test.html. 


<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # 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/home/jake/Documents/coding
 #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

Alias "/test1" "file:///home/jake/Documents/coding"
<Directory "file:///home/jake/Documents/coding/home/jake/Documents/coding">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>




    # 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

相关内容