Solved

How I configure Apache Virtual to support all sub-domains

Posted on 2003-11-13
5
663 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

738 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