Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 1999 14:24:02 -0500
From:      Tony Wells <awells@journalstar.com>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Configuring Apache 1.3.4
Message-ID:  <378E3552.4B4623E9@journalstar.com>
References:  <LOBBKEGHCNEHPLGFIAKPMEDECAAA.richard@sinclairassoc.force9.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
You are running IP-based virtual hosts, so Apache won't really care what
the reverse-lookup is for that IP.  You need to get the box listening on
the IP's for your virtual servers.  You can do this using the ifconfig
command.  Normally you would specify a NIC card, but since you don't
have one use the loopback device.  The command will look something like
this:

ifconfig lo0 inet 10.0.0.1 netmask 255.255.255.255 alias

Do this for each IP you want to alias.

I tried it and it seems to work.  You'll know if you got it right if you
can ping the aliased IP's.  Apache should then answer on the aliased
IP's.  Did I use the word alias enough?


Richard Morte wrote:
> 
> Hi,
> 
> As a designer of web sites I wanted to set up a local standalone server to
> test the site before uploading. Most of my work involves cgi/perl so an
> Apache Server running on FreeBSD seemed a good choice.
> 
> Have installed and loaded FreeBSD with only a few problems, most of which
> were sorted out by looking through the docs and FAQs. However, I am stuck
> with an Apache configuration. Please bear in mind I've only been at this
> (and Unix) a couple of days, so I'm at the start of the learning curve. Here
> goes...
> 
> Apache is up and running and will serve web pages with the URL
> httpd://localhost/ but I want to configure virtual hosts to emulate the
> sites for different clients. This is the bit I'm stuck on. I'm using FreeBSD
> 3.1-stable / Apache version 1.3.4. The Unix box is standalone, no network
> cards, no modem. The cgi- bit will be implemented later, once the virtual
> hosts are sorted.
> 
> 1. /etc/rc.conf configured with the following:
> hostname="sparky.at.home"
> tcp_extensions="YES" # this was added in desperation, but made no difference
> 
> 2. /etc/hosts configured with the following:
> 127.0.0.1 localhost sparky.at.home
> 10.0.0.1 www.client2.local
> 10.0.0.2 www.client2.local
> etc.
> 
> 3. /usr/local/etc/apache/httpd.conf configured with:
> ServerType standalone
> ServerRoot /usr/local
> ExtendStatus On
> Port 80
> User nobody
> Group nogroup
> ServerName sparky.at.home
> DocumentRoot "/usr/local/www/data"
> HostnameLookup On
> 
> ...
> 
> <VirtualHost 10.0.0.1>
> ServerName www.client1.local
> DocumentRoot /usr/local/www/data/client1/htdocs
> # the htdocs bit mirrors the isp's webspace structure, that's why it's there
> ...
> </VirtualHost>
> 
> ...
> 
> <ViurtualHost _default_:80>
> DocumentRoot /usr/local/www/data/default/htdocs
> ...
> </VirtualHost>
> 
> Note that I had to specify the full path for the document roots for the
> virtual hosts, not just the relative "/www/data/... " bit because http
> complained that the directories did not exist.
> 
> 4. The directory structure is as follows:
> 
> /usr
>   |--- /local
>           |--- /www
>                  |---/data
>                         |--- /default (drwxr-xr-x own/grp: root/wheel))
>                         |       |--- /htdocs (drwxr-xr-x own/grp:
> root/wheel)
>                         |
>                         |--- /client1 (drwxr-xr-x as above)
>                         |       |--- /htdocs (drwxr-xr-x as above)
>                         |
>                        etc
> 
> The intention was to create a scratch area using /default/htdocs with
> clients' html maintained in each separate client directory accessed via
> www.clientn.local
> 
> No errors are reported in the /var/log/httpd-errors
> 
> 5. a ping to localhost as well as sparky.at.home is successful, but to
> www.client1.local returns the error:
>   ping: send to: No route to host
> 
> 6. The kde browser and Netscape (4.6.1) will access and deliver webpages;
> the default Apache "It worked" page using http://localhost/ or
> http://sparky.at.home" with Netscape but the kde browser delivers Directory
> of /. Why these two should be different is beyond me but Netscape is clearly
> pointing at /usr/local/www/data/index.html whereas the kde browser is
> pointing to /usr/local/www/data/default/
> 
> 7. When trying to access http://www.client1.local Netscape reports that
> there is no tcp/ip connection to the host; the kde browser returns a 404 not
> found.
> 
> OK, that's a lot of info - I only hope it helps. If anyone can help me get
> over this hurdle I'd be eternally grateful.
> 
> Richard Morte
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?378E3552.4B4623E9>