Apache文件权限拒绝服务器访问 [英] Apache file permissions deny server access

查看:513
本文介绍了Apache文件权限拒绝服务器访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Docker容器debian:jessie上运行apache 2.4时遇到代理重定向问题。

I have a proxy redirect problem with apache 2.4 running on a docker container debian:jessie.

我的服务器配置如下:

<Directory "{{SERVER_ROOT}}">
Options Indexes FollowSymLinks
# New directive needed in Apache 2.4.3:
Require all granted
</Directory>

.htaccess规则:

And a .htaccess rule:

# Redirect crawlers to prerender (crawl)
RewriteCond %{HTTP_USER_AGENT} !^Prerender
RewriteCond %{HTTP_USER_AGENT} (Google|facebookexternalhit/1.1|Facebot|facebookexternalhit|Googlebot|bingbot|Googlebot-Mobile) [NC]
RewriteCond %{QUERY_STRING} _escaped_fragment_|prerender=1
RewriteRule ^ http://prerender:3000/https://demo.mysite.com%{REQUEST_URI} [P,L]

调用预渲染服务器时:

curl -k -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"  https://demo.mysite.com/\?_escaped_fragment_\=/scan-f

apache-ssl-error.log中出现以下错误:

I get the following error in apache-ssl-error.log:

[Fri Dec 04 16:21:38.346574 2015] [core:error] [pid 14] (2)No such file or directory: [client 10.0.9.156:39937] AH00132: file permissions deny server access: proxy:http://prerender:3000/https://demo.mysite.com/index.php?_escaped_fragment_=/scan-f

我有选中,所有相关文件都具有用户和组apache。
Prerender服务器可从debian访问,并且直接调用代理URL。另外,所有站点都可以从浏览器访问,但不能用于重定向。

I have checked and all relevant files have user and group apache. Prerender server is accesible from debian, and calling the proxy url directly works. Also, all the site is accessible from the browser, but not for the redirect.

任何人都知道我在做什么错吗?

Any idea what I am doing wrong?

谢谢!

推荐答案

所以我最终完成了它。我必须安装并启用mod_proxy:

So I got it working in the end. I had to install and enable mod_proxy:

apt-get install libapache2-mod-proxy-html

a2enmod proxy \
&& a2enmod proxy_http \
&& a2enmod proxy_ajp \
&& a2enmod rewrite \
&& a2enmod deflate\
&& a2enmod headers \
&& a2enmod proxy_balancer \
&& a2enmod proxy_connect \
&& a2enmod proxy_html

这篇关于Apache文件权限拒绝服务器访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆