Solved

How I configure Apache Virtual to support all sub-domains

Posted on 2003-11-13
5
662 Views
Last Modified: 2010-03-04
I have some differences domains and sub domains
like this
abc.com
xyz.com
xxx.com

and sub domain
ftp.abc.com
www.abc.com
xxx.abc.com
...

all domains/sub-domain point to 1 IP address
I use mydomains.com as name server that can support "ANY ALL SUBDOMAIN" to 1 IP
For example
I can ping  a.bc.d.e.f.asdfa.sadfs.sdaf.fdsaf.ds.abc.com == my ip
but I not have to configure that subdomain

Now i can configure VirtualHost for all domain that I have, but
can not set for any all subdomain

QUESTION
1. Can apache support any all subdomain virtualhost?
2. If it can, how to configure that. if not why? where is document to refer
0
Comment
Question by:saknarak
  • 3
  • 2
5 Comments
 

Accepted Solution

by:
netter-bvg earned 125 total points
ID: 9739554
Put intohttpd.conf:

<VirtualHost  ip-address>
  ...
  ServerName abc.com
  ServerAlias   abc.com  *.abc.com
  ...
</VirtualHost>
0
 
LVL 2

Author Comment

by:saknarak
ID: 9741866
that ok, thank :D
0
 
LVL 2

Author Comment

by:saknarak
ID: 9741921
If I want to except some sub-domain for other DocumentRoot

I must rearrage VirtualHost tag??

example
<VirtualHost ip-address>
   ...
   ServerName xxx.abc.com
   ...
</VirtualHost>
<VirtualHost ip-address>
  ...
  ServerName abc.com
  ServerAlias *.abc.com
</VirtualHost>

is this example work??
0
 

Expert Comment

by:netter-bvg
ID: 9747380
I am not sure it works (not tested). I think each ServerAlias must be defined using regular expressions:

ServerName xxx.abc.com

ServerName abc.com
ServerAlias !(xxx).abc.com

(all is not tested)
0
 

Expert Comment

by:netter-bvg
ID: 9747477
Resource: httpd.apache.org/docs/ (v 1.3)
Usefull command:  apachectl configtest (tests config files)
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question