httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabien COELHO <coe...@cri.ensmp.fr>
Subject patch to force name virtual hosts
Date Sat, 13 Nov 1999 10:09:14 GMT

Hello Apache,

I wish I could force name virtual hosts on any ip interface of a machine.
This is not allowed by apache: only names which resolves to local
interfaces are accepted. Thus I've extended the VirtualHost syntax to do
it.

Why forcing name virtual hosts ?

- I want to do this for demonstration purposes in a course about HTTP.

- It also helps me with configuring a local gateway, which can handle any
  site directly, whether or not it resolves to its own IP address. I can
  do this with rewrites or redirects I guess, but it is simpler to just
  configure a vhost for the purpose.

- It might also help to check and test sites on development machines,
  with the actual name of the production machine.

I've attached a small patch to do it. I tried to respect the apache coding
style: In particular, there are as many comments, and I sticked to
one-letter variable names;-)

The path extends the VirtualHost syntax with: [<address>/]<address>[:port].
The old syntax still works the same. The new n1/n2 syntax forces n1 on n2 
interface. It looks like:

<VirtualHost www.apache.org/10.2.14.2>
ServerName www.apache.org
DocumentRoot /path/to/local/root/of/apache/if/any
...
</VirtualHost>

Note that it does not make sense to try to do this in an external module:
the patch is really small (20 lines are added or modified), and the core
apache directives among which VirtualHost are maintained in main/* files.

If the patch is accepted, the documentation should also be updated to
reflect the new syntax extension. As my English is not perfect, I think
that it is an appropriate job for a native speaker to do it. However I can
suggest a patch to the documentation anyway.

Have a nice day,

-- 
Fabien Coelho ___ coelho@cri.ensmp.fr ___ http://www.cri.ensmp.fr/~coelho

Mime
View raw message