我刚刚为Apache mod_security安装了CRS,它将报告所有PDF文件为可能的攻击。 具体而言,这是modsecurity_crs_20_protocol_violations.conf导致这些文件以0开头的麻烦。 当用户试图下载任何PDF文件,我得到这个日志(域名更改): [Tue Jul 08 15:02:40.695235 2014] [ratelimit:error] [pid 6875:tid 140072931452672] [client 149.255.82.154:57722] AH01457: rl: brigade pass failed., referer: http://example.com/downloads/ [Tue Jul 08 15:02:41.081811 2014] [:error] [pid 6875:tid 140072923059968] [client 149.255.82.154] ModSecurity: Warning. String match "bytes=0-" at REQUEST_HEADERS:Range. [file "/etc/httpd/crs/activated_rules /modsecurity_crs_20_protocol_violations.conf"] [line "428"] [id "958291"] [rev "2"] [msg "Range: field exists and begins […]
我们在我们的proxy_ajp.conf中有类似下面的指令,这会给我们一个404。 SSLProxyEngine On ProxyPass /test https://www.purple.com/test? ProxyPassReverse /test https://www.purple.com/test? 当我们(最后)只删除问号,它的工作。 我找不到任何提及的问号是一个保留的字符或任何东西。 问题是,为什么会发生? 我的猜测是,如果我想包括问号,那就需要逃脱。 我目前没有testing平台(这是我们的产品代理,有问题)。 只是为了好玩(尽pipe这个问题并不重要),最初的意图是在不包含问号的情况下在代码中构build查询,一旦我们发现问题是问号,我们现在将问号放在查询。
我陷入了一个大问题,但让我从一个部分开始。 我正在为此工作: RewriteRule ^(.*)index.html $1 [R=301,L] 虽然这不: RewriteCond %{REQUEST_FILENAME} index\.html [NC] RewriteRule ^(.*) main.redirect.php [QSA,L] 而这个也不行: RewriteRule ^(.*)index.html main.redirect.php [NC,QSA,L] 有任何想法吗? 我使用这个作为主要问题的一部分,客户希望我只对以下一个或所有条件进行一次redirect www缺失(放在前面) index.html在最后(删除它) CAPS存在(转换为小写) 为了达到这个目的,我创build了一个能完成所有工作的php文件,我需要在上面的任一条件中调用它(php文件将会redirect)。 <?php $sURL = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; echo '$sURL = ' . $sURL . '<br />'; $sURL = strtolower($sURL); if (substr($sURL, 0, 4) != 'www.') { $sURL = 'www.' . […]
我最近开始使用suPHP,并且花费了大量时间debuggingconfiguration和不同的编译选项,以获得实际可行的结果。 我已经尝试过通过他们的邮件列表联系开发团队,但显然是由幽灵组成的。 我正在尝试使用chroot参数,但它触发了一个我无法解决的500内部错误。 我为DocumentRoot定义使用DBD MySQL: <VirtualHost *:80> ServerName * DBDriver mysql DBDParams <params> DBDocRoot "SELECT document_root FROM domains WHERE name=%s" HOSTNAME suPHP_Engine on AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml suPHP_AddHandler application/x-httpd-php </VirtualHost> 一旦VirtualHost设置了DocumentRoot,suPHP应该应用一个额外的chroot。 请参阅下面我的/etc/suphp.conf的相关部分: docroot=${HOME} chroot=${HOME} allow_file_group_writeable=false allow_file_others_writeable=false allow_directory_group_writeable=false allow_directory_others_writeable=false check_vhost_docroot=false chroot参数不可能更简单,但suPHP spits: Caused by SystemException in API_Linux.cpp:465: chdir() failed: No such file or […]
我有2个后端运行apache2服务器,并在他们和客户之间有一个haproxy。 如果我testing了这些apache2服务器的任何一个ab我得到了一个1500TPS的北部,但是当我进行台架testingHAproxy时,我得到的值小于这个值。 这是没有道理的。 我正在使用简单的循环algorithm进行平衡,并将我的maxconn设置为8000,以便进行较好的测量。 我期望的是接近每个apache2节点(2800TPS)的总tps的tps。 相反,我得到的值比两个apache2节点中的任何一个都less。 可能是什么原因? 我做的板凳testing ab -t 60 -c 400 haproxyIP:1234 HEre是HAproxyconfiguration非常标准,但应该完成我所需要的。 global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy maxconn 8000 user haproxy group haproxy daemon defaults log global mode http option httplog option dontlognull retries 3 maxconn 8000 contimeout 5000 clitimeout 50000 srvtimeout 50000 errorfile 400 /etc/haproxy/errors/400.http errorfile […]
我有一个问题搞清楚在Centos6服务器上的Apache2虚拟主机的正确configuration。 我安装了一个安装了apache2(httpd)的干净的Centos6安装,默认情况下定义了/ var / www /图标 , / var / www / errors和/ var / www / cgi-bin内容文件夹它们是在/etc/httpd/conf/httpd.conf中configuration的。 我configuration了2个域a.com和b.com ,为此我创build了文档文件夹/var/www/a.com和/var/www/b.com ,并在/etc/httpd/conf/httpd.conf我configuration了NameVirtualHost NameVirtualHost *:80 并为a.com和b.com添加了相应的虚拟主机 <VirtualHost *:80> ServerAdmin [email protected] ServerName a.com ServerAlias www.a.com DocumentRoot /var/www/a.com <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory "/var/www/a.com"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> […]
我有一个Linux服务器与incrontab。 这是我的incrontab / home / pi / upload IN_MODIFY / bin / sh / home / pi / autoprint $ @ / $# 如果我是一个root用户,我试图在'上传'文件夹内创build一个新的pdf文件,并且incrontab事件被触发,但是,如果我通过web服务器上传文件 http://127.0.0.1/upload.php ,在“上传”文件夹内创build一个新文件,但事件没有触发 所有创build的文件都被识别并触发incrontab脚本,但是由'www-data'创build的文件不会被触发。 为什么? 谢谢
如果我尝试telnet [myserver.mydomain.com] 25我得到 Trying [ip number]… telnet: Unable to connect to remote host: Connection refused 但我仍然得到奇怪的请求,如下面的var_dump($_SERVER) ,他们似乎已经连接到25(!?),并错误地认为服务器名称是mx3.mail2000.com.tw或mta6.am0.yahoodns.net 。 为什么? 这是什么意思? 港口25是否开放? 什么是远程用户或计算机试图做什么,我应该怎么做? [_SERVER] => Array ( [SCRIPT_URL] => / [SCRIPT_URI] => http://mx3.mail2000.com.tw:25/ [PATH] => /sbin:/usr/sbin:/bin:/usr/bin [SERVER_SIGNATURE] => <address>Apache/2.2.15 (CentOS) Server at mx3.mail2000.com.tw Port 25</address> [SERVER_SOFTWARE] => Apache/2.2.15 (CentOS) [SERVER_NAME] => mx3.mail2000.com.tw [SERVER_ADDR] => 178.[rest of […]
我有一个金字塔服务器运行在EC2通过Apache与以下configuration – <Directory path_to_virtual_env> WSGIProcessGroup pyramid Require all granted Order allow,deny Allow from all SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/html text/css text/plain application/x-javascript application/x-font-woff BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html ExpiresActive On ExpiresDefault "access plus 1 year" Header append Cache-Control "public" </Directory> 我能够运行GZIP压缩端口80金字塔服务器,但就expiry模块而言,我得到以下响应的大部分文件 – 我已经确保expires模块正在执行 – sudo a2enmod expires和sudo a2enmod headers但是我得到了和上面相同的响应。 我已经尝试了很多来自这个主题的stackoverflow的答案,但仍然没有成功。 […]
我在我的服务器上安装了mod_pagespeed,它的工作就像页面标题一样: X-Mod-Pagespeed:1.7.30.5-3847 问题是它没有别的办法。 没有空白或评论删除或任何将是显而易见的。 我怎么能在我的服务器上安装它? 我需要添加什么才能使其工作,我应该编辑哪些文件? 如果我能做到这一点,那么我可以弄清楚其余的事情! 启用网站的网站configuration文件: <VirtualHost *:80> ServerAdmin [email protected] ServerName site.com #ServerAlias www.site.com DocumentRoot /var/www/site.com/html/ ErrorLog /var/www/site.com/logs/error.log CustomLog /var/www/site.com/logs/access.log combined WSGIScriptAlias / /var/www/site.com/django/site.com/django.wsgi Alias /static/ /var/www/site.com/html/static/ <Location "/static/"> Options -Indexes </Location> Alias /media/ /var/www/django/contrib/admin/media/ </VirtualHost> WSGI文件: import os, sys sys.stdout = sys.stderr sys.path.append('/var/www/site.com/django') sys.path.append('/var/www/site.com/django/sitename') os.environ['DJANGO_SETTINGS_MODULE'] = 'sitename.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() […]