?
Solved

Apache Virtual Host Catch All

Posted on 2014-01-24
3
Medium Priority
?
608 Views
Last Modified: 2014-01-29
I'm on Ubuntu EC2 using Apache and was wondering if there was anything wrong with the following.

We are using the sites-available and sites-enabled and I have a number of different sites configured each with their own file. Everything is working great. I now want to create a new file and I'll call it

zzz-subsites

I name it this so it's processed very last. In the file I have the following.

<virtualhost *:80>
                 ServerAlias www.*.com www.*.net
                 DocumentRoot /var/www/mysubsites
</virtualhost>

I test it and it looks like its working. I'm hoping someone can point out if there will be any issues or pitfalls by doing this.

What I'm trying to accomplish is this. We have over 150 sites that are served up but a single application. It sees the domain name that comes in, say www.firstsub.com and then serves up the unique content for that site. I don't want to create 150 virtual hosts ALL pointing to the same document root and I want the team who creates and works on the sites to simply set up the pointers in the registrar which they have access to and then they are done without involving me.

edit: The subsites will ALWAYS come in as www since in godaddy we forward the main site to the www cname which points to a AWS loadbalancer.
0
Comment
Question by:loki0609
[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
  • 2
3 Comments
 
LVL 62

Accepted Solution

by:
gheist earned 2000 total points
ID: 39808519
Do you want 150 hosts to show the same content or you want them to redirect to your site setting Referer: with original site?

Wildcard is valid in context you show.
0
 
LVL 2

Author Comment

by:loki0609
ID: 39809698
They have the same framework but the content is unique and is pulled dynamically based on the incoming url (we are a franchisor).
0
 
LVL 62

Expert Comment

by:gheist
ID: 39810206
Get a list of all hist names and generate 150 conf files (named after middle part of host?)?

You can include e.g /etc/httpd/franchises/*.conf and tune each to your liking.
0

Featured Post

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

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

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

719 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