Solved

Apache Virtual Host Catch All

Posted on 2014-01-24
3
598 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 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 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
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

623 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