Solved

How I configure Apache Virtual to support all sub-domains

Posted on 2003-11-13
5
661 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 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