[Gloucs] apache virtual hosts

Richard Mellersh richard at the-sett.nildram.co.uk
Sat Sep 18 17:48:09 BST 2004


Guy,
Thanks for the reply, it's not yet sorted, in fact it's worse.

At the bottom I've copied the original mail but ignore the "please feel free 
to try it... " bit - it doesn't.

I suppose it is "mucking around" but I REALLY want it to work from outside but 
without DNS yet (I don't know how or how much it is to do DNS).  What I 
thought would work is if I give friends/ colleagues etc an address such as 
http://195.112.17.79/site1 or http://195.112.17.79/site2 I could somehow use 
apache to redirect these requests to various directories.

I want to start with the "default/unspecified" pages in /var/www which did 
work at one time when I had an old system (P233, RH7 and apache 1).

I now have the system mentioned below which is rubbish at anything GUI but 
networking/disk storage and serving work well.

And then have the specified bit in the url above point to /public/www/site1 or 
/public/www/site2 etc.

"/public/..." is actually /dev/sdb1 and is the second 18GB fast SCSI drive.

My intention is to show people that if I can make pages, so can they, for 
example a local farmer selling his restored tractors or my wife's 
Goddaughters history of growing-up and anything in between.

The other thing about setting up apache is that there is a separate firewall 
system which is running ipcop 1.2 with a "external service access for port 
80" so that people can browse in.

I hope you are able to help.
Thanks
Richard

On Saturday 18 Sep 2004 14:26, Guy Edwards wrote:
> Hi,
>
> Someone asked about Apache virtual hosts and how to do them but I've
> deleted a whole load of emails so I can't reply to it... anyway, just
> thought I'd give some instructions if you've not worked it out yet.
>
> setting up virtual hosts with apache;
>
> 1) If you're just mucking around then edit your /etc/hosts file to
> include your new site, eg:
> /etc/hosts
> 127.0.0.1       portable        localhost
> 127.0.0.1       www.guy.guy
>
> Although for your intranet/public webserver or whatever you'll need to
> alter the DNS so people get directed to your server for the new name.
>
> 2) now make a directory for your second website, I just used
> /var/www and /var/www2 for mine.
>
> 3) put a simple file in each:
> /var/www/index.html
> <html><head></head><body><h1>Site 1</h1></body></html>
> /var/www2/index.html
> <html><head></head><body><h1>Site 2</h1></body></html>
>
> 4) Now in you configuration file for apache, find where it says
> something similar to:
>
> NameVirtualHost *
> <VirtualHost *>
>         DocumentRoot /var/www/
> [..... lots of other stuff ....]
> </VirtualHost>
>
> and change it to something along the lines of
>
> NameVirtualHost 127.0.0.1
> <VirtualHost localhost>
>         ServerName localhost
>         DocumentRoot /var/www/
> [..... lots of other stuff ....]
> </VirtualHost>
>
> <VirtualHost www.guy.guy>
>         ServerName www.guy.guy
>         DocumentRoot /var/www2/
> [..... lots of other stuff ....]
> </VirtualHost>
>
> 5) restart apache, in my case with
> /etc/init.d/apache2 restart
>
> 6) now point your browser at
> http://localhost
> and then at http://www.guy.guy (or whatever you called it)
>
> Hopefully everythings now working.
> Guy
>
>
>
> _______________________________________________
> gloucs mailing list
> gloucs at mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/gloucs
> Virtual IRC meets every Sunday 8-10pm in #glug on irc.slashnet.org

can anyone help with apache 2
I have the following setup

Box 1. ipcop1.2, ISDN (ippp0 BT Fritz works fine at 195.112.17.19) with a 
pinhole for port 80 (I think this works?), eth0 at 192.168.0.250 
(255.255.255.0) to the rest of the systems.

Box 2. A very peculiar SCSI only system as a server for web pages, mail and a 
general repository for all the junk at 192.168.0.50.  It also has a BACKUP 
ISDN card (another BT Fritz) which is configured via ifconfig as 
195.112.17.79 (just in case?).

and others which can all surf and send mail fine.

The problem is with apache v-hosts;
the main page at /var/www is served up ok (please feel free to check).
What I want to do is to have other pages served up from /public/www/1, 2, 3, 
etc.

What do I need in httpd2.conf and vhost.conf?

Thanks
Richard




More information about the gloucs mailing list