Forum Moderators: phranque
I'm running Apache on my ClarkConnect 3.1 box. I have seen and followed a couple of virtual host configuration guides but it's still not working, and I couldn't get any useful advice from the ClarkConnect forum.
I have registered a domain call it 'mydomain.net' and the webserver is serving pages on both my LAN and to external browsers. What I want to do is be able to enter 'http://www.mydomain.net' and get pages from the default web folder, and enter 'http://test.mydomain.net' and be served pages from a different folder.
Here is the relevant code from my httpd.conf:
ServerName www.mydomain.net
ServerName localhost.localdomain
#
Listen 80
#
NameVirtualHost *:80
#
<VirtualHost *:80>
ServerName www.mydomain.net
ServerAlias mydomain.net
DocumentRoot /var/www/html
</VirtualHost>
#
<VirtualHost *:80>
ServerName test.domain.net
ServerAlias *.test.domain.net
DocumentRoot /var/www/html/virtual/test
</VirtualHost>
#
Include conf.d/*.vhost
Also, my hosts file, which I suspect is suffering from overkill on my part:
127.0.0.1 localhost.localdomain localhost www.mydomain.net test.mydomain.net mydomain.net
192.168.1.1 gateway.myname.lan gateway gateway.mydomain.net
When I said it wasn't working, what happens is that whatever URL I enter in the form 'http://*.mydomain.net', I always get served index.htm from the default folder (/var/www/html). I am yet to see my test index.htm page, stored in /var/www/html/virtual/test.
I have been restarting Apache between edits, and forcing my browser to refresh. I have tested all my efforts both from my LAN and externally.
I have only registered one A Record (mydomain.net). I have tried specifying CNAMEs of test.mydomain.net targetting mydomain.net, and www.mydomain.net targetting mydomain.net, but nothing seemed to change. Currently I have no CNAMEs specified.
I'd be very grateful for any help you can give me on this. I have searched and searched without finding an answer to what looks to me like a simple problem... hopefully there's a simple solution which my noobness has missed.
Cheers
Noop
or is this a non-noobs forum?
Welcome to WebmasterWorld!
I don't know what a ClarkConnect is, but this documentation [httpd.apache.org] should be helpful to you.
Jim
I'm not very good at these problems, but maybe these previous threads [google.com] may contain something useful.
Jim