<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: apache</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/apache.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2022-10-04T00:53:47+00:00</updated><author><name>Simon Willison</name></author><entry><title>mod_wasm: run WebAssembly with Apache</title><link href="https://simonwillison.net/2022/Oct/4/mod_wasm/#atom-tag" rel="alternate"/><published>2022-10-04T00:53:47+00:00</published><updated>2022-10-04T00:53:47+00:00</updated><id>https://simonwillison.net/2022/Oct/4/mod_wasm/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://wasmlabs.dev/articles/apache-mod-wasm/"&gt;mod_wasm: run WebAssembly with Apache&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Brand new Apache module from a team at VMWare: mod_wasm builds on top of wasmtime to let you write WebAssembly programs that are exposed to the world by Apache, using a mechanism that looks similar to old CGI scripts (headers passed in environment variables, request body sent to standard input). Includes a demo Docker image that runs using Python-compiled-to-WebAssembly.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=33068978"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/webassembly"&gt;webassembly&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="webassembly"/></entry><entry><title>Weeknotes: Apache proxies in Docker containers, refactoring Datasette</title><link href="https://simonwillison.net/2021/Nov/22/apache-proxies-datasette/#atom-tag" rel="alternate"/><published>2021-11-22T05:43:44+00:00</published><updated>2021-11-22T05:43:44+00:00</updated><id>https://simonwillison.net/2021/Nov/22/apache-proxies-datasette/#atom-tag</id><summary type="html">
    &lt;p&gt;Updates to six major projects this week, plus finally some concrete progress towards Datasette 1.0.&lt;/p&gt;
&lt;h4&gt;Fixing Datasette's proxy bugs&lt;/h4&gt;
&lt;p&gt;Now that Datasette has had its fourth birthday I've decided to really push towards hitting &lt;a href="https://github.com/simonw/datasette/milestone/7"&gt;the 1.0 milestone&lt;/a&gt;. The key property of that release will be a stable JSON API, stable plugin hooks and a stable, documented context for custom templates. There's quite a lot of mostly unexciting work needed to get there.&lt;/p&gt;
&lt;p&gt;As I work through the issues in that milestone I'm encountering some that I filed more than two years ago!&lt;/p&gt;
&lt;p&gt;Two of those made it into the &lt;a href="https://docs.datasette.io/en/stable/changelog.html#v0-59-3"&gt;Datasette 0.59.3&lt;/a&gt; bug fix release earlier this week.&lt;/p&gt;
&lt;p&gt;The majority of the work in that release though related to Datasette's &lt;a href="https://docs.datasette.io/en/stable/settings.html#base-url"&gt;base_url feature&lt;/a&gt;, designed to help people who run Datasette behind a proxy.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;base_url&lt;/code&gt; lets you run Datasette like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;datasette --setting base_url=/prefix/ fixtures.db
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When you do this, Datasette will change its URLs to start with that prefix - so the hompage will live at &lt;code&gt;/prefix/&lt;/code&gt;, the database index page at &lt;code&gt;/prefix/fixtures/&lt;/code&gt;, tables at &lt;code&gt;/prefix/fixtures/facetable&lt;/code&gt; etc.&lt;/p&gt;
&lt;p&gt;The reason you would want this is if you are running a larger website, and you intend to proxy traffic to &lt;code&gt;/prefix/&lt;/code&gt; to a separate Datasette instance.&lt;/p&gt;
&lt;p&gt;The Datasette documentation includes &lt;a href="https://docs.datasette.io/en/stable/deploying.html#running-datasette-behind-a-proxy"&gt;suggested nginx and Apache configurations&lt;/a&gt; for doing exactly that.&lt;/p&gt;
&lt;p&gt;This feature has been &lt;a href="https://github.com/simonw/datasette/issues?q=is%3Aissue+base_url"&gt;a magnet for bugs&lt;/a&gt; over the years! People keep finding new parts of the Datasette interface that fail to link to the correct pages when run in this mode.&lt;/p&gt;
&lt;p&gt;The principle cause of these bugs is that I don't use Datasette in this way myself, so I wasn't testing it nearly as thoroughly as it needed.&lt;/p&gt;
&lt;p&gt;So the first step in finally solving these issues once and for all was to get my own instance of Datasette up and running behind an Apache proxy.&lt;/p&gt;
&lt;p&gt;Since I like to deploy live demos to Cloud Run, I decided to try and run Apache and Datasette in the same container. This took a &lt;em&gt;lot&lt;/em&gt; of figuring out. You can follow my progress on this in these two issue threads:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/simonw/datasette/issues/1521"&gt;#1521: Docker configuration for exercising Datasette behind Apache mod_proxy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/simonw/datasette/issues/1522"&gt;#1522: Deploy a live instance of demos/apache-proxy&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The short version: I got it working! My Docker implementation now lives in the &lt;a href="https://github.com/simonw/datasette/tree/0.59.3/demos/apache-proxy"&gt;demos/apache-proxy&lt;/a&gt; directory and the live demo itself is deployed to &lt;a href="https://datasette-apache-proxy-demo.fly.dev/prefix/"&gt;datasette-apache-proxy-demo.fly.dev/prefix/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;(I ended up deploying it to &lt;a href="https://fly.io/"&gt;Fly&lt;/a&gt; after running into a bug when deployed to Cloud Run that I couldn't replicate on my own laptop.)&lt;/p&gt;
&lt;p&gt;My final implementation uses a Debian base container with Supervisord to manage the two processes.&lt;/p&gt;
&lt;p&gt;With a working live environment, I was finally able to track down the root cause of the bugs. My notes on
&lt;a href="https://github.com/simonw/datasette/issues/1519"&gt;#1519: base_url is omitted in JSON and CSV views&lt;/a&gt; document how I found and solved them, and updated the associated test to hopefully avoid them ever coming back in the future.&lt;/p&gt;
&lt;h4&gt;The big Datasette table refactor&lt;/h4&gt;
&lt;p&gt;The single most complicated part of the Datasette codebase is the code behind the table view - the page that lets you browse, facet, search, filter and paginate through the contents of a table (&lt;a href="https://covid-19.datasettes.com/covid/ny_times_us_counties"&gt;this page here&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;It's got very thorough tests, but the actual implementation is mostly &lt;a href="https://github.com/simonw/datasette/blob/main/datasette/views/table.py#L303-L992"&gt;a 600 line class method&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It was already difficult to work with, but the changes I want to make for Datasette 1.0 have proven too much for it. I need to refactor.&lt;/p&gt;
&lt;p&gt;Apart from making that view easier to change and maintain, a major goal I have is for it to support a much more flexible JSON syntax. I want the JSON version to default to just returning minimal information about the table, then allow &lt;code&gt;?_extra=x&lt;/code&gt; parameters to opt into additional information - like facets, suggested facets, full counts, SQL schema information and so on.&lt;/p&gt;
&lt;p&gt;This means I want to break up that 600 line method into a bunch of separate methods, each of which can be opted-in-to by the calling code.&lt;/p&gt;
&lt;p&gt;The HTML interface should then build on top of the JSON, requesting the extras that it knows it will need and passing the resulting data through to the template. This helps solve the challenge of having a stable template context that I can document in advance of Datasette 1.0&lt;/p&gt;
&lt;p&gt;I've been putting this off for over a year now, because it's a &lt;em&gt;lot&lt;/em&gt; of work. But no longer! This week I finally started to get stuck in.&lt;/p&gt;
&lt;p&gt;I don't know if I'll stick with it, but my initial attempt at this is a little unconventional. Inspired by how &lt;a href="https://docs.pytest.org/en/6.2.x/fixture.html#back-to-fixtures"&gt;pytest fixtures work&lt;/a&gt; I'm experimenting with a form of dependency injection, in a new (very alpha) library I've released called &lt;a href="https://github.com/simonw/asyncinject"&gt;asyncinject&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The key idea behind &lt;code&gt;asyncinject&lt;/code&gt; is to provide a way for class methods to indicate their dependencies as named parameters, in the same way as pytest fixtures do.&lt;/p&gt;
&lt;p&gt;When you call a method, the code can spot which dependencies have not yet been resolved and execute them before executing the method.&lt;/p&gt;
&lt;p&gt;Crucially, since they are all &lt;code&gt;async def&lt;/code&gt; methods they can be &lt;em&gt;executed in parallel&lt;/em&gt;. I'm cautiously excited about this - Datasette has a bunch of opportunities for parallel queries - fetching a single page of table rows, calculating a &lt;code&gt;count(*)&lt;/code&gt; for the entire table, executing requested facets and calculating suggested facets are all queries that could potentially run in parallel rather than in serial.&lt;/p&gt;
&lt;p&gt;What about the GIL, you might ask? Datasette's database queries are handled by the &lt;code&gt;sqlite3&lt;/code&gt; module, and that module releases the GIL once it gets into SQLite C code. So theoretically I should be able to use more than one core for this all.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/simonw/asyncinject/blob/0.2a0/README.md"&gt;asyncinject README&lt;/a&gt; has more details, including code examples. This may turn out to be a terrible idea! But it's really fun to explore, and I'll be able to tell for sure if this is a useful, maintainable and performant approach once I have Datasette's table view running on top of it.&lt;/p&gt;
&lt;h4&gt;git-history and sqlite-utils&lt;/h4&gt;
&lt;p&gt;I made some big improvements to my &lt;a href="https://github.com/simonw/git-history"&gt;git-history&lt;/a&gt; tool, which automates the process of turning a JSON (or other) file that has been version-tracked in a GitHub repository (see &lt;a href="https://simonwillison.net/2020/Oct/9/git-scraping/"&gt;Git scraping&lt;/a&gt;) into a SQLite database that can be used to explore changes to it over time.&lt;/p&gt;
&lt;p&gt;The biggest was a major change to the database schema. Previously, the tool used full Git SHA hashes as foreign keys in the largest table.&lt;/p&gt;
&lt;p&gt;The problem here is that a SHA hash string is 40 characters long, and if they are being used as a foreign key that's a LOT of extra weight added to the largest table.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sqlite-utils&lt;/code&gt; has a &lt;a href="https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-lookup-tables"&gt;table.lookup() method&lt;/a&gt; which is designed to make creating "lookup" tables - where a string is stored in a unique column but an integer ID can be used for things like foreign keys - as easy as possible.&lt;/p&gt;
&lt;p&gt;That method was previously quite limited, but in &lt;a href="https://sqlite-utils.datasette.io/en/stable/changelog.html#v3-18"&gt;sqlite-utils 3.18&lt;/a&gt; and &lt;a href="https://sqlite-utils.datasette.io/en/stable/changelog.html#v3-19"&gt;3.19&lt;/a&gt; - both released this week - I expanded it to cover the more advanced needs of my &lt;code&gt;git-history&lt;/code&gt; tool.&lt;/p&gt;
&lt;p&gt;The great thing about building stuff on top of your own libraries is that you can discover new features that you need along the way - and then ship them promptly without them blocking your progress!&lt;/p&gt;
&lt;h4&gt;Some other highlights&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/s3-credentials/releases/tag/0.6"&gt;s3-credentials 0.6&lt;/a&gt; adds a &lt;code&gt;--dry-run&lt;/code&gt; option that you can use to show what the tool would do without making any actual changes to your AWS account. I found myself wanting this while continuing to work on the ability to &lt;a href="https://github.com/simonw/s3-credentials/issues/12"&gt;specify a folder prefix&lt;/a&gt; within S3 that the bucket credentials should be limited to.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/datasette-publish-vercel/releases/tag/0.12"&gt;datasette-publish-vercel 0.12&lt;/a&gt; applies some pull requests from Romain Clement that I had left unreviewed for far too long, and adds the ability to customize the &lt;code&gt;vercel.json&lt;/code&gt; file used for the deployment - useful for things like setting up additional custom redirects.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/datasette-graphql/releases/tag/2.0"&gt;datasette-graphql 2.0&lt;/a&gt; updates that plugin to &lt;a href="https://github.com/graphql-python/graphene/wiki/v3-release-notes"&gt;Graphene 3.0&lt;/a&gt;, a major update to that library. I had to break backwards compatiblity in very minor ways, hence the 2.0 version number.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/csvs-to-sqlite/releases/tag/1.3"&gt;csvs-to-sqlite 1.3&lt;/a&gt; is the first relase of that tool in just over a year. William Rowell contributed a new feature that allows you to populate "fixed" database columns on your imported records, see &lt;a href="https://github.com/simonw/csvs-to-sqlite/pull/81"&gt;PR #81&lt;/a&gt; for details.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;TIL this week&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/python/graphlib-topologicalsorter"&gt;Planning parallel downloads with TopologicalSorter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/python/cog-to-update-help-in-readme"&gt;Using cog to update --help in a Markdown README file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/cloudrun/using-build-args-with-cloud-run"&gt;Using build-arg variables with Cloud Run deployments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/fly/custom-subdomain-fly"&gt;Assigning a custom subdomain to a Fly app&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Releases this week&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/datasette-publish-vercel"&gt;datasette-publish-vercel&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/datasette-publish-vercel/releases/tag/0.12"&gt;0.12&lt;/a&gt; - (&lt;a href="https://github.com/simonw/datasette-publish-vercel/releases"&gt;18 releases total&lt;/a&gt;) - 2021-11-22
&lt;br /&gt;Datasette plugin for publishing data using Vercel&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/git-history"&gt;git-history&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/git-history/releases/tag/0.4"&gt;0.4&lt;/a&gt; - (&lt;a href="https://github.com/simonw/git-history/releases"&gt;6 releases total&lt;/a&gt;) - 2021-11-21
&lt;br /&gt;Tools for analyzing Git history using SQLite&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/sqlite-utils"&gt;sqlite-utils&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/sqlite-utils/releases/tag/3.19"&gt;3.19&lt;/a&gt; - (&lt;a href="https://github.com/simonw/sqlite-utils/releases"&gt;90 releases total&lt;/a&gt;) - 2021-11-21
&lt;br /&gt;Python CLI utility and library for manipulating SQLite databases&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/datasette"&gt;datasette&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/datasette/releases/tag/0.59.3"&gt;0.59.3&lt;/a&gt; - (&lt;a href="https://github.com/simonw/datasette/releases"&gt;101 releases total&lt;/a&gt;) - 2021-11-20
&lt;br /&gt;An open source multi-tool for exploring and publishing data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/datasette-redirect-to-https"&gt;datasette-redirect-to-https&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/datasette-redirect-to-https/releases/tag/0.1"&gt;0.1&lt;/a&gt; - 2021-11-20
&lt;br /&gt;Datasette plugin that redirects all non-https requests to https&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/s3-credentials"&gt;s3-credentials&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/s3-credentials/releases/tag/0.6"&gt;0.6&lt;/a&gt; - (&lt;a href="https://github.com/simonw/s3-credentials/releases"&gt;6 releases total&lt;/a&gt;) - 2021-11-18
&lt;br /&gt;A tool for creating credentials for accessing S3 buckets&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/csvs-to-sqlite"&gt;csvs-to-sqlite&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/csvs-to-sqlite/releases/tag/1.3"&gt;1.3&lt;/a&gt; - (&lt;a href="https://github.com/simonw/csvs-to-sqlite/releases"&gt;13 releases total&lt;/a&gt;) - 2021-11-18
&lt;br /&gt;Convert CSV files into a SQLite database&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/datasette-graphql"&gt;datasette-graphql&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/datasette-graphql/releases/tag/2.0"&gt;2.0&lt;/a&gt; - (&lt;a href="https://github.com/simonw/datasette-graphql/releases"&gt;32 releases total&lt;/a&gt;) - 2021-11-17
&lt;br /&gt;Datasette plugin providing an automatic GraphQL API for your SQLite databases&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/asyncinject"&gt;asyncinject&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/asyncinject/releases/tag/0.2a0"&gt;0.2a0&lt;/a&gt; - (&lt;a href="https://github.com/simonw/asyncinject/releases"&gt;2 releases total&lt;/a&gt;) - 2021-11-17
&lt;br /&gt;Run async workflows using pytest-fixtures-style dependency injection&lt;/li&gt;
&lt;/ul&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/proxies"&gt;proxies&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/refactoring"&gt;refactoring&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/supervisord"&gt;supervisord&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/docker"&gt;docker&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/datasette"&gt;datasette&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/weeknotes"&gt;weeknotes&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/git-scraping"&gt;git-scraping&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sqlite-utils"&gt;sqlite-utils&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="apache"/><category term="proxies"/><category term="refactoring"/><category term="supervisord"/><category term="docker"/><category term="datasette"/><category term="weeknotes"/><category term="git-scraping"/><category term="sqlite-utils"/></entry><entry><title>How can I determine which web server a particular website is using (Apache, IIS, Nginx, etc)?</title><link href="https://simonwillison.net/2011/Jan/5/how-can-i-determine/#atom-tag" rel="alternate"/><published>2011-01-05T13:37:00+00:00</published><updated>2011-01-05T13:37:00+00:00</updated><id>https://simonwillison.net/2011/Jan/5/how-can-i-determine/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;em&gt;My answer to &lt;a href="https://www.quora.com/How-can-I-determine-which-web-server-a-particular-website-is-using-Apache-IIS-Nginx-etc/answer/Simon-Willison"&gt;How can I determine which web server a particular website is using (Apache, IIS, Nginx, etc)?&lt;/a&gt; on Quora&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you're on Linux or OS X, use curl with the -I option (to make a HEAD request and see the HTTP headers):&lt;/p&gt;

&lt;p&gt;$ curl -I &lt;span&gt;&lt;a href="http://www.op3intl.com"&gt;www.op3intl.com&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;HTTP/1.1 200 OK&lt;br /&gt;Date: Thu, 06 Jan 2011 03:31:28 GMT&lt;br /&gt;Server: Microsoft-IIS/6.0&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/iis"&gt;iis&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/nginx"&gt;nginx&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/servers"&gt;servers&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/web-development"&gt;web-development&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/webservers"&gt;webservers&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/quora"&gt;quora&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="apache"/><category term="iis"/><category term="nginx"/><category term="servers"/><category term="web-development"/><category term="webservers"/><category term="quora"/></entry><entry><title>What are the advantages of running Apache behind nginx as opposed to just Apache by itself?</title><link href="https://simonwillison.net/2010/Oct/12/what-are-the-advantages/#atom-tag" rel="alternate"/><published>2010-10-12T14:09:00+00:00</published><updated>2010-10-12T14:09:00+00:00</updated><id>https://simonwillison.net/2010/Oct/12/what-are-the-advantages/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;em&gt;My answer to &lt;a href="https://www.quora.com/What-are-the-advantages-of-running-Apache-behind-nginx-as-opposed-to-just-Apache-by-itself/answer/Simon-Willison"&gt;What are the advantages of running Apache behind nginx as opposed to just Apache by itself?&lt;/a&gt; on Quora&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I do this for all of my Django stuff - I have Django running on modwsgi on a stripped down Apache (almost no configuration except for the modwsgi stuff), then I put an nginx on port 80 which serves the static files directly and proxies dynamic requests back to Apache.&lt;/p&gt;

&lt;p&gt;There are a few advantages to this. Firstly, I use non-threaded Apache so each Apache worker process tends to be pretty big (having a full Python interpreter + Django application running in it). It's a horrible waste of resources for one of those fat processes to sit around serving up a static file instead of serving a dynamic request. Secondly, nginx deals with slow connections for me - if someone on a modem (or 3G phone) hits my site I don't tie up an Apache process for several seconds to respond to their request. Instead, nginx sucks the response in from Apache in a few ms and then spools it out to the slow client at whatever rate they can handle. Since nginx is evented it can handle hundreds or even thousands of slow clients at once using very little memory.&lt;/p&gt;

&lt;p&gt;Finally, if I'm running an nginx proxy at the "front" of my stack it's trivial for me to start load balancing to more than one Apache servers if I need to.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/nginx"&gt;nginx&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/webservers"&gt;webservers&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/quora"&gt;quora&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="apache"/><category term="nginx"/><category term="webservers"/><category term="quora"/></entry><entry><title>Who are major competitors to Solr?</title><link href="https://simonwillison.net/2010/Sep/2/who-are-major-competitors/#atom-tag" rel="alternate"/><published>2010-09-02T18:01:00+00:00</published><updated>2010-09-02T18:01:00+00:00</updated><id>https://simonwillison.net/2010/Sep/2/who-are-major-competitors/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;em&gt;My answer to &lt;a href="https://www.quora.com/Who-are-major-competitors-to-Solr/answer/Simon-Willison"&gt;Who are major competitors to Solr?&lt;/a&gt; on Quora&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;ElasticSearch is a really interesting one - it's the same underlying search library (Lucene) and the same integration model (an HTTP interface) but takes quite a different approach. It hasn't been around for a long time but it looks very impressive: &lt;span&gt;&lt;a href="http://www.elasticsearch.com/"&gt;http://www.elasticsearch.com/&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Other than that, popular open source search engines include Sphinx and Xapian. I'm a big fan of talking to a search engine via HTTP, so I've been keeping an eye on the &lt;span&gt;&lt;a href="http://www.flax.co.uk/"&gt;http://www.flax.co.uk/&lt;/a&gt;&lt;/span&gt; project which does that for Xapian.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/lucene"&gt;lucene&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/search"&gt;search&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/search-engines"&gt;search-engines&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/solr"&gt;solr&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sphinx-search"&gt;sphinx-search&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/xapian"&gt;xapian&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/quora"&gt;quora&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="apache"/><category term="lucene"/><category term="search"/><category term="search-engines"/><category term="solr"/><category term="sphinx-search"/><category term="xapian"/><category term="quora"/></entry><entry><title>apache.org incident report for 04/09/2010</title><link href="https://simonwillison.net/2010/Apr/14/apacheorg/#atom-tag" rel="alternate"/><published>2010-04-14T09:08:58+00:00</published><updated>2010-04-14T09:08:58+00:00</updated><id>https://simonwillison.net/2010/Apr/14/apacheorg/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://blogs.apache.org/infra/entry/apache_org_04_09_2010"&gt;apache.org incident report for 04/09/2010&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
An issue was posted to the Apache JIRA containing an XSS attack (disguised using TinyURL), which stole the user’s session cookie. Several admin users clicked the link, so JIRA admin credentials were compromised. The attackers then changed the JIRA attachment upload path setting to point to an executable directory, and uploaded JSPs that gave them backdoor access to the file system. They modified JIRA to collect entered passwords, then sent password reset e-mails to team members and captured the new passwords that they set through the online form. One of those passwords happened to be the same as the user’s shell account with sudo access, leading to a full root compromise of the machine.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/incident"&gt;incident&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/jira"&gt;jira&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/passwords"&gt;passwords&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/security"&gt;security&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/tinyurl"&gt;tinyurl&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/urls"&gt;urls&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/xss"&gt;xss&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="incident"/><category term="jira"/><category term="passwords"/><category term="security"/><category term="tinyurl"/><category term="urls"/><category term="xss"/></entry><entry><title>jacobian's django-deployment-workshop</title><link href="https://simonwillison.net/2010/Feb/19/jacobians/#atom-tag" rel="alternate"/><published>2010-02-19T14:28:35+00:00</published><updated>2010-02-19T14:28:35+00:00</updated><id>https://simonwillison.net/2010/Feb/19/jacobians/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://github.com/jacobian/django-deployment-workshop"&gt;jacobian&amp;#x27;s django-deployment-workshop&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Notes and resources from Jacob’s 3 hour Django deployment workshop at PyCon, including example configuration files for Apache2 + mod_wsgi, nginx, PostgreSQL and pgpool.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/deployment"&gt;deployment&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/jacob-kaplan-moss"&gt;jacob-kaplan-moss&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modwsgi"&gt;modwsgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/nginx"&gt;nginx&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pgpool"&gt;pgpool&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/postgresql"&gt;postgresql&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pycon"&gt;pycon&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sysadmin"&gt;sysadmin&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="deployment"/><category term="django"/><category term="jacob-kaplan-moss"/><category term="modwsgi"/><category term="nginx"/><category term="pgpool"/><category term="postgresql"/><category term="pycon"/><category term="python"/><category term="sysadmin"/></entry><entry><title>Traffic Server</title><link href="https://simonwillison.net/2009/Nov/1/trafficserver/#atom-tag" rel="alternate"/><published>2009-11-01T12:15:27+00:00</published><updated>2009-11-01T12:15:27+00:00</updated><id>https://simonwillison.net/2009/Nov/1/trafficserver/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.mnot.net/blog/2009/10/30/traffic_server"&gt;Traffic Server&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Mark Nottingham explains the release of Traffic Server, a new Apache Incubator open source project donated by Yahoo! using code originally developed at Inktomi around a decade ago. Traffic Server is a HTTP proxy/cache, similar to Squid and Varnish (though Traffic Server acts as both a forward and reverse proxy, whereas Varnish only handles reverse).


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/cache"&gt;cache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/http"&gt;http&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/inktomi"&gt;inktomi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mark-nottingham"&gt;mark-nottingham&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/proxies"&gt;proxies&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/squid"&gt;squid&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/trafficserver"&gt;trafficserver&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/varnish"&gt;varnish&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/yahoo"&gt;yahoo&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="cache"/><category term="http"/><category term="inktomi"/><category term="mark-nottingham"/><category term="open-source"/><category term="proxies"/><category term="squid"/><category term="trafficserver"/><category term="varnish"/><category term="yahoo"/></entry><entry><title>Justniffer</title><link href="https://simonwillison.net/2009/Sep/25/justniffer/#atom-tag" rel="alternate"/><published>2009-09-25T22:12:51+00:00</published><updated>2009-09-25T22:12:51+00:00</updated><id>https://simonwillison.net/2009/Sep/25/justniffer/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://justniffer.sourceforge.net/"&gt;Justniffer&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Packet sniffing tool that can output sniffed HTTP traffic formatted the same way as an Apache access_log file.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/justniffer"&gt;justniffer&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/logging"&gt;logging&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/networking"&gt;networking&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/packetsniffing"&gt;packetsniffing&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="justniffer"/><category term="logging"/><category term="networking"/><category term="packetsniffing"/></entry><entry><title>apache.org incident report for 8/28/2009</title><link href="https://simonwillison.net/2009/Sep/3/apacheorg/#atom-tag" rel="alternate"/><published>2009-09-03T08:56:12+00:00</published><updated>2009-09-03T08:56:12+00:00</updated><id>https://simonwillison.net/2009/Sep/3/apacheorg/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://blogs.apache.org/infra/entry/apache_org_downtime_report"&gt;apache.org incident report for 8/28/2009&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Various apache.org sites were down for a while last week—here the Apache Infrastructure Team provide a detailed description of what happened (a security breach on a minor server, which provided non-priveleged SSH access to mirror servers via an SSH key used for backups) and how they are responding. Useful for neophyte sysadmins like myself.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/security"&gt;security&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sysadmin"&gt;sysadmin&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="security"/><category term="sysadmin"/></entry><entry><title>"MongoDB is fantastic for logging"</title><link href="https://simonwillison.net/2009/Aug/26/logging/#atom-tag" rel="alternate"/><published>2009-08-26T19:09:26+00:00</published><updated>2009-08-26T19:09:26+00:00</updated><id>https://simonwillison.net/2009/Aug/26/logging/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging"&gt;&amp;quot;MongoDB is fantastic for logging&amp;quot;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Sounds tempting... high performance inserts, JSON structured records and capped collections if you only want to keep the past X entries. If you care about older historic data but still want to preserve space you could run periodic jobs to roll up log entries in to summarised records. It shouldn’t be too hard to write a command-line script that hooks in to Apache’s logging directive and writes records to MongoDB.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/json"&gt;json&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/logging"&gt;logging&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mongodb"&gt;mongodb&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="json"/><category term="logging"/><category term="mongodb"/></entry><entry><title>Fabric, Django, Git, Apache, mod_wsgi, virtualenv and pip deployment</title><link href="https://simonwillison.net/2009/Jul/28/fabric/#atom-tag" rel="alternate"/><published>2009-07-28T11:56:09+00:00</published><updated>2009-07-28T11:56:09+00:00</updated><id>https://simonwillison.net/2009/Jul/28/fabric/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/"&gt;Fabric, Django, Git, Apache, mod_wsgi, virtualenv and pip deployment&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
I’m slowly working my way through this stack at the moment—next stop, fabric.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/deployment"&gt;deployment&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/fabric"&gt;fabric&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gareth-rushgrove"&gt;gareth-rushgrove&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/git"&gt;git&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modwsgi"&gt;modwsgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pip"&gt;pip&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/virtualenv"&gt;virtualenv&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/wsgi"&gt;wsgi&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="deployment"/><category term="django"/><category term="fabric"/><category term="gareth-rushgrove"/><category term="git"/><category term="modwsgi"/><category term="pip"/><category term="python"/><category term="virtualenv"/><category term="wsgi"/></entry><entry><title>moddims</title><link href="https://simonwillison.net/2009/Jul/21/moddims/#atom-tag" rel="alternate"/><published>2009-07-21T18:18:15+00:00</published><updated>2009-07-21T18:18:15+00:00</updated><id>https://simonwillison.net/2009/Jul/21/moddims/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://code.google.com/p/moddims/"&gt;moddims&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Apache 2 module which exposes ImageMagick as a URL-driven service, allowing you to request an image from a whitelisted host server and resize, thumbnail or alter the quality of it.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="http://www.artzstudio.com/2009/06/web-performance-impact-on-revenue-velocity-09-highlights/"&gt;Dave Artz&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/imagemagick"&gt;imagemagick&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/images"&gt;images&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/moddims"&gt;moddims&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/resizing"&gt;resizing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/thumbnails"&gt;thumbnails&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="imagemagick"/><category term="images"/><category term="moddims"/><category term="resizing"/><category term="thumbnails"/></entry><entry><title>Yahoo! proposal to open source "Traffic Server" via the ASF</title><link href="https://simonwillison.net/2009/Jul/7/trafficserver/#atom-tag" rel="alternate"/><published>2009-07-07T12:37:02+00:00</published><updated>2009-07-07T12:37:02+00:00</updated><id>https://simonwillison.net/2009/Jul/7/trafficserver/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://wiki.apache.org/incubator/TrafficServerProposal"&gt;Yahoo! proposal to open source &amp;quot;Traffic Server&amp;quot; via the ASF&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Traffic Server is a “fast, scalable and extensible HTTP/1.1 compliant  caching proxy server” (presumably equivalent to things like Squid and Varnish) originally acquired from Inktomi and developed internally at Yahoo! for the past three years, which has been benchmarked handling 35,000 req/s on a single box. No source code yet but it looks like the release will arrive pretty soon.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/asf"&gt;asf&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/caching"&gt;caching&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/proxies"&gt;proxies&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/squid"&gt;squid&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/trafficserver"&gt;trafficserver&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/varnish"&gt;varnish&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/yahoo"&gt;yahoo&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="asf"/><category term="caching"/><category term="open-source"/><category term="proxies"/><category term="squid"/><category term="trafficserver"/><category term="varnish"/><category term="yahoo"/></entry><entry><title>Installing Django, Solr, Varnish and Supervisord with Buildout</title><link href="https://simonwillison.net/2009/Jun/7/bertrand/#atom-tag" rel="alternate"/><published>2009-06-07T13:54:44+00:00</published><updated>2009-06-07T13:54:44+00:00</updated><id>https://simonwillison.net/2009/Jun/7/bertrand/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://zebert.blogspot.com/2009/05/installing-django-solr-varnish-and.html"&gt;Installing Django, Solr, Varnish and Supervisord with Buildout&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Useful, detailed instructions... but I still think this stuff is Way Too Difficult at the moment. I’m a big fan of the idea of sites that are assembled from multiple smaller web services talking HTTP to each other, but ensuring all the moving parts stay running is massively more painful than just running Apache and MySQL.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/bertrand-mathieu"&gt;bertrand-mathieu&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/buildout"&gt;buildout&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mysql"&gt;mysql&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/operations"&gt;operations&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rest"&gt;rest&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/solr"&gt;solr&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/supervisord"&gt;supervisord&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sysadmin"&gt;sysadmin&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/varnish"&gt;varnish&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="bertrand-mathieu"/><category term="buildout"/><category term="django"/><category term="mysql"/><category term="operations"/><category term="python"/><category term="rest"/><category term="solr"/><category term="supervisord"/><category term="sysadmin"/><category term="varnish"/></entry><entry><title>Phusion Passenger for nginx</title><link href="https://simonwillison.net/2009/Apr/20/passenger/#atom-tag" rel="alternate"/><published>2009-04-20T04:53:55+00:00</published><updated>2009-04-20T04:53:55+00:00</updated><id>https://simonwillison.net/2009/Apr/20/passenger/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gift-phusion-passenger-220/"&gt;Phusion Passenger for nginx&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Passenger (aka mod_rails / mod_rack) enables easy deployment of Rails and Ruby apps under Apache... and the latest version adds support for nginx as well. It works as an HTTP proxy and process manager, spawning worker processes and forwarding HTTP requests to them via a request queue. It can also handle Python WSGI applications—anyone tried it out for that yet?


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/deployment"&gt;deployment&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/nginx"&gt;nginx&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/passenger"&gt;passenger&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rails"&gt;rails&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ruby"&gt;ruby&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="deployment"/><category term="nginx"/><category term="passenger"/><category term="python"/><category term="rails"/><category term="ruby"/></entry><entry><title>Scaling Django web apps on Apache</title><link href="https://simonwillison.net/2009/Apr/10/scaling/#atom-tag" rel="alternate"/><published>2009-04-10T09:23:21+00:00</published><updated>2009-04-10T09:23:21+00:00</updated><id>https://simonwillison.net/2009/Apr/10/scaling/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.ibm.com/developerworks/opensource/library/os-django/index.html"&gt;Scaling Django web apps on Apache&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Cool to see this kind of article cropping up on IBM developerWorks, but it’s a shame they don’t mention mod_wsgi.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ibm"&gt;ibm&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modwsgi"&gt;modwsgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="django"/><category term="ibm"/><category term="modwsgi"/><category term="python"/></entry><entry><title>Future roadmap for mod_wsgi</title><link href="https://simonwillison.net/2009/Mar/19/modwsgi/#atom-tag" rel="alternate"/><published>2009-03-19T17:27:01+00:00</published><updated>2009-03-19T17:27:01+00:00</updated><id>https://simonwillison.net/2009/Mar/19/modwsgi/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.dscpl.com.au/2009/03/future-roadmap-for-modwsgi.html"&gt;Future roadmap for mod_wsgi&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
mod_wsgi 3.0 isn’t too far off, and will include Python 3.0 support, WSGI application preloading and internal web server redirection (similar to nginx X-Accel-Redirect). Version 4.0 plans a major architectural change that will allow multiple versions of Python to be run from the same Apache.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/graham-dumpleton"&gt;graham-dumpleton&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modwsgi"&gt;modwsgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/nginx"&gt;nginx&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/wsgi"&gt;wsgi&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="graham-dumpleton"/><category term="modwsgi"/><category term="nginx"/><category term="python"/><category term="wsgi"/></entry><entry><title>Load spikes and excessive memory usage in mod_python</title><link href="https://simonwillison.net/2009/Mar/16/graham/#atom-tag" rel="alternate"/><published>2009-03-16T17:26:59+00:00</published><updated>2009-03-16T17:26:59+00:00</updated><id>https://simonwillison.net/2009/Mar/16/graham/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html"&gt;Load spikes and excessive memory usage in mod_python&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
“The final answer? Stop using mod_python, use mod_wsgi and run it with daemon mode instead. You will save yourself a lot of headaches by doing so.”


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/graham-dumpleton"&gt;graham-dumpleton&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modpython"&gt;modpython&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modwsgi"&gt;modwsgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/wsgi"&gt;wsgi&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="graham-dumpleton"/><category term="modpython"/><category term="modwsgi"/><category term="python"/><category term="wsgi"/></entry><entry><title>The Django and Ubuntu Intrepid Almanac</title><link href="https://simonwillison.net/2009/Feb/14/comprehensive/#atom-tag" rel="alternate"/><published>2009-02-14T15:42:58+00:00</published><updated>2009-02-14T15:42:58+00:00</updated><id>https://simonwillison.net/2009/Feb/14/comprehensive/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://lethain.com/entry/2009/feb/13/the-django-and-ubuntu-intrepid-almanac/"&gt;The Django and Ubuntu Intrepid Almanac&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Will Larson’s impressively comprehensive guide to configuring and securing an Ubuntu VPS from scratch to run Django, using PostgreSQL and Apache/mod_wsgi behind nginx.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modwsgi"&gt;modwsgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/nginx"&gt;nginx&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/postgresql"&gt;postgresql&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sysadmin"&gt;sysadmin&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ubuntu"&gt;ubuntu&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/vps"&gt;vps&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/will-larson"&gt;will-larson&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="django"/><category term="modwsgi"/><category term="nginx"/><category term="postgresql"/><category term="sysadmin"/><category term="ubuntu"/><category term="vps"/><category term="will-larson"/></entry><entry><title>Apache Qpid</title><link href="https://simonwillison.net/2009/Feb/5/apache/#atom-tag" rel="alternate"/><published>2009-02-05T23:01:41+00:00</published><updated>2009-02-05T23:01:41+00:00</updated><id>https://simonwillison.net/2009/Feb/5/apache/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://qpid.apache.org/"&gt;Apache Qpid&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
A new open source AMQP message queue with implementations in C++ and Java, developed by engineers from Red Hat, IONA and JP Morgan Chase. Anyone tried this yet? Looks pretty good on paper.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/amqp"&gt;amqp&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/c-plus-plus"&gt;c-plus-plus&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/iona"&gt;iona&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/java"&gt;java&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/jpmorganchase"&gt;jpmorganchase&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/message-queues"&gt;message-queues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/qpid"&gt;qpid&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/red-hat"&gt;red-hat&lt;/a&gt;&lt;/p&gt;



</summary><category term="amqp"/><category term="apache"/><category term="c-plus-plus"/><category term="iona"/><category term="java"/><category term="jpmorganchase"/><category term="message-queues"/><category term="open-source"/><category term="qpid"/><category term="red-hat"/></entry><entry><title>asql - Apache SQL querying</title><link href="https://simonwillison.net/2008/Oct/14/asql/#atom-tag" rel="alternate"/><published>2008-10-14T11:22:45+00:00</published><updated>2008-10-14T11:22:45+00:00</updated><id>https://simonwillison.net/2008/Oct/14/asql/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.steve.org.uk/Software/asql/"&gt;asql - Apache SQL querying&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Command line tool for loading web server log files in common log format in to a SQLite database, with a built-in interactive shell.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/asql"&gt;asql&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/logs"&gt;logs&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sqlite"&gt;sqlite&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="asql"/><category term="logs"/><category term="sqlite"/></entry><entry><title>sfical.py</title><link href="https://simonwillison.net/2008/Jun/27/sfical/#atom-tag" rel="alternate"/><published>2008-06-27T08:09:42+00:00</published><updated>2008-06-27T08:09:42+00:00</updated><id>https://simonwillison.net/2008/Jun/27/sfical/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.pocketsoap.com/weblog/2008/06/1816.html"&gt;sfical.py&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Neat idea: write a CGI script that turns a proprietary API (in this case the SalesForce events API) in to standard ical format, then run it on your Mac’s local Apache server and subscribe to it from iCal.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/cgi"&gt;cgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/icalendar"&gt;icalendar&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mac"&gt;mac&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/macos"&gt;macos&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/salesforce"&gt;salesforce&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/simon-fell"&gt;simon-fell&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="cgi"/><category term="icalendar"/><category term="mac"/><category term="macos"/><category term="salesforce"/><category term="simon-fell"/></entry><entry><title>mod_rpaf for Apache</title><link href="https://simonwillison.net/2008/Jun/24/modrpaf/#atom-tag" rel="alternate"/><published>2008-06-24T17:02:55+00:00</published><updated>2008-06-24T17:02:55+00:00</updated><id>https://simonwillison.net/2008/Jun/24/modrpaf/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://stderr.net/apache/rpaf/"&gt;mod_rpaf for Apache&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
A more secure alternative to Django’s equivalent middleware: sets the REMOTE_ADDR of incoming requests from whitelisted load balancers to the X-Forwarded-For header, without any risk that if the load balancers are missing attackers could abuse it to spoof their IP addresses.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/http"&gt;http&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/load-balancing"&gt;load-balancing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/middleware"&gt;middleware&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modrpaf"&gt;modrpaf&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rpaf"&gt;rpaf&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/security"&gt;security&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/xforwardedfor"&gt;xforwardedfor&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="django"/><category term="http"/><category term="load-balancing"/><category term="middleware"/><category term="modrpaf"/><category term="rpaf"/><category term="security"/><category term="xforwardedfor"/></entry><entry><title>Apache proxy auto-re-loader</title><link href="https://simonwillison.net/2008/Feb/18/ned/#atom-tag" rel="alternate"/><published>2008-02-18T09:44:02+00:00</published><updated>2008-02-18T09:44:02+00:00</updated><id>https://simonwillison.net/2008/Feb/18/ned/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://nedbatchelder.com/blog/200802/apache_proxy_autoreloader.html"&gt;Apache proxy auto-re-loader&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Neat trick: set your 502 (Bad Gateway) error document to include a meta refresh tag, automating the refresh needed should a server you are proxying to be temporarily unavailable.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/metarefresh"&gt;metarefresh&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ned-batchelder"&gt;ned-batchelder&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/proxies"&gt;proxies&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="metarefresh"/><category term="ned-batchelder"/><category term="proxies"/></entry><entry><title>themaneater.com Launch</title><link href="https://simonwillison.net/2008/Feb/10/themaneatercom/#atom-tag" rel="alternate"/><published>2008-02-10T08:10:42+00:00</published><updated>2008-02-10T08:10:42+00:00</updated><id>https://simonwillison.net/2008/Feb/10/themaneatercom/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.miketigas.com/2008/02/10/themaneatercom-launch/"&gt;themaneater.com Launch&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
The Maneater’s online edition is where Adrian cut his web development teeth, so it’s great to see them up and running on Django. Important to note that KeepAlive can completely murder Apache/Django performance.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/adrian-holovaty"&gt;adrian-holovaty&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/keepalive"&gt;keepalive&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/themaneater"&gt;themaneater&lt;/a&gt;&lt;/p&gt;



</summary><category term="adrian-holovaty"/><category term="apache"/><category term="django"/><category term="keepalive"/><category term="themaneater"/></entry><entry><title>pysolr</title><link href="https://simonwillison.net/2008/Jan/9/pysolr/#atom-tag" rel="alternate"/><published>2008-01-09T20:50:23+00:00</published><updated>2008-01-09T20:50:23+00:00</updated><id>https://simonwillison.net/2008/Jan/9/pysolr/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://code.google.com/p/pysolr/"&gt;pysolr&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Python wrapper for Solr, the search web service wrapper for Lucene. One thing I’m not clear on: do you need to configure Solr with the fields you’ll be indexing in advance, or can Solr create new fields on the fly to match the data you send it?


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/lucene"&gt;lucene&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pysolr"&gt;pysolr&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/search"&gt;search&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/solr"&gt;solr&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="lucene"/><category term="pysolr"/><category term="python"/><category term="search"/><category term="solr"/></entry><entry><title>Damien Katz: New Gig</title><link href="https://simonwillison.net/2008/Jan/2/damien/#atom-tag" rel="alternate"/><published>2008-01-02T20:35:24+00:00</published><updated>2008-01-02T20:35:24+00:00</updated><id>https://simonwillison.net/2008/Jan/2/damien/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://damienkatz.net/2008/01/new_gig.html"&gt;Damien Katz: New Gig&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
IBM have employed Damien Katz to work full time on CouchDB. The work will be under the Apache license with the ASF owning the copyright.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/asf"&gt;asf&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/couchdb"&gt;couchdb&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/damien-katz"&gt;damien-katz&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ibm"&gt;ibm&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="asf"/><category term="couchdb"/><category term="damien-katz"/><category term="ibm"/></entry><entry><title>Hacky holidays on OS X</title><link href="https://simonwillison.net/2007/Dec/29/adactio/#atom-tag" rel="alternate"/><published>2007-12-29T11:49:15+00:00</published><updated>2007-12-29T11:49:15+00:00</updated><id>https://simonwillison.net/2007/Dec/29/adactio/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://adactio.com/journal/1395"&gt;Hacky holidays on OS X&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Jeremy Keith documents how to get PHP 5 and Apache 2 virtual hosts running on Leopard.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/apache2"&gt;apache2&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/jeremy-keith"&gt;jeremy-keith&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/leopard"&gt;leopard&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/macos"&gt;macos&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/php"&gt;php&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/php5"&gt;php5&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/virtualhosts"&gt;virtualhosts&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="apache2"/><category term="jeremy-keith"/><category term="leopard"/><category term="macos"/><category term="php"/><category term="php5"/><category term="virtualhosts"/></entry><entry><title>Configuring Apache httpd</title><link href="https://simonwillison.net/2007/Oct/12/links/#atom-tag" rel="alternate"/><published>2007-10-12T12:52:49+00:00</published><updated>2007-10-12T12:52:49+00:00</updated><id>https://simonwillison.net/2007/Oct/12/links/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.links.org/?p=264"&gt;Configuring Apache httpd&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Ben Laurie shows how to build up an Apache configuration file from first principles.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ben-laurie"&gt;ben-laurie&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/httpd"&gt;httpd&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="ben-laurie"/><category term="httpd"/></entry></feed>