LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Subdomains & Apache Vhosts (https://www.linuxquestions.org/questions/linux-newbie-8/subdomains-and-apache-vhosts-139444/)

Big Brad 01-27-2004 10:18 PM

Subdomains & Apache Vhosts
 
Hi Everyone

I am having truoble with creating a subdomain. I have http://www.bjc.id.au/ working fine. But I want to get http://montrose.bjc.id.au/ to go to a different page on the same web server. At the moment both return the same page and I want the montrose to return a diffrent page. I have tried setting up a second Vhost under apache with a diffrent document root. I am not sure whats wrong. I have tried to solve this my self with google and I only ever post here as a last resort.

Here is my zone file.


$TTL 86400
@ IN SOA ns1.bjc.id.au. support.bjc.id.au. (
29 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttl
)


@ IN NS 203.87.32.230.
@ IN NS ns1.bjc.id.au.

@ IN MX 10 mail
bjc.id.au. IN MX 10 mail.bjc.id.au.

bjc.id.au. IN A 203.87.32.230
mail IN A 203.87.32.230
@ IN A 203.87.32.230
montrose IN A 203.87.32.230
ftp IN A 203.87.32.230

www IN CNAME bjc.id.au.


Later on I would like to get ftp.bjc.id.au and mail.bjc.id.au to piont to the obvious places. But once again they only piont to the main page.

Please If you could help it would be great.

Thanks Brad

Big Brad 01-27-2004 11:53 PM

I thought this might be useful as well.
<VirtualHost 192.168.2.3>
DocumentRoot /home/bjc/www
ServerAdmin support@bjc.id.au
ServerName bjc.id.au
ServerAlias www.bjc.id.au
ServerSignature email
DirectoryIndex index.html index.php index.htm index.shtml
ServerSignature email
</VirtualHost>


<VirtualHost 192.168.2.3>
DocumentRoot /home/bjc/www/Montrose
ServerAdmin support@bjc.id.au
ServerName montrose.bjc.id.au
ServerAlias montrose.bjc.id.au
DirectoryIndex index.html index.php index.htm index.shtml
</VirtualHost>

Demonbane 01-28-2004 02:44 AM

Have you put
Code:

NameVirtualHost 192.168.2.3
?

Big Brad 01-28-2004 03:12 AM

I am using the redhat config tool. And I have selected name based. So I asume that it is correct.

Demonbane 01-28-2004 04:06 AM

Better double check anyway, here's my vhost configuration that works fine on my LAN, see if its any help:
Code:

NameVirtualHost 192.168.0.2

<VirtualHost 192.168.0.2>
Servername ciel
DocumentRoot /var/www/localhost/htdocs
</VirtualHost>

<VirtualHost 192.168.0.2>
Servername public.ciel
DocumentRoot /var/www/localhost/htdocs/public
</VirtualHost>


Big Brad 01-28-2004 04:56 AM

Yes mine does have the NameVirtualHost 192.168.2.3
I just missed it when I copyed it.

Big Brad 01-28-2004 08:48 PM

Thanks Guys I have fixed my problem.

Demonbane 01-28-2004 09:28 PM

Just for the record what was the problem and how did you solve it?

Big Brad 01-28-2004 09:36 PM

Ok well basicly I found out later that my secondary dns server was serving incorrectly and it was almost as if it was just telling *.bjc.id.au to get redirected to www.bjc.id.au. Anyway it all fixed now.

Thanks Brad


All times are GMT -5. The time now is 06:38 AM.