Mobile app version of vmapp.org
Login or Join
Murphy175

: Strategy for hosting 700+ domains names, each with a static HTML site I have a portfolio of more than 700 domain names, and ideally I'd like to put up a single-page HTML/CSS/JavaScript webpage

@Murphy175

Posted in: #BestPractices #CloudHosting #Domains #SiteDeployment #WebHosting

I have a portfolio of more than 700 domain names, and ideally I'd like to put up a single-page HTML/CSS/JavaScript webpage for each domain. Is there a system/strategy/workflow that will allow me to:


Automate the deployment of new websites, quickly and easily without having to manually initiate each new website in an admin panel. For instance, I've seen dropbox-based solutions that claim to make it simple to setup new websites on your dropbox account, but you still have to set each one up in an admin interface first. It would be so much easier to have a folder naming convention that allowed the user to easily clone/copy/duplicate sites inside their Dropbox App folder (https://www.dropbox.com/developers/blog/23) to create new ones. Sounds interesting, however...
It's easy to manage CNAMEs on the registrar-side, but is there a way to quickly associate CNAMEs with new websites (on the hosting side), maybe using the method offered by gh-pages-style (https://help.github.com/articles/setting-up-a-custom-domain-with-pages)? With GitHub's gh-pages, all you have to do is drop a file called CNAME into your repo, with the domain name you want associated with the repo inside the file. gh-pages isn't a good solution for what I'm doing though unfortunately.


I'm also a front-end developer, specializing in rapid web development and "front-end build systems", so I building and maintaining static assets for hundreds of sites is no problem. It's the hosting-side that I really struggle with. Any suggestions?

Edit: I should also mention that managing my own servers is not an option. As a last resort I might look to build a 3rd party service on top of AWS, Azure etc. but managing servers directly is exactly what I'm trying to get away from.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Murphy175

3 Comments

Sorted by latest first Latest Oldest Best

 

@Becky754

Use Wildcard Virtual Host Container in Apache

You can configure Apache with a Wildcard virtual host container. You then control what domains are hosted by simply modifying your DNS to point to the appropriate IP address

If you have the same content on all pages, then just upload the content.

If you require different content, you can use a strategy that a customer of ours used.

The use a single index.php page. The page uses the hostname variable to pull the correct content from the database. In their case, they have different layouts that get populated with various content.

Another strategy I've seen is using Rewrite rules and directories for each site.

Use A records
Also I recommend using A records for this. It prevents the domains being CNAMEd back to a common domain. Can help obscure some simple domain mapping tools. Also prevents added DNS lookups.

So I would have

domain.com CNAME to domain.com domain.com to a A record pointing to an IP address.

Hosting Options

I would be surprised if you could do this with a shared hosting service. You will likely need a cloud or VPS system.

You may want to check out lightly managed VPS providers that will handle doing OS updates for you. Once it is setup, then you could stack 1000's of domains on the system if the traffic is low.

10% popularity Vote Up Vote Down


 

@Moriarity557

Here is a solution that might work for you.

DNS / WEB SERVER SETUP

Get one static ip address and bind that to your web server. (IIS or Apache). Setup your master domains (example.com) DNS with correct A Records. Now if you visit Example.com then the primary site will show up. For all your other domains just create a Cname record which points to Example.com.

MULTIPLE SITES

If you are on Apache then you can follow this example to create a vhosts file that maps each domain to a different folder. stackoverflow.com/questions/775868/apache-and-mod-rewrite-redirect-domain-to-subdirectory
So in essence example.com/ is loaded form /var/www/example.com example.net is loaded from /var/www/example.net

If you are on Microsoft IIS servers then you cant really map domains that way, You would have to write a bit of RewWrite rules or could use ARR to serve as a reverse proxy to build up this functionality. Lots of posts on that on StackOverflow.

DEPLOYMENTS

If you want to get fancy install git on both your server and your dev box. Use something like BitBucket or GitHub to host your repositories. I would just make a master repo called Sites and have it located at /var/www/ with folders in it for each site. That way you dont have to manage a bunch of Git repos. When you are done coding on your dev machine, push your updates to your Git Host. GitHub / BitBucket both support post- hooks which can tell your server to download the new changes and updates.

Another poor man approach (specially on windows) is to use DropBox. We do this on our windows servers and it works like a charm. The only drawback with this approach is that dropbox will sync all code. So you have to be very careful and aware of the fact of what is in DropBox will be live on the server. We overcome this with series of ASP scripts which copy files from DropBox on the server to our WWW directory where we host all our files. We just call the script every time we want the updates to go live. Its not as fancy as Git but post hooks on windows are a huge pain in the rear. Plus having the ability to code on an ipad to edit files in dropbox is good in emergencies.

Amazon S3?

Lastly. If you are 100% sure your sites are all static and will remain that way consider using Amazon S3 to host your static site. S3 works with Cname records. So each site can be site2343.s3.amazon.bla.bla. The advantage is your code is safe and runs super fast. The disadvantage is that it can get expensive.

10% popularity Vote Up Vote Down


 

@Annie201

@jonschlinkert setting up CNAMES has nothing to do with adding a single HTML page to 700 domains. CNAME's won't help any with SEO. If you're creating a single HTML page for each of your domains why not build an HTML template. I don't think you'll find any good method of inserting the copy into each page since you'll have to write the content at some point you may as well do it into the HTML pages themselves.

There are a few applications which let you manage multiple WordPress sites from a single dashboard that my be useful to you.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme