我想阻止访问我的Web服务器作为预防措施,但我不断收到我的错误日志中显示以下错误。 [Wed Jun 27 23:30:54 2012] [error] [client 86.77.20.107] client denied by server configuration:/home/www/default/Edu.jar [Wed Jun 27 23:32:40 2012] [error] [client 86.77.20.107] client denied by server configuration:/home/www/default/REST.jar [Wed Jun 27 23:35:39 2012] [error] [client 86.77.20.107] client denied by server configuration:/home/www/default/Set.jar [Thu Jun 28 01:01:17 2012] [error] [client 58.218.199.227] client denied by server configuration:/home/www/default/proxyheader.php [Thu Jun […]
对于其中一个子path,我试图限制只访问Intranet发起的请求。 我尝试了下面的configuration,但不能按预期工作。 <VirtualHost *:7777> Debug ON RewriteEngine On RewriteOptions inherit RewriteRule ^/$ /test1 [R,L] RewriteRule ^/test2$ – [R=404] [L] RewriteRule ^/stage$ /stage/test1 [R,L] RewriteRule ^/stage/test2$ – [R=404] [L] <IfModule weblogic_module> WebLogicCluster localhost:7003,localhost:7005 </IfModule> <Location /test1> SetHandler weblogic-handler </Location> <Location /test2> SetHandler weblogic-handler </Location> <Location /api> SetHandler weblogic-handler PathPrepend /test1 </Location> <Directory /stage/test1> Order deny,allow deny […]
我在Ubuntu 12.10上运行apache2。 当我使用“service apache2 status”命令并报告apache没有运行时,由于某种原因,apache默认网页继续在80端口上运行。 在我的站点可用的文件夹,我有一个基于python的应用程序被分配到端口80,但是当我重新加载和重新启动Apache2服务,并在浏览器中键入本地主机,它继续运行默认页面。 如何摆脱apache2在端口80上运行的任何东西?
我有这个问题与Web应用程序检查软件。 build议在Web服务器上禁用OPTION METHODS 。 经研究。 我已经包含这个片段在我的httpd.conf然后重新启动服务器。 LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so RewriteEngine On RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS) RewriteRule .* – [F] 我如何validation代码是否被实现,并将阻止所有的选项请求? 我已经试过了 curl –request OPTIONS http://10.1.1.1/mysite 但是我所得到的是301被Permantently移动 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="http://10.1.1.1/mysite">here</a>.</p> <hr> <address>Apache/2.2.22 (Ubuntu) Server at 10.1.1.1 Port 80</address> </body></html>
我正在使用Apache作为我正在构build的RESTful服务的前端。 所有对服务的访问都应该通过HTTPS来进行,所以我希望Apache能够通过403消息来响应任何HTTP访问,说明需要安全访问。 我将如何configurationApache来做到这一点? <VirtualHost *:80> ServerName api.digiumcloud.net # Stuff to force 403 responses here </VirtualHost>
我有一个网站运行使用Apache 2.2.22,PHP 5.3.10和cURL 7.2.00。 下面是apacheconfiguration的相关部分,您会注意到错误发送到www.example.com_error.log 。 <VirtualHost *:443> ServerName example.com ServerAlias www.example.com # *snip* ErrorLog ${APACHE_LOG_DIR}/example.com_error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/example.com_access.log combined </VirtualHost> 但是,当我从PHP内使用cURL,并使用curl_setopt($connection, CURLOPT_VERBOSE, true);详细日志loggingcurl_setopt($connection, CURLOPT_VERBOSE, true); cURL的输出进入Apache的error.log而不是我上面定义的自定义日志文件。 为什么是这样,我怎样才能让cURL的输出进入正确的日志文件?
我打开了apache的服务器状态模块,并打算只能从我自己的ip或通过连接到服务器本身的lynx文本浏览器进行浏览。 不幸的是,事实certificate,我能够从其他ips读取/服务器状态URL的细节,显然任何公共IP一般。 然而当我看到允许/拒绝堆栈时,对我来说似乎是正确的。 我试图首先拒绝,只允许从几个特定的位置第二。 我做错了什么? 这是我的httpd.conf # Uncomment the following lines to enable mod_status support: # ExtendedStatus On # ServerTokens Prod # Already set in the conf.d/security #Don't reveal server apache or debian details. <Location /server-status> SetHandler server-status Order Deny,Allow Deny from all Allow from localhost, bitlucid.com, 184.106.129.190, 67.247.170.88, 72.230.178.92 </Location>
如何configurationapache总是返回一个404的URL,其path组件以两个斜线(即“//”)开头? 我们只能从不了解与scheme相关的URL的机器人获得这样的请求(所以当他们看到像“//somecdn.com/thingy.js”的URL时,他们请求“ http://oursite.com//somecdn .com / thingy.js “)。 他们得到了一个404响应,这很好。 问题是404来自我们的Django代码,它忠实地然后发送给我们一封电子邮件,说有人得到了404,他们的引用是我们的网站。 这是我们相关的apacheconfiguration: DocumentRoot /nowhere Alias /static/ /our/static/files Alias /uploads/ /our/uploaded/files <VirtualHost :*80> ServerName oursite.com WSGIScriptAlias / /our/wsgi/script </VirtualHost> 我尝试插入RedirectMatch 404 "^//" DocumentRoot之后,但请求仍然以WSGI脚本结束。 每个请求更改正则expression式为"^/.*$" /。* "^/.*$" 404(如我所料)。 "^\/\/"似乎没有匹配任何东西。 我假设我正在碰撞某种多重/挤压,但我不知道如何绕过它。 这个Apache 2.2.22在Ubuntu 12.04上使用mod_wsgi 3.3。
我有以下的虚拟主机configuration: <VirtualHost *> ServerName books.domain.com ServerAlias ebooks.domain.com DocumentRoot /home/media/books/ <Directory /home/media/books> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog /home/domain.com/logs/error.log CustomLog /home/domain.com/logs/access.log combine ServerSignature Off </VirtualHost> <VirtualHost *> ServerName domain.com ServerAlias domain.info domain.net domain.org *.domain.com *.domain.info *.domain.net *.domain.org DocumentRoot /home/domain.com/public_html/ <Directory /home/domain.com/public_html> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny […]
首先,这似乎在我的服务器上工作正常,但我想知道任何“未知”的影响,尤其是任何可能发生的公共问题,如“Google现在恨你的服务器…” 我有大约10个域名,只是提供一个简单的“我们离线”信息。 我希望所有这些“离线” <VirtualHosts>使用相同的<DocumentRoot> ,如下所示: <VirtualHost *:80> ServerName example1.com ServerAlias www.example1.com DocumentRoot /www/_offline.com <Directory /www/_offline.com> …[snip]… </Directory> </VirtualHost> <VirtualHost *:80> ServerName example2.com ServerAlias www.example2.com DocumentRoot /www/_offline.com <Directory /www/_offline.com> …[snip]… </Directory> </VirtualHost> 我会有任何问题,这个设置,或者这是真的好吗?