我在访问运行在Ubuntu上的Apache 2.4上的文件时遇到了一些麻烦。
无法访问的文件显示在别名文件夹/ static /.
中
尝试访问显示的任何项目时,我收到以下消息。
Not Found
The requested URL /static/abe.css was not found on this server.
此虚拟主机文件看起来像......
<VirtualHost *:80>
ServerName explorer.htmlcoin.com
Alias /static/ /home/explorer/HTMLCoinExplorer/HTMLCoin-Abe/htdocs
Alias /robots.txt /home/explorer/HTMLCoinExplorer/HTMLCoin-Abe/htdocs/robots.txt
Alias /favicon.ico /home/explorer/HTMLCoinExplorer/HTMLCoin-Abe/htdocs/favicon.ico
Alias / /usr/lib/cgi-bin/abe.fcgi/
# FcgidIOTimeout 40
ServerAdmin webmaster@localhost
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /home/explorer/HTMLCoinExplorer/HTMLCoin-Abe/htdocs>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /home/explorer/cgi-bin>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
# Uncomment to log Abe requests.
ErrorLog /var/log/abe_error.log
CustomLog /var/log/abe_access.log combined
</VirtualHost>
答案 0 :(得分:1)
检查(修复)文件权限,以便其他人可读/可访问(如配置中设置的Apache用户)。通常由其他人设置读取并由其他人执行/搜索。例如,chmod 755用于目录,644 [由所有者读取,由所有者写入,按组读取,由其他人读取]用于文件。 您还可以将文件夹的设置更改为:
<Directory /home/explorer/HTMLCoinExplorer/HTMLCoin-Abe/htdocs/>
Options All
AllowOverride All
Require all granted
</Directory>
只是为了测试