【发布时间】:2020-01-10 14:51:40
【问题描述】:
folder tree 这对我有用(来自 index.html,在浏览器(apache2)中输入 akaleaf.com)
<form action="love512.png" method="GET">
但这不是(即使我在每个文件夹中都有 love512.png)
<form action="../cgi-bin/love512.png" method="GET">
<form action="cgi-bin/love512.png" method="GET">
<form action="/cgi-bin/love512.png" method="GET">
<form action="/var/www/akaleaf.com/cgi-bin/love512.png" method="GET">
按下这 4 个 index.html 版本的按钮后,我出现“未找到。在此服务器上未找到请求的 URL。”在第一个正确打开 love512.png 图像。
每个文件夹和文件(以 'www' 文件夹开头)都有 777 访问权限并 chown 到 akaleaf(me) 组
【问题讨论】:
-
Web 服务器通常无法访问 docroot 文件夹之外的任何内容,在这种情况下似乎是
public_html(尽管我需要查看httpd.conf的内容才能知道肯定)。这就是为什么唯一有效的是第一个。 -
@kmoser 感谢您的回复。我没有
httpd.conf文件,但我有akaleaf.com.conf文件(etc/apache2/sites-available),其中包含以下内容:<VirtualHost *:80> ServerAdmin admin@akaleaf.com ServerName akaleaf.com ServerAlias www.akaleaf.com DocumentRoot /var/www/akaleaf.com/public_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>