LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 12-31-2008, 08:49 AM   #1
Tomek58
LQ Newbie
 
Registered: Nov 2008
Posts: 11

Rep: Reputation: 0
Fast subdomains in VirtualHost - how?


Hello!
I have Apache2 but i don't have server DNS, so i connected my domain to IP adress.

In /etc/apache2/sites-available/default i have:

PHP Code:
NameVirtualHost ip.ip.ip.ip

<VirtualHost ip.ip.ip.ip>
 
DocumentRoot /var/www
 ServerName domain
.com
</VirtualHost>

<
VirtualHost ip.ip.ip.ip>
 
DocumentRoot /var/www
 ServerName www
.domain.com
</VirtualHost>

<
VirtualHost ip.ip.ip.ip>
 
DocumentRoot /var/www
 ServerName subdomain1
.domain.com
</VirtualHost>

<
VirtualHost ip.ip.ip.ip>
 
DocumentRoot /var/www
 ServerName www
.subdomain1.domain.com
</VirtualHost
(ip.ip.ip.ip is IP my server)

I would like so automatically:
www.subdomain2.domain.com -> /var/www/subdomain2
www.subdomain3.domain.com -> /var/www/subdomain3
www.subdomain4.domain.com -> /var/www/subdomain4
...
www.subdomain9999.domain.com -> /var/www/subdomain9999
 
Old 12-31-2008, 10:18 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Probably mod_rewrite will do the job and or you could have index pages that redirect with a refresh. But to really accomplish what you're trying to do if you're going to use name based hosting to redirect, you need some type of DNS setup or you'll have to put the names and IP's in your local hosts file, etc.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
subdomains tommytomato Ubuntu 9 06-20-2007 08:30 AM
FAST (Mega fast Mirror) SUSE 10 beta 4 download 1kyle Suse/Novell 2 09-07-2005 11:13 AM
KDE 3.4 Beta 1 - Fast, Fast, very nice linchat Suse/Novell 0 01-26-2005 12:42 AM
Apache VirtualHost, multiple domains and subdomains chrisfx Linux - Networking 2 08-10-2004 03:58 PM
Subdomains tommytomato Linux - Newbie 5 02-04-2004 10:48 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration