Articles of apache 2.2

AWS route53 www。 前缀不解决权利

我刚刚从GoDaddy移动我的网站到AWS。 在一个AWS实例上,我实际上有两个域。 大多数情况下,工作。 第二个域的“www”前缀不。 我有一个直接指向IP的Alogging如下。 但是,如果我去www.mydomain2.com,它实际上是加载www.mydomain1.com。 # Record Set for Domain 1 mydomain1.com A 1.2.3.4 www.mydomain1.com A 1.2.3.4 # Record Set for Domain 2 mydomain2.com A 1.2.3.5 www.mydomain2.com A 1.2.3.5 我敢肯定,这是一个问题瓦特/logging,但万一不是,这是什么的Apacheconfiguration看起来像: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/var/www/mydomain1" ServerName mydomain1.com ErrorLog "logs/mydomain1.com-error_log" CustomLog "logs/mydomain1.com-access_log" common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@mydomain2 DocumentRoot "/var/www/mydomain2" ServerName mydomain2.com ErrorLog "logs/mydomain2.com-error_log" […]

configurationApache以使URL由http://开始

在Apacheconfiguration或虚拟主机configuration中是否有一个特殊的参数来获取由http://开头的url? 没有我的网站的具体configuration,当我inputurlhttp://www.this-example.com我redirect到www.this-example.com,有一个答案? 或者,这是不是由于Apache的问题,但对DNS(如绑定)?

Apache2客户端的IP和端口

有谁知道Apache是​​否默认logging客户端的端口号,并find它。 我知道它logging的IP,但移动用户可以有几个设备具有相同的IP使用不同的端口。

在debian上安装apache2的Textpattern CMS

我在apache2服务器上configuration了Vhost: <VirtualHost *:80> ServerAdmin [email protected] ServerName www.asr.lan DocumentRoot /home/web/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/web/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, […]

Ubuntu上的SSL 12 LTS与Apache和PHP-FPM

在阅读了很多教程之后,我成功地在Ubuntu 12 LTS上成功运行了Apache MPM-Worker和PHP-FPM。 我为每个用户都有独立的池,一切都像一个魅力。 不过,我需要为其中一个域安装SSL。 我设法创build自签名证书只是为了获得安全的连接和运行。 我的问题是,我目前的设置,我将无法运行SSL的另一个域名,因为当重新加载Apache设置我得到一个错误(警告): [Sun Mar 15 16:52:59 2015] [warn]第21行的/etc/apache2/sites-enabled/www.my-site-name.com中的Alias指令可能永远不会匹配,因为它与早期的Alias重叠。 我的设置如下: /etc/apache2/conf.d/php5-fpm.conf <IfModule mod_fastcgi.c> AddHandler php5-fcgi .php Action php5-fcgi /php5-fcgi </IfModule> /etc/php5/fpm/pool.d/example.conf [example] user = example group = example listen = /tmp/php5-fpm-example.sock listen.owner = example listen.group = example listen.mode = 0660 /etc/apache2/sites-enabled/www.my-site-name.com <VirtualHost *:80> content goes here </VirtualHost> <IfModule mod_ssl.c> <VirtualHost […]

testing文件是否存在于DOCUMENT_ROOT之外

我在DOCUMENT_ROOT里面有这个.htaccess文件,它检查一个文件的存在,maintenance.enable,如果存在的话服务于maintenance.html: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # This portion checks for the presence of maintenance.enable to toggle # maintenance mode RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /maintenance.html [R=503,L] ErrorDocument 503 /maintenance.html Header Set Cache-Control "max-age=0, no-store" RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> 但是,它似乎不在DOCUMENT_ROOT之外工作。 例如,考虑我有这样的文件夹结构: […]

iptables阻止7层DDoS攻击

最近我在我的网站上遇到了很多第7层的ddos攻击。 特别是在索引页上的HTTP GET请求泛滥。 (约20k r / s),我的服务器是在OVH,所以它没有超载pipe道,但有没有办法使用iptables我可以检测IPs谁提出过多的请求,并放弃他们的连接,以避免过载我的networking服务器? 还是有更好的解决scheme来过滤这些数据包,同时不会对合法客户端产生负面影响。 我在Ubuntu 12.04上使用apache。

为什么Apache的setEnvIf没有设置正确的头文件,以及如何进行debugging

我有我的.htaccess文件中的以下内容: <IfModule mod_headers.c> SetEnvIf Origin "http(s)?:\/\/(www\.)?(inreado\.local|testenv\.inreado\.com|inreado\.com)$" AccessControlAllowOrigin=$0$1 Header set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin Header set Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS" Header set Access-Control-Allow-Credentials true </IfModule> 我试图设置Access-Control-Allow-Origin头,如果主机是在正则expression式中指定的三个允许的域之一。 但它从来没有设置这个标题。 这是请求和回应: 请求 GET http://inreado.local:8080/ HTTP/1.1 Host: inreado.local:8080 Connection: keep-alive Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36 Accept-Encoding: gzip, deflate, […]

为什么Apache返回200状态码时返回错误信息

我已经将Apacheconfiguration为在所有使用OPTIONS动词的请求上返回200 RewriteCond %{REQUEST_METHOD} OPTIONS RewriteRule ^(.*)$ $1 [R=200,L] Apache确实返回状态200 OK ,但正文包含错误消息: HTTP/1.1 200 OK Date: Sun, 22 Mar 2015 16:38:10 GMT Server: Apache/2.4.10 (Win64) PHP/5.6.3 Content-Length: 492 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>200 OK</title> </head><body> <h1>OK</h1> <p>The server encountered an internal error or misconfiguration and […]

指定文件级FTP权限

我有一个用户可以访问一个FTP文件夹: /home/user1/public_html/ 是否有可能拒绝访问此文件夹中的特定文件,同时仍然允许apache运行它们? 例如,/ /home/user1/public_html/test.php / apache / /home/user1/public_html/test.php ,我不希望用户读取/查看此文件,但我希望apache能够正常运行它。