Solved

Apache Virtual Host Catch All

Posted on 2014-01-24
3
578 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
  • 2
3 Comments
 
LVL 61

Accepted Solution

by:
gheist earned 500 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 61

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now