Michael Forster wrote:
> "paul sissons" <psissons.TakeThisOut@eudoramail.com> wrote in message
> news:vj3jbirmkgtv87@corp.supernews.com...
>
>>I need help setting up Virtual Hosts. I have set up Red Hat Linux and
>>successfully configured Apache as a web server. I can hit the webserver
>>through the firewall however I am having difficulty getting Virtual
>>Hosts to work. I have read the documentation but something is not
>>clicking. I tried the following:
>>NameVirtualHost *
>><VirtualHost *>
<font color=green> >> ServerName <a style='text-decoration: underline;' href="http://www.domain.tld</font" target="_blank">www.domain.tld</font</a>>
>> DocumentRoot /var/www/html/domain
>></VirtualHost>
>>The ServerName directive is set to the external IP address. The computer
>>running Linux with the webserver is connected to a SMC router which is
>>running a firewall. Could this be causing me grief?
>
>
> No,
> You are using *
>
> Your Virtual host setting should be as follows
>
> NameVirtualHost my.ipa.ddr.ess
<font color=purple> > <VirtualHost <a style='text-decoration: underline;' href="http://www.domain.tld></font" target="_blank">www.domain.tld></font</a>>
<font color=purple> > ServerName <a style='text-decoration: underline;' href="http://www.domain.tld</font" target="_blank">www.domain.tld</font</a>>
> DocumentRoot /var/www/html/domain
> </VirtualHost>
>
> Mike.
>
>
Thanx Mike. I tried this configuration but still no success. Let me
provide some more details about the set-up. With the default
configuration (no VirtualHost entries), DNS resolves successfully to the
router/firewall and is forwarded correctly to the computer running
RHL9 and Apache 2, and Apache displays the default Apache "Test Page"
(ie. located at /var/www/error/noindex.html).
My httpd.config file has the following settings:
#Main Server Configuration
Listen *:80
User apache
Group apache
# the internal server IP where the router/gateway is 192.168.2.1
ServerName 192.168.2.121
UseCanonicalName off
DocumentRoot "/var/www/html"
# Virtual Host Section
NameVirtualHost 192.168.2.121
<VirtualHost 192.168.2.121>
DocumentRoot /var/www/html/domainname
ServerName <a style='text-decoration: underline;' href="http://www.domainname.tld" target="_blank">www.domainname.tld</a>
</VirtualHost>
-- end of clip --
With this single VirtualHost Directive, Apache still redirects to the
Apache "Test Page" and not the "index.html" document in the 'domainname'
directory.
I have also placed an "index.html" document inside "/var/www" and
another inside "/var/www/html" but the server is not going to either of
these documents.
It is as though the domain name is getting stripped out by the firewall
and defaults to the Apache "Test Page"
I know it must be something real obvious, I just can't see it.
All suggestions appreciated.<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: virtual hosts behind a firewall