Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am doing some load testing on apache and i gets tons of internal dummy connections

::1 219 - [22/Dec/2011:11:02:57 +0000] "OPTIONS * HTTP/1.0" 200 181 "-" "Apache (internal dummy connection)"
::1 221 - [22/Dec/2011:11:02:58 +0000] "OPTIONS * HTTP/1.0" 200 181 "-" "Apache (internal dummy connection)"
::1 188 - [22/Dec/2011:11:02:59 +0000] "OPTIONS * HTTP/1.0" 200 181 "-" "Apache (internal dummy connection)"
::1 243 - [22/Dec/2011:11:03:03 +0000] "OPTIONS * HTTP/1.0" 200 181 "-" "Apache (internal dummy connection)"
::1 215 - [22/Dec/2011:11:03:04 +0000] "OPTIONS * HTTP/1.0" 200 181 "-" "Apache (internal dummy connection)"
::1 178 - [22/Dec/2011:11:03:05 +0000] "OPTIONS * HTTP/1.0" 200 181 "-" "Apache (internal dummy connection)"

This is the virtual host config:

NameVirtualHost *:80
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^.*internal dummy connection.*$ [NC]
RewriteRule ^/$ /blank.html [L]

<VirtualHost *:80>
    ServerAdmin email@email.com
    DocumentRoot /var/www/vhosts/domain/html
    ServerName domain
    ErrorLog /var/www/vhosts/domain/error_log
    SetEnvIf REMOTE_ADDR "(.+)" CLIENTIP=$1
    SetEnvIf X-Forwarded-For "^([0-9.]+)" CLIENTIP=$1
    LogFormat "%{CLIENTIP}e %D %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" trueip_combined
    CustomLog "/var/www/vhosts/domain/access_log" trueip_combined
<Directory /var/www/vhosts/domain/html>
Options -Indexes FollowSymLinks Includes ExecCGI
                AllowOverride All
                Order allow,deny
               Allow from all
</Directory>
</VirtualHost>

To solve this i am readirecting all internal dummy connections to blank.html using the rewrite rule, but it give me a error in syntax?

[root@ip-10-56-1-98 ~]# /etc/init.d/httpd configtest
Syntax error on line 3 of /etc/httpd/conf.d/vhosts.conf:
RewriteCond: bad flag delimiters

Any ideas?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

You need to escape the spaces like:

RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
share|improve this answer
    
the syntax worked, but i still get the same errors on access log –  krisdigitx Dec 22 '11 at 11:51
    
What do you mean by "worked but get the same errors on access log"? –  Khaled Dec 22 '11 at 11:59
    
means it still logs the error "interal dummy error" and does not redirect to blank.html –  krisdigitx Dec 22 '11 at 13:08
    
You may consider simplifying that condition. I see no reason why you need to test for the full UA string here, and it's complicating things. Consider: RewriteCond %{HTTP_USER_AGENT} ^Apache [NC] instead. –  mcauth Dec 22 '11 at 14:11
    
i have now put the rules in the virtualhost config and that works.. thanks for the help –  krisdigitx Dec 23 '11 at 9:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.