Jump to content


Photo

subdomains with apache


  • Please log in to reply
3 replies to this topic

#1 lobotommy

lobotommy
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • Locationtestelt, Belgium

Posted 12 September 2003 - 09:59 AM

Hi,

I\'m running an apache webserver on SUSE.
My domainname is linked to the nameservers of no-ip.com.
I have wildcards enabled, so *.mydomain.tld goes via a webdirect to my webserver 192.168.0.2 (via portforwarding on my firewall)

Now I want to server name based virtual hosts on the apache but I CANNOT find the right info in the apache manuals

ex: mydomain.tld has docroot /www/htdocs/main
sub1.mydomain.tld has docroot /www/htdocs/sub1
sub2.mydomain.tld has docroot /www/htdocs/sub2

I tried the following virtualhosts setup:

<VirtualHost *>
DocRoot /www/htdocs/main
ServerName mydomain.tld
</VirtualHost>
<VirtualHost *>
DocRoot /www/htdocs/sub1
ServerName sub1.mydomain.tld
</VirtualHost>
<VirtualHost *>
DocRoot /www/htdocs/sub2
ServerName sub2.mydomain.tld
</VirtualHost>

Whatever url I type in, I always get connected to the domain mydomain.tld (so the index file in /www/htdocs/main)


I would greatly appreciate if someone could help me out here!

Many thanks,
Tommy

#2 IceBreaker

IceBreaker
  • Members
  • Pip
  • Newbie
  • 1 posts
  • LocationBosnia & Hercegowina

Posted 14 September 2003 - 12:10 PM

dont you need DNS entries for your subdomains???
ICE ICE BABY

#3 lobotommy

lobotommy
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • Locationtestelt, Belgium

Posted 14 September 2003 - 03:37 PM

no-ip.com sends all the requests to my webserver
It\'s apache that should deal with the request, but it doesn\'t :cry:


Tommy

#4 pauper_i

pauper_i
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts
  • LocationPhoenix, AZ, USA

Posted 14 September 2003 - 09:07 PM

Just a thought, but do you have the right syntax in there?
According to the Apache docs, it should be:

   NameVirtualHost *

   <VirtualHost *>
   ServerName www.domain.tld
   DocumentRoot /www/domain
   </VirtualHost>

whereas you have:

<VirtualHost *>  
DocRoot /www/htdocs/sub1  
ServerName sub1.mydomain.tld  
</VirtualHost>

I don\'t know if you have \"DocumentRoot\" in full in your httpd.conf?

D
Genius is one percent inspiration, and ninety-nine percent perspiration. [br]Thomas Alva Edison




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users