【问题标题】:Is it impossible to have more than one alias?难道不可能有多个别名吗?
【发布时间】:2021-03-11 19:16:56
【问题描述】:

我在 Windows 10 上配置 httpd,一切正常 - 除了我不能为同一个 VirtualHost 配置多个别名。

我的extra/httpd-vhosts.conf文件(变量在httpd.conf中配置):

<VirtualHost *:80>
    # Define Server Defaults
    ServerAdmin "${SERVER_ADMIN}"
    ServerName "${SERVER_NAME}"
    ServerAlias "www.${SERVER_NAME}"

    # Define public_html Directory
    DocumentRoot "${PUBLIC_HTML}"

    # Define Log Paths
    ErrorLog "${ROOTDIR}/logs/${SERVER_NAME}-error.log"
    CustomLog "${ROOTDIR}/logs/${SERVER_NAME}-access.log" common

    # Create phpMyAdmin alias
    Alias "/phpmyadmin" "${PMA}"
    <Directory "${PMA}">
        Require local
    </Directory>

    # Create an alias for old `public_html` directories
    Alias "/archive" "${ROOTDIR}/archive/"
    <Directory "${ROOTDIR}/archive/">
        Require all granted
    </Directory>
</VirtualHost>

当我检查httpd -t 时,我收到Syntax OK,我可以访问http://localhost/phpmyadmin/, 但我无法访问 http://localhost/archive/。

截图:

phpMyAdmin 没问题,但是:

/archive 不是。

为什么?

感谢您的帮助,请原谅我的英语不好。

【问题讨论】:

    标签: apache httpd.conf vhosts


    【解决方案1】:

    问题已解决:是的,确实!我只需要:

    Options Indexes FollowSymLinks Multiviews
    

    &lt;Directory ...&gt;&lt;/Directory&gt;.

    代码:

    <Directory "${ROOTDIR}/archive">
        Options Indexes FollowSymLinks Multiviews
        Require all granted
    </Directory>
    

    【讨论】:

      猜你喜欢
      • 2013-10-04
      • 2011-03-24
      • 2011-01-17
      • 2014-08-08
      • 1970-01-01
      • 2018-02-22
      • 2013-04-27
      • 2011-04-23
      • 1970-01-01
      相关资源
      最近更新 更多