Re: [Hampshire] webserver route to another box on an interna…

Top Page

Reply to this message
Author: Steve Kemp
Date:  
To: victor, Hampshire LUG Discussion List
CC: 
Subject: Re: [Hampshire] webserver route to another box on an internal LAN?
On Fri, Mar 02, 2007 at 07:47:18PM +0000, Victor Churchill wrote:

> We learn something new every day! Sadly:
> victor@ss07:~$ locate a2enmod
> victor@ss07:~$ sudo !!


Shame.

> victor@ss07:~$ sudo apt-cache search a2enmod
> victor@ss07:~$


apache2.2-common is the package which provides it. Search
http://packages.ubuntu.com/ and you'll see:

  FILE                                  PACKAGE
  usr/sbin/a2enmod                      web/apache2.2-common


If you have apache2 installed you should get it pulled in by
magic. Take a look at /usr/lib/apache2/modules/ to see the
actual precompiled mod_proxy.so file. If not install the
package manually.

Once you've located the package you just enable it as already
instructed:

    a2enmod proxy
    /etc/init.d/apache2 reload


Then you'll (obviously) need to configure your virtual host
to use it. Something like this:

<VirtualHost *>
    # Server name - as used to external sites.
    ServerName test.example.com


    # Proxy ACL
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>


    # Proxy directives - pass requests to the server "foo.internal.com:80"
    ProxyPass / http://foo.internal.com:3000/
    ProxyPassReverse / http://foo.internal.com:3000/
    ProxyPreserveHost on


    # Logfiles
    ErrorLog  /var/log/apache2/test.example.com.error.log
    CustomLog /var/log/apache2/test.example.com.access.log combined
</VirtualHost>


If this doesn't make sense to you then I suggest you read a little
more about :

    a) apache virtual hosts
    b) apache module configuration under Debian/Ubuntu.
    c) apache site maintenance under apache 2.x (sites-enabled.d/ +
       sites-available.d) on Debian/Ubuntu.


The apache website has a lot of interesting information which
is helpful. (Not trying to be brush-offy; but reading is good :)

Steve
--