Dynamic subdomains on testing machine please help

Using a single web hosting account to host multiple sites

Dynamic subdomains on testing machine please help

Postby feketegy » Wed Sep 13, 2006 9:17 am

Hello
My problem is the following:
I have to create subdomain like user registrations ex.:
user registers -> happyuser -> subdomain created http://happyuser.mysite.com

I want that every subdomain maps to a directory like : http://happyuser.mysite.com maps to /mysite/users/happyuser

Now comes the problem. I want that all this to work on my developer machine which doesn't have internet access(only localhost available), runs on Windows XP SP2, server Apache 2.0.x.
I know already that the HOSTS file doesn't support wildcard dns entries on win xp therefore i have to set up some sort of dns server which supports it...
I read Dynamic Virtual Hosting in the apache documentation it doesn't helped.
What should I do?
Please if anybody can help me i'd appreciate it a LOT.
feketegy
 
Posts: 9
Joined: Wed Sep 13, 2006 9:06 am

Postby richardk » Wed Sep 13, 2006 1:47 pm

You should be able to just add this to the bottom of your httpd.conf file:
Code: Select all
NameVirtualHost       *:80

<VirtualHost *:80>
  ServerName          127.0.0.1
  ServerAlias         localhost
  DocumentRoot        "/path/to/localhost/files"
</VirtualHost>

<VirtualHost *:80>
  ServerName          mysite.com
  ServerAlias         www.mysite.com
  DocumentRoot        "/path/to/mysite.com/files"
</VirtualHost>

<VirtualHost *:80>
  ServerName          abc.mysite.com
  ServerAlias         *.mysite.com
  VirtualDocumentRoot "/path/to/mysite.com/files/users/%1"
</VirtualHost>
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby feketegy » Fri Sep 15, 2006 5:08 am

Still not working, I'm guessing that i have to install some sort of DNS server on my computer to work this stuff offline?
feketegy
 
Posts: 9
Joined: Wed Sep 13, 2006 9:06 am

Postby richardk » Fri Sep 15, 2006 1:00 pm

You could just add a few to the end of your hosts file, if you're only testing. Otherwise you'd need a DNS server.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby feketegy » Sat Sep 16, 2006 2:56 am

i know i need a DNS server. Do you know a good DNS server that you tested and could you help me to install it. I tried Simple DNS Plus and BIND 9 but non of them worked for me...i think because i don't know how to configure them :D
feketegy
 
Posts: 9
Joined: Wed Sep 13, 2006 9:06 am

Postby richardk » Sat Sep 16, 2006 5:57 am

I've never installed a DNS server. Search for a tutorial or ask in the support forums for the DNS server you are trying.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: Majestic-12 [Bot] and 89 guests

cron