Apache 文件显示为索引但不可访问
Apache files shown as index but not accessible
我在 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>
检查(修复)文件的权限,以便 readable/accessible 对其他文件(例如在您的配置中设置的 Apache 用户)。通常设置别人已读,别人设置execute/search。例如目录chmod 755,文件chmod 644 [所有者读取,所有者写入,组读取,其他读取]。
您还可以将文件夹设置更改为:
<Directory /home/explorer/HTMLCoinExplorer/HTMLCoin-Abe/htdocs/>
Options All
AllowOverride All
Require all granted
</Directory>
只是为了测试
我在 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>
检查(修复)文件的权限,以便 readable/accessible 对其他文件(例如在您的配置中设置的 Apache 用户)。通常设置别人已读,别人设置execute/search。例如目录chmod 755,文件chmod 644 [所有者读取,所有者写入,组读取,其他读取]。 您还可以将文件夹设置更改为:
<Directory /home/explorer/HTMLCoinExplorer/HTMLCoin-Abe/htdocs/>
Options All
AllowOverride All
Require all granted
</Directory>
只是为了测试