I am pleased to say that most of the non-blog parts of my site are now served from static files. I have been working toward making a static version of my site for a while. I have created a PHP static web task that can crawl a site and turn the responses into an Apache friendly directory structure. Those pages now can be served extra fast, without going through PHP, and could be served on a free static host if I wanted. To go static, I not only had to write the code to build the static files, but also had to modify my site code to have the desired output when called from that context and modify my Apache configuration to respond correctly and add some headers that were being added by PHP before.
Continue reading post "Site partially static"apache posts
Apache PHP FPM and “Primary Script Unknown”
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.
The xmlrpc.php
file of my WordPress blog recently got hit by a single bot some 5000 times over a half hour period recently. I temporarily disabled all visitors and then limited it to just blocking the specific IP via Apache conf (htaccess).
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"Somehow, my recent upgrade to Ubuntu 20.04 switched the Apache MPM module installed and thus disabled HTTP2 for PHP requests on my server.
Continue reading post "#2889"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”"Up way later than I wanted to be, fighting with Symfony’s framework bundle trapping PHP errors from getting to my Apache logs, and Apache’s ErrorLogFormat
not being able to display REQUEST_URI
. Gonna have to come back to these later.
2784, the first HTTP port
Looking at a page discussing the code of the first web browser (WorldWideWeb), I noticed a line designating port 2784 as OLD_TCP_PORT
. After looking into it a bit more, I determined that this was the port used for the web until port 80 was officially designated in January of 1992.
HTTP 2 on Ubuntu 18.04 with Apache and PHP
I recently got h2 (HTTP 2.0) running on my server.
Continue reading post "HTTP 2 on Ubuntu 18.04 with Apache and PHP"Server upgrade: Ubuntu 18.04
I’ve finally updated my server to Ubuntu 18.04 using do-release-upgrade
.