Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


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

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

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

VirtualHost ip.ip.ip.ip>
DocumentRoot /var/www
 ServerName www

VirtualHost ip.ip.ip.ip>
DocumentRoot /var/www
 ServerName subdomain1

VirtualHost ip.ip.ip.ip>
DocumentRoot /var/www
 ServerName www
(ip.ip.ip.ip is IP my server)

I would like so automatically: -> /var/www/subdomain2 -> /var/www/subdomain3 -> /var/www/subdomain4
... -> /var/www/subdomain9999
Old 12-31-2008, 09:18 AM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
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.


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 07:30 AM
FAST (Mega fast Mirror) SUSE 10 beta 4 download 1kyle SUSE / openSUSE 2 09-07-2005 10:13 AM
KDE 3.4 Beta 1 - Fast, Fast, very nice linchat SUSE / openSUSE 0 01-25-2005 11:42 PM
Apache VirtualHost, multiple domains and subdomains chrisfx Linux - Networking 2 08-10-2004 02:58 PM
Subdomains tommytomato Linux - Newbie 5 02-04-2004 09:48 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:43 PM.

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