Limit Apache log on Mac OS X 10.6
Yesterday I found that my Apache log file in my development machine was almost 50 GB in size. Is there a way to limit the site of the Apache log file? Asked by Onema This is typically done using logrotate. Example logrotate configuration for Apache: /var/log/httpd/*log { daily rotate 30 compress missingok notifempty sharedscripts postrotate /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true endscript } Answered by Warner Check more discussion of this question. [...]
Continue Reading »Found special user in apache weblog called @^Y@.@{phqsp~{2′/2|pq{jvk@-1(‘@lvo)&1–1.(/1)’@./*
When checking the logfiles of some of my customers I found this as username for authenticated users. We have a .htusers file used for basic web auth, all other users in the serverlog I found in the .htusers, but not the @^Y@.@{phqsp~{2′/2|pq{jvk@-1(‘@lvo)&1–1.(/1)’@./* user. Server version is 2.2.22 on 64b Opensuse 12 First question: was this user able to receive the content protected by the .htusers file? Next one: anyone having more information about this break-in [...]
Continue Reading »NFS soft mount timeout too slow
We have a VERY busy cluster of servers. Our 16 app servers serve our application off of a local SSD on each machine, but they also process images which are then served off of our cdn. Because of this, we have a couple central image servers that we nfs mount from our app servers. We recently had an issue with the image servers in which we were required to shut them down. No big deal, [...]
Continue Reading »CherryPy 3 with Apache 2 using ModWSGI: stack traces?
I am trying to show stack traces or at least some sort of errors rendered to the HTML response while using a WSGI script. A ModuleNotFound exception is raised when I tried to import a module the script can’t seem to find (which is fine for now), but all that is reported in the HTTP response is a rather vague Internal Server Error status 500 error which looks like Apache’s work. How can I get [...]
Continue Reading »How can I forbid DNS queries from an unwanted domain on my server?
Not sure my question’s title is explicit, so I’ll try and explain it the best I can. I have a dedicated web hosting server running Linux (Gentoo). There are a couple websites hosted on it, and therefore a couple domain names from multiple providers have their DNS zone settings set to point to my server. There is one particular website that used to be hosted on this server, but was then removed. However, it looks [...]
Continue Reading »apache mod rewrite too many redirects
I am trying to redirect all requests for my default language (nl) to /nl….. (without showing the redirect to the user). So example.com should redirect to example.com/nl without visibly altering the url in the browser. Here is what I tried: RewriteEngine On RewriteCond %{REQUEST_URI} !^/en.* RewriteCond %{REQUEST_URI} !^/nl.* RewriteRule ^(.*)$ nl$1 [R,L] The redirect is visible to the user (/nl/index.php) and in addition it results in a ‘too many redirect’. If I try [P,L] I [...]
Continue Reading »How should I configure my ELB health check when using NameVirtualHosts and redirecting to www?
My ELB keeps taking my instances out of service, because the HTTP health check is failing. We have a DNS wildcard, and redirect everything to www: vhost.conf: ServerName www.example.com ServerAlias *.example.com RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC] RewriteRule ^ http://www.example.com/$1 [R=301,L] This works fine for actual browsers, but the HTTP health check to / fails, presumably because it’s getting a 302. Is the best option to use a TCP health check, or is there a [...]
Continue Reading »Mitigate DDoS Proxy attack
In last days my apache is being attacked by many connections from proxies. I’ve identified the source but could not block the attack effectively. The attacker seems to be using pyloris or a variation of this to attack my apache on port 80. I installed nginx and varnish but not enough to support the extra load. I also added a rule in iptables to drop packets that contain the string “X-Forwarded-For” but does not block [...]
Continue Reading »htaccess redirect secure URL, redirect old assets to Amazon S3, only for https
I have the following URL, I would like to redirect all css, images & javascript to my amazon s3 bucket. # I have these URL’s (and more) https://secure.mydomain.co.uk/styles/donate/style.css https://secure.mydomain.co.uk/js/donate/jquery.min.js https://secure.mydomain.co.uk/images/donate/help-icon.png# I would like to redirect all CSS, JS & Image files to: https://s3-eu-west-1.amazonaws.com/mydomain.co.uk/static/$1# So the URLs should be https://s3-eu-west-1.amazonaws.com/mydomain.co.uk/static/styles/donate/style.css https://s3-eu-west-1.amazonaws.com/mydomain.co.uk/static/js/donate/jquery.min.js https://s3-eu-west-1.amazonaws.com/mydomain.co.uk/static/images/donate/help-icon.png# All other .php files, I want served using my normal secure.mydomain.co.uk https://secure.mydomain.co.uk/other/php/files.php I have tried the following, but it don’t work as expected: RewriteCond [...]
Continue Reading »trying to get apache mod_stats ‘/server-status’ to work
mod_status is a apache module that lets you see the status of apache. After its switched on, it can be accessed at server.com/server-status, however I cant access it because of the mod_rewrite in the .htaccess file. below is the .htaccess file. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} othersite.com$ [NC] RewriteRule ^(.*)$ http://server.com/$1 [R=301]RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]</IfModule> when I disable above, http://server.com/server-status works. This is probably a common [...]
Continue Reading »Recent Posts
- Cron expression that runs every 5 minutes from 1:30 am – 6:00 am [duplicate]
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?
- Is there research material on NTP accuracy available?
- How to create a limited “domain admin” that does not have access to domain controllers?



