获取“403访问被拒绝”错误,而不是服务文件(使用django,gunicorn nginx) 我正在尝试使用nginx从django提供私人文件。 对于X-Access-Redirect设置,我遵循以下指南 http://www.chicagodjango.com/blog/permission-based-file-serving/ 这是我的网站configuration文件(/ etc / nginx / site-available / sitename): server { listen 80; listen 443 default_server ssl; server_name localhost; client_max_body_size 50M; ssl_certificate /home/user/site.crt; ssl_certificate_key /home/user/site.key; access_log /home/user/nginx/access.log; error_log /home/user/nginx/error.log; location / { access_log /home/user/gunicorn/access.log; error_log /home/user/gunicorn/error.log; alias /path_to/app; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme […]
我无法解决这个问题几天。 我已经在virtualbox上的最新的Ubuntu服务器上安装了nginx。 我有一个共享的virtualbox文件夹,其中包含Web根目录。 web根目录的所有者是root,它的组是vboxsf。 我已将www-data用户添加到vboxsf组,并通过“groups www-data”进行validation。 nginx的用户是www-data。 我可以通过“ps aux | grep nginx”来validation。 但是当我尝试访问index.html时,我仍然禁止403。 请帮忙!!!
我在Windows 7×64上安装了EasyPHP 12.1(最新版本),我试图为PHP启用mod_fcgid 。 我在httpd.conf添加了以下内容 Include conf/extra/httpd-vhosts.conf LoadModule fcgid_module modules/mod_fcgid.so FcgidInitialEnv PHPRC "C:\progra~2\EasyPHP-12.1\php\php546x121028092509" AddHandler fcgid-script .php FcgidWrapper "C:\progra~2\EasyPHP-12.1\php\php546x121028092509/php-cgi.exe" .php 和Options ExecCGI Indexes FollowSymLinks在<Directory "${path}/www"> 我已经确定path都很好,并在整个C:\progra~2\EasyPHP-12.1上设置权限,并将我的www root权限设置为Everyone – Allow All 。 然而,我仍然得到403所有服务器(本地主机)请求。 随着Apache/2.4.2 (Win32) PHP/5.4.6 mod_fcgid/2.3.7所以我知道 mod_fcgid启用,并导致403。 从httpd.conf注释掉上面的这些行使得它再次起作用,但是比死亡要慢(这就是为什么我想要mod_fcgid)。 我可能做错了什么? 编辑::错误日志 AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host.example.com] does not exist AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host2.example.com] does not exist [Mon Nov […]
我试图改变我的文档在Apache的根,所以我可以开始一个新的项目,并保持一个旧的可用,所以我可以参考文件。 每当我尝试更改文档根目录时,我都会收到一个403 Forbidden错误。 这似乎我已经尝试了一切。 在httpd.conf文件中,我更改文档根行和括号中的行: DocumentRoot "/Full/Path/To/Root" <DIRECTORY /Full/Path/To/Root /> I'm not looking at the file right now, but I've changed this part too 我把新的根目录放在默认的相同位置,所以这些权限应该是确定的。 我已经将根目录的权限更改为777和744,它仍然无法正常工作。 我花了很多时间寻找一个可行的解决scheme,但到目前为止,没有任何工作。 在Apache的错误日志中,出现的信息是“由于服务器configuration而拒绝了权限”(当我有机会find确切的信息时,我会确定并发布它)。 任何帮助,非常感激。 我使用Apache v2和php 5.5运行Mac OS Lion(如果有的话)。 编辑:错误日志中的错误说[服务器configuration:/库/ Web服务器/定制服务器/客户端拒绝] [客户端fe80 :: 1]客户端拒绝[错误日志7月22日14:43:38 2013]
我负责在Red Hat 4.1.2上使用Apache 2.0的网站。 我已经configuration站点来显示一个自定义的错误页面,把这一行添加到站点根目录下的.htaccess文件中: ErrorDocument 403 /403.html 为了testing,我在网站应用程序中封锁了我自己的IP地址; 这在.htaccess文件中产生了这样的结果(为了简洁起见,我编辑了列表并修改了IP): SetEnvIfNoCase REMOTE_ADDR "^(0\.0\.0\.1|0\.0\.0\.2|0\.0\.0\.3).*" BadIP deny from env=BadIP 当我尝试从“糟糕的”IP访问网站时,如果我尝试获取特定页面(例如http://example.com/index.html ),则会出现自定义错误页面。 但是,如果我尝试获取根目录(例如http://example.com ),那么我将获得Apachetesting页。 有没有办法让网站的根目录与自定义错误页面一起工作? 编辑:我想我可能会造成一些困惑。 澄清: 当我尝试获取根url时, 不会提供根网页; 我得到的是这样的页面:“如果你能阅读这个页面,这意味着安装在这个站点上的Apache HTTP服务器正常工作。” 所以我按预期阻止,但我只是没有得到403错误页面。 当我试图得到根之下的任何东西,我得到我的自定义403.html页面 更新 : 我已经尝试了更新的Apache版本(2.2.25)。 我也尝试过没有 ErrorDocument指令或SetEnv的东西。 .htaccess文件只包含这3行: order allow,deny allow from all deny from 0.0.0.0 其中0.0.0.0被我的实际IP地址取代。 结果是一样的:当获得example.com时,我得到了Apache“如果你可以阅读这个”testing页面,当获取example.com/x时,我得到内build的“禁止…你没有权限访问此服务器上的/ x“页面。
我的Apache2安装有一些问题。 硬盘故障的最后一周我做了一个普通的备份,把硬盘换成新的,再次安装所有的SO(Debian 7 AMD64)和Apache2。 我已将所有数据从备份还原到新磁盘。 我再次configuration了与上次安装相同configuration的虚拟主机,但是这次我尝试访问除只托pipe静态内容的虚拟主机。 Apache错误文件没有错误,Apache启动时也没有错误或警告。 我还检查了文件系统的权限和所有者。 这是我的configuration文件: apache2.conf ServerRoot "/etc/apache2" LockFile ${APACHE_LOCK_DIR}/accept.lock PidFile ${APACHE_PID_FILE} Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 5 <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <IfModule mpm_worker_module> StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <IfModule […]
在我的Apache安装程序中,我有一个包含我的错误页面的目录(404 403)。 但是,我不希望这个目录是直接可见的 – 我想访问它返回404。所以我做的是这样的: # Use /hidden/404/ as the 404 page ErrorDocument 404 /hidden/404/ # Use /hidden/403/ as the 403 page ErrorDocument 403 /hidden/403/ <Directory /path/to/root/hidden/> # All requests return 404 RedirectMatch 404 .* </Directory> 问题是在这种情况下,即使我明确告诉它(即处理404和403错误),Apache似乎也不愿意在这种情况下提供文件。 实际上,当我访问/hidden ,我收到以下消息: The requested URL /hidden/404/ was not found on this server. Additionally, a 404 Not Found error […]
我刚刚带了一个域名(example.com),并设置了一个URL框架redirect到我的服务器的IP XXX.XXX.XXX.XXX,但是我得到一个403禁止的错误。 我可以通过服务器IP访问页面。 我想要的是复制的服务器IP使用我的域的行为,所以我试图复制我的IP虚拟主机,但它不工作。 这是我的虚拟主机文件: server { listen 80; server_name example.com ; access_log /var/log/nginx/website.access_log; error_log /var/log/nginx/website.error_log; root /var/www; index index.html; location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/phpMyAdmin; include fastcgi_params; } } 而我目前用IP直接访问服务器(工作): server { listen 80; server_name xxx.xxx.xxx.xxx ; access_log /var/log/nginx/website.access_log; error_log /var/log/nginx/website.error_log; root /var/www; index index.php; location […]
我有一个网站经常发布从客户端到服务器的数据约3200个字符。 我注意到,特别是在访问一个页面时,站点的一些用户将发出一个HEAD请求,其中最长的发布值是一个/ 。 这导致文件名太长的错误和403响应代码。 有什么理由为什么浏览器经常会出现这些错误的HEAD请求? 有没有办法让我把这些请求redirect到相应的POST请求?
我已经安装了Apache: Server version: Apache/2.4.12 (Fedora) ,我有一个Codeigniter的网站。 我在网站的根目录中添加了一个文件夹images/ ,我无法加载图像。 当我尝试图像的URL的完整path时,我得到了403 – You don't have permission to access /images/image.jpg on this server. 无论如何,这只是与图像发生。 从网站的任何其他url就像一个魅力。 但后来我发现了这个答案: 在Apache上用Apache在Apache上获得403,并使用root我做到了: setsebool -P httpd_enable_homedirs 1 setsebool -P httpd_read_user_content 1 而现在,我得到403 error在Codeigniter网站的所有url的403 error 。 如果我直接进入http://localhost/它会向我显示刚刚安装Apache和所有内容时所获得的Fedora test page 。 然后我读了这个: http : //linux.die.net/man/8/setsebool,并试图扭转我所做的一切: setsebool -P httpd_enable_homedirs 0 setsebool -P httpd_read_user_content 0 但没有发生。 我一直看到Fedora test […]