Articles of apache 2.2

Ubuntu EC2 Apache 2:访问日志只显示内部虚拟连接

我正在亚马逊云服务上运行一个微型实例,最近的一个尖峰使得我们的networking服务器没有响应,我试图做一点研究,以确定这是否是DOS攻击,或者哪个进程占用了服务器。 我检查了Apache访问日志,我看到的是来自本地IP的内部虚拟连接 127.0.0.1 – – [18/Feb/2013:18:51:20 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Ubuntu) (internal dummy connection)" 这是一个例子,我注意到当我刷新网站时,尾巴的日志文件,它增加了一个新的logging。 为什么我看不到连接到IP的远程IP,如何更好地跟踪这个问题?

由http-host头部的mod_security块请求

最近几天,我注意到有些服务器正在遭受未知请求的攻击。 其中大部分如下所示: 60.246.*.* – – [03/Jan/2015:20:59:16 +0200] "GET /announce.php?info_hash=%80%85%8e%9bu%cfJ.%85%82%e9%25%bf%8e%9e%d7%bf%c5%b0%12&peer_id=-UT3420-v%8bN%aa%60%60%fd%5d%d1%b0Ux&port=15411&uploaded=48588531&downloaded=0&left=0&corrupt=0&key=9E124668&numwant=200&compact=1&no_peer_id=1 HTTP/1.1" 200 – 经过一番日志和search后,我发现一些中国的ISP(根据whatsmydns.net的结果可能是CERNET)和一些土耳其的ISP(可能是TTNET)响应dns查询,如a.tracker.thepiratebay.org与各种IP与海盗或洪stream无关。 换句话说,他们似乎做了某种DNScaching中毒的一些奇怪的原因。 因此,这些国家的数百个(如果不是数千个)BitTorrent客户端向我的networking服务器发出大量的“声明”,这导致了很多DDoS攻击,从而造成了Apache的所有连接。 目前我完全阻止了中国和土耳其的工作,但我想找一个更好的方法来阻止这些要求。 我正在考虑使用基于HTTP主机头的mod_security来阻止这些请求。 所有这些请求都包含一个HTTP主机头,比如a.tracker.thepiratebay.org (或者是其他的a.tracker.thepiratebay.org域的子域)。 这是通过PHP的$_SERVERvariables请求标题的转储。 DOCUMENT_ROOT: /usr/local/apache/htdocs GATEWAY_INTERFACE: CGI/1.1 HTTP_ACCEPT_ENCODING: gzip HTTP_CONNECTION: Close HTTP_HOST: a.tracker.thepiratebay.org HTTP_USER_AGENT: uTorrent/342(109415286)(35702) PATH: /bin:/usr/bin QUERY_STRING: info_hash=%80%85%8e%9bu%cfJ.%85%82%e9%25%bf%8e%9e%d7%bf%c5%b0%12&peer_id=-UT3420-v%8bN%aa%60%60%fd%5d%d1%b0Ux&port=15411&uploaded=48588531&downloaded=0&left=0&corrupt=0&key=9E124668&numwant=200&compact=1&no_peer_id=1 REDIRECT_STATUS: 200 REMOTE_ADDR: 60.246.*.* REMOTE_PORT: 3445 REQUEST_METHOD: GET REQUEST_URI: /announce.php?info_hash=%80%85%8e%9bu%cfJ.%85%82%e9%25%bf%8e%9e%d7%bf%c5%b0%12&peer_id=-UT3420-v%8bN%aa%60%60%fd%5d%d1%b0Ux&port=15411&uploaded=48588531&downloaded=0&left=0&corrupt=0&key=9E124668&numwant=200&compact=1&no_peer_id=1 SCRIPT_FILENAME: /usr/local/apache/htdocs/announce.php SCRIPT_NAME: /announce.php SERVER_ADDR: *.*.*.* SERVER_ADMIN: *@*.* SERVER_NAME: […]

为什么Apache可能会忽略一个ServerName与请求的URL匹配的虚拟主机?

我想添加第二个虚拟主机到我的apacheconfiguration,但似乎无法得到新的虚拟主机使用。 我的httpd.conf只包含以下行: ServerName radiofreebrighton.org.uk 我也有一个ports.conf文件,其中包含以下内容: NameVirtualHost *:80 Listen 80 <IfModule mod_ssl.c> Listen 443 </IfModule> 我在sites-available有两个文件,它们是通过a2ensite sites-enabled的a2ensite链接的sites-enabled : radiofreebrighton.org.uk trafalgararches.co.uk 第一个内容是: <VirtualHost _default_:80> DocumentRoot /home/tom/www ServerAdmin [email protected] ServerName radiofreebrighton.org.uk ServerAlias www.radiofreebrighton.org.uk <Directory /home/tom/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/error.log LogLevel error CustomLog /var/log/apache2/access.log combined Alias /wiki /home/tom/www/mediawiki/index.php </VirtualHost> […]

nginx支持.htaccess /重写规则? 与Apache的区别?

我一直在使用Apache HTTP服务器已经有相当长的一段时间了,最​​终转向静态内容服务器以及其他dynamic内容机器。 我想知道,nginx是否支持“.htaccess”文件,以及像mod_rewrite? 由于我习惯的语法,我想知道(语法)差异是什么,学习曲线是从Apacheconfiguration到nginx。

Apache服务器在超时后返回404

大约40-60秒后,向服务器发出多个请求会导致404错误。 我正在使用JavaScript来请求: example.com/test/location 。 Apache已启用mod_rewrite,将其映射到文件index.php 。 index.php在返回200之前等待10秒index.php在返回时立即请求。 看Apache的access.log我可以看到: index.php 200 index.php 200 index.php 200 index.php 200 index.php 404 这对我来说没有意义,因为index.php文件没有移动。 任何想法是怎么回事? 不幸的是,这是与CPanel托pipe,所以debugging是有限的。

APACHEconfiguration文件中的PHP setlocale等价物

我需要在法语区域显示date。 一个解决scheme是使用setlocale(LC_TIME, 'fr_FR'); 但我正在寻找直接在我的Apache服务器的configuration设置区域设置。 在/etc/httpd/conf/httpd.conf文件中,我试过了 <VirtualHost *:80> … SetEnv LC_TIME 'fr_FR' </VirtualHost> 没有任何影响。 我应该在哪个php或apacheconfiguration文件中定义LC_TIMEvariables?

使用mod_proxy_http和mod_rewrite的时候保护Apache

我们有一个Apache服务器,作为运行在不同端口上的应用程序的代理。 例如: domain.com/app1/service1 > localhost:101 domain.com/app1/service2 > localhost:102 domain.com/app2/service1 > localhost:201 确定应用程序端口的规则相当复杂,所以我使用一个脚本来使用mod_rewrite来做到这一点: RewriteEngine On RewriteMap mapper prg:/foler/rewriteUrl.sh RewriteRule ^(.*)$ ${mapper:%{REQUEST_URI}} [P] 我遇到的问题是查看日志,从其他网站获取内容的机器人有很多请求。 我testing了是否可以从其他服务器代理内容,我可以: telnet domain.com 80 GET http://www.yahoo.com/ HTTP/1.1 Host: www.yahoo.com 在这里,我从雅虎获得内容,这意味着任何人都可以连接到我的服务器,并开始向其他服务器发送请求。 我已经看到,Apachebuild议如下所述保护您的代理: http://httpd.apache.org/docs/trunk/mod/mod_proxy.html#access 但问题是,我不知道什么IP将使用我的服务器在高级,所以我的问题是如何解决这个问题,同时任何人都可以向我的应用程序请求? 一些额外的信息: 我所有的应用程序都与我的Apache服务器在同一台机器上 如果我需要移动我的应用程序到不同的服务器,他们将仍然在我的Intrantet 我有mod_proxy,mod_proxy_http和mod_rewrite启用 谢谢

stream浪的Apache不能从主机访问

我正在运行一个从stream浪的虚拟框,我想访问由访客的Apache服务器提供的网页。 当我在客户端执行wget http://dev.test.com/index.html一切工作正常,但是当我执行主机上的wget http://dev.test.com:8080/index.html我得到一个错误后而: –2013-08-09 12:04:25– http://dev.test.com:8080/index.html Resolving dev.test.com (dev.test.com)… 127.0.0.1 Connecting to dev.test.com (dev.test.com)|127.0.0.1|:8080… connected. HTTP request sent, awaiting response… Read error (Connection reset by peer) in headers. Retrying. 我已经启用端口转发从客人80到主机127.0.0.1 dev.test.com添加到客人和主机的/ etc / hosts文件和service iptables stop禁用客人防火墙,但我仍然得到相同的错误。 有人可以告诉我如何正确configuration? stream浪设置: 我的主机:Ubuntu 13.04 32bit,Vagrant 1.0.3,虚拟机箱4.2.10 我已经设置了这样的阴道框: vagrant box add centos64_64 http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box vagrant init centos64_64 mkdir manifests mkdir […]

带SSL证书和SSLUserName的apache身份validation

我只是尝试通过https进行SVN服务器的SSLauthentication。 我希望客户证书允许授权人员检查他们的存储库。 <VirtualHost 37.187.96.147:443> ServerName toto.com:443 DocumentRoot /var/www/html/ SSLEngine on SSLProtocol all SSLCipherSuite HIGH:MEDIUM SSLStrictSNIVHostCheck on SSLCertificateFile /etc/ssl/certificate-authority/certs/svn-webserver.crt SSLCertificateKeyFile /etc/ssl/certificate-authority/private/svn-webserver.key ErrorLog /var/log/httpd/svn-error_log CustomLog logs/svn-access "%t %u %{SVN-ACTION}e" env=SVN-ACTION SSLCACertificateFile /etc/ssl/certificate-authority/certs/ca.crt SSLVerifyDepth 5 SSLVerifyClient require SSLVerifyDepth 1 LogLevel debug <Location /svn/> DAV svn SSLOptions +FakeBasicAuth +StrictRequire SSLRequireSSL AuthName "Depot SVN namek" AuthType Basic AuthBasicProvider file AuthUserFile […]

GNUTLSClientVerify不会阻止无法识别的CA.

我在Ubuntu上安装了Apache,安装了GNUTLS模块,一切正常。 root@ilnwad15:~# apache2 -v Server version: Apache/2.2.22 (Ubuntu) Server built: Jul 12 2013 13:37:15 现在,我想要在端口1443上,如果客户端证书的CA不是我的服务器上的CA,那么它将被阻止。 这就是我在/etc/apache2/apache2.confconfiguration它的方式 Listen *:443 Listen *:1443 <VirtualHost *:443> GnuTLSEnable on GnuTLSKeyFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.key GnuTLSCertificateFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.crt DocumentRoot /disk2/var/www/html GnuTLSPriorities EXPORT ServerName ilnwad15 </VirtualHost> <VirtualHost *:1443> GnuTLSEnable on GnuTLSKeyFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.key GnuTLSCertificateFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.crt GnuTLSPriorities EXPORT GnuTLSClientCAFile /etc/apache2/certs/ca.pem GNUTLSClientVerify require DocumentRoot /disk2/var/www/html ServerName ilnwad15 </VirtualHost> 它现在所做的是在发送没有证书的请求时,得到内部错误。 […]