Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Apache Virtual Host Catch All

Posted on 2014-01-24
3
Medium Priority
?
615 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 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

876 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