Mailing List Archive

Virtual Hosts and other ugly things
--==========2634032363==========
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello, mod_backhand experts,

after long time trying to configure mod_backhand for a small cluster with=20
3 machines and a lot of virtual hosts I give up and ask here ...


I've two questions: first how to handle virtual hosts and second how to=20
handle my special situation. Let's start with the last:


The scenario is as follows (given by my boss):

* a master server, which handles all originating requests
this server delivers some virtual hosts directly and
forwards some other to the two backend servers

* two additional webservers, which handle some virtual hosts
with a lot of slow or "CPU intensive" PHP code

* (a fourth server is a database only server with idle time)


Yes, I know this is stupid, not redundant and throws a lot of performance=20
away. It's not my decision (but perhaps in future it will revoked) ...



If someone has an example configuration for this,.I'll be very happy! :-)


At the moment we have an Apache on Port 8080 to test the new scenario (on=20
the frontend is an old apache running all virtual hosts).


My Configuration is at the moment:


# =3D=3D=3D FRONTEND SERVER =3D=3D=3D

# socket etc ...
UnixSocketDir /var/log/apache/backhand


# If a server DOESN'T send some stats to others,
# apache/backhand DOESN'T start without errors
# So, let's send some dummy stats somewhere ...

MulticastStats 212.9.188.89 212.9.188.92:4445


# Accept stats from our two backends
AcceptStats 212.9.188.93
AcceptStats 212.9.188.92


# activate load balancing for a directory / testing
# the same will be placed in some VHost-Settings

<Directory /serv/www/www.xyz.de/cgi>
Backhand byAge
Backhand byLoad
</Directory>


<Location /backhand/>
SetHandler backhand-handler
Allow from all
</Location>


# =3D=3D=3D BACKEND SERVERS =3D=3D=3D

# sockets ...
UnixSocketDir /var/log/apache/backhand

# send stats to frontend only
MulticastStats 212.9.188.89:4445

# take stats from our subnet
# without this apache/mod_backhand doesn't start correct
AcceptStats 212.9.188.88/29

# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


Nevertheless the frontend accepts stats from localhost, in the server=20
overview at /backhand/ shows a red / not ready 212.9.188.89:8443 (frontend =

with SSL), the second backend (212.9.188.93) and 127.0.0.1:80 (in this=20
order).

Why iappears the frontend? And why as third machine localhost and not=20
212.9.188.92? 212.9.188.92 appears


The second part is: how should I write a correct virtual host config?


It seems, that the frontend handles connections, even if there are

Backhand byAge
Backhand byLoad


Statements in the <direcory>-Config (cgi folder at above example).
Why? How can i get rid of this?


At the frontend it seems to be easy to deliver sone virtual hosts to the=20
backends:

<VirtualHost www.foobar.de>
# ...
Backhand byAge
Backhand byLoad
# ...
</VirtualHost>


This is correct, isn't it?


But how can the backends realize which virtual host is accessed?

I tryed it with the following, but something goes wrong:


# =3D=3D=3D BACKEND VHOST =3D=3D=3D

Listen 80

NameVirtualHost 212.9.188.92

<VirtualHost 212.9.188.92>
ServerAlias web.foobar.de
# ...
</VirtualHost>


How should I configure the backend's vhosts, so that apache recognises=20
them? I can't write the name into the VirtualHost Tag, because it resolves =

to another IP ...


Perhaps the whole scenaria can't work?
Is it better to create a DNS round Robin for all Domains and to have an=20
private subnet (e.g. on 192.168.1.0/24) for forwarding and all machines=20
should deliver everything? But how Virtual Hosts work then?!?

Puuh, a lot of greenhorn questions. I hope you understand them ...


Thank you for helping!


Ciao
Alvar

--=20
// STOP CENSORSHIP! http://www.odem.org/informationsfreiheit/en/
// Blaster: http://www.a-blast.org/

--==========2634032363==========
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: Weitere Infos: siehe http://www.gnupg.org

iD8DBQE8vh5hOndlH63J86wRAlZWAKCJJyiZOHlhSlfdRIc88GaZogw2EACfZQjd
FxuczXSY4hd0tpoGpuGKSMs=
=4hjv
-----END PGP SIGNATURE-----

--==========2634032363==========--
Virtual Hosts and other ugly things [ In reply to ]
--NDin8bjvE/0mNLFQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 18, 2002 at 04:49:46PM -0400, Theo Schlossnagle wrote:
> Date: Thu, 18 Apr 2002 16:49:46 -0400
> From: Theo Schlossnagle <jesus@omniti.com>
> Subject: Re: [m_b_users] Virtual Hosts
>
> >>has someone an example configuration for a cluster with x servers
> >>and name based virtual hosts?
> >
> >Better question: does anyone have a patch for the mod_backhand
> >source that allows mod_backhand to work with name based virtual
> >hosts?
> >
> >:~) Currently it does not support this. How would you handle
> >broadcasting out possibly hundreds of virtualhost names every
> >second? There are problems with this scenario that aren't trivial.
> >-sc
>
> I have mod_backhand running on a small set of boxes with 30 or so
> virtualhosts. It works fine. The broadcasts are per machine, not
> per host. So, they _should_ only broadcast once per Apache instance
> no matter the number of virtual hosts you have.
>=20
> Backhand directives were in File, Location and Directory clauses in the=
=20
> the Apache configuration file. I don't understand the problem.

I was thinking of mass virtual hosting. My bad. Having looked at his
two prior posts, it looked like he wanted to say server A is handling
virtual hosts X, Y, and Z. Server B had I, J, and K. Server C is
acting as a reverse proxy and delegating requests to server's A and B
accordingly.

If you've only got a handfull of machines and the virtual hosts are
specified in the configuration file, you could use byHostname to
delegate requests to A and B. If you add a new virtual host, you'll
have to add it to server C and HUP apache: mod_backhand doesn't
broadcast the virtual hosts that it serves. Sorry for the confusion:
my headspace is elsewhere. -sc

--=20
Sean Chittenden

--NDin8bjvE/0mNLFQ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Comment: Sean Chittenden <sean@chittenden.org>

iEYEARECAAYFAjy/NQUACgkQn09c7x7d+q0+vQCguI+NTMjIXJ0ZCLcGyiexknoJ
kmkAoNhyRoZUEwHZRCKYQ6Gf38znm0xL
=OsEu
-----END PGP SIGNATURE-----

--NDin8bjvE/0mNLFQ--