A while back, I wrote about dealing with the Apache / FastCGI error ‘Primary script unknown’ when trying to access non-existent PHP files. Bots often do this trying to test for vulnerabilities, and it can fill up error logs and be annoying to look through. In that post, I fixed the problem through mod_rewrite and a RewriteCond
. For PHP 2.4+, there is a more broad and likely more efficient solution using the <If>
directive. It will work for all virtual hosts on a server.
log posts
Letsencrypt log failure string
After being unsure for a while of what to look for in the Certbot / Letsencrypt log that is pertinent, as in useful to look for under normal circumstances, I finally had a renewal fail and figured it out. The string “(failure)” will appear if a renewal fails, and will be on the same line as the name of the cert.
Continue reading post "Letsencrypt log failure string"Looking at Apache logs with command line tools
In my web development career, I have countless times needed to look at Apache logs to figure out or find out about problems with sites, monitor activity, or for various other purposes. I’ve used command line tools to help with this, often looking for strings and counting occurrences. Since I recently needed to create a command string to count unique IP’s connected to a given string in the logs, I thought I’d post about it and a few related useful commands.
Continue reading post "Looking at Apache logs with command line tools"FastCGI and “Primary Script Unknown”
If you’re routing requests for script file names through FastCGI, and don’t have some rule to catch requests for unknown scripts, you might find errors like:
Got error 'Primary script unknown\n'
in your error log.
Continue reading post "FastCGI and “Primary Script Unknown”"