Hosting multiple virtualhosts in apache2

Brian Neltner neltnerb at MIT.EDU
Sat Mar 5 04:33:05 CET 2011

Dear Varnish,

I'll preface this with saying that I am not an IT person, and so
although I think I sort of get the gist of how this all works, if I
don't have fairly explicit instructions on how things work I get very

That said, I have a slicehost server hosting which
has varnish as a frontend. Varnish listens on port 80, and apache2
listens on port 8080 for ServerName with ServerAliases
for,, and

What I want to do is have the slice host a different website from the
same IP address,

I *think* that I know how to set apache2 up with a virtualhost for this,
and my thought was to tell it that the virtualhost should listen on port
8079 instead of 8080 (although maybe this isn't necessary).

To try to do this, I looked at the documentation for Advanced Backend
Documentation here

However, the application they're looking at here is sufficiently
different from what I want to do (although frustratingly close), that I
can't tell what to do. It seems that this is setup to have a
subdirectory that matches the regexp "^/java/" go to the other port on
the backend, which is all well and good, but this doesn't seem to be
something that is likely to work with a totally different ServerName
(after all, the ^ suggests pretty strongly that the matching doesn't
begin until after the ServerName).

I also saw in the "Health Checks" some stuff that looked like it did in
fact do some stuff with actual ServerNames, but I really don't get how
to tell Varnish where to pull requests on port 80 from which as far as I
can see is done with regexps that don't handle what I'm looking for.

Sorry if this is covered somewhere more obscure in the manual, but as I
said, I'm really not particularly good with computers despite the mit
email address (I do chemistry...), and trying to work through this
entire manual in detail is going to drive me crazy.

Brian Neltner

More information about the varnish-misc mailing list