I learned about Apache2 mod_status today. This can be used to monitor the status of your Apache server!
Read an article ab – Apache HTTP server benchmarking tool for apache stress test about the ‘ab’ command which can be used to stress test a website.
I used it and figured out that my webserver could handle about 100 requests per second.
The command I used was:
# ab -c 100 -t 10 -r http://www.example.org/test.php
I was changing a HTML file index.html to be a PHP file called index.php and I renamed my index.html file index.html.bak. The plan was that Apache would find index.php rather than index.html and serve that as the default page. But when I went to load my page Firefox was asking me if I wanted to save the file with MIME type application/x-trash — not what I was expecting! It turns out the problem was related to the index.html.bak file, apparently Apache had decided that was the default page and then when it tried to get the MIME type for .bak it came up with application/x-trash. So the solution was to move the index.html.bak file to something with a filename that didn’t begin with ‘index.html’ (I used ‘original-index.html’) and then once that file had been renamed the index.php page was served properly.
I had a problem with the REQUEST_URI server variable not being available in my PHP app when running under IIS on Windows. I followed these instructions to fix the problem: 100% Apache-Compliant REQUEST_URI for IIS and Windows.
auto_prepend_file = C:\Program Files\PHP\request_uri.inc
I have some old web content that works using Server Side Includes and I needed to get it functional on a new web server. I found this article How do I enable server-side includes (SSIs) on my site? which had everything I needed to know.
First I needed to add the content type and output filter to the Apache configuration:
AddType text/html .shtml AddOutputFilter INCLUDES .shtml
Then I needed to add the IncludesNoExec option:
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Then I needed to specify the DirectoryIndex:
DirectoryIndex index.shtml index.html
And that was it!
Learned about Apache module mod_macro today.
I was trying to configure Digest authentication in Apache and I was getting Internal Server Error 500 when trying to access my site. The Apache error log reported: “configuration error: couldn’t check user. No user file?”
Turned out the problem was that I hadn’t installed the Digest auth module. So the fix was:
# a2enmod auth_digest # apache2ctl graceful
Reading about Digest authentication in Apache for Subversion.