5

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:

  1. 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...

  2. 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.

7
  • Are these actually 700 different web sites, or multiple domains for the same site? Nov 25, 2012 at 17:31
  • "Domains for the same site"? I'm not sure what that means. Are you referring to subdomains, or sub-folders? First sentence "I have a portfolio of 700 domain names". I don't have 700 websites yet, I'd like to. That's what the question is about. Nov 25, 2012 at 18:09
  • He wants to know if each domain has unique content or if multiple domains will show the same content.
    – ZippyV
    Nov 25, 2012 at 18:26
  • So, "will each website have unique content?". No. Nov 25, 2012 at 19:08
  • If they don't have unique content, what's the point? You're going to get punished by Google for duplicate content.
    – Kenzo
    Nov 25, 2012 at 23:25

3 Answers 3

2

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 www.domain.com

www.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.

0
2

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. https://stackoverflow.com/questions/775868/apache-and-mod-rewrite-redirect-domain-to-subdirectory

So in essence http://example.com/ is loaded form /var/www/example.com http://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.

3
  • Sounds like it might be easier for me to get this working than I thought. A couple of things, though: Nov 26, 2012 at 18:12
  • The suggestions I like most were Git and S3. As I mentioned in the question, I use Git/GitHub, and I have a few sites running on Azure that use post-hooks to automate deployment from a few of my github repos. It sounds like I would only need to setup the post-hooks once, since the sites would be grouped under one repo, correct? And to the dropbox suggestion, so you just installed dropbox on server with it tied to the WWW directory? That works? I like that idea a lot. (and I enjoy creating build scripts, so that's no prob...). Nov 26, 2012 at 18:28
  • and to your comment that "hooks on windows are a huge pain", have you worked with Azure yet? It's super simple to setup continuous deployment between git and windows. However, for any of these solutions to be viable for me, I still need to find a way to automate the process of implementing new sites without manually updating CNAME records or anything else. I suppose I want my build script to pass that information to the server for me... Is that possible in any of your suggestions? Nov 26, 2012 at 18:32
0

@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.

7
  • "setting up CNAMES has nothing to do with adding a single HTML page to 700 domains." - interesting, did you find a way to circumvent associating CNAMES with your domain names? CNAME's won't help any with SEO Nov 25, 2012 at 19:08
  • You could get a cloud server from Amazon for free for one year. Install Apache2, put all your domains into a text file. Write a shell script to create all your virtual hosts. If you need to host 700 unique sites all with their own root folders either automate it with a script or hire some cheap help and send them a single apache2 sites available file and ask your helper to create another 700. Another option is to configure ubuntu to add a public_html into each users home folder. Then create users with domain names as their username.
    – Anagio
    Nov 25, 2012 at 19:21
  • Lost my connection when I was replying before. "CNAME's won't help any with SEO" - That's correct. SEO, isn't relevant to my question (I'm a certified Google Advertising Professional so I'm okay there anyway). And I don't want to do anything spammish with the sites, just sell the domains, thus "inserting copy" wasn't asked about implied either. But I did mention that I'm a developer and "managing the sites is no problem". Also, I specified "static sites", so WordPress isn't an option. I host hundreds of sites with WP Multisite. Nov 25, 2012 at 19:29
  • you're last comment is interesting, I'll have to look into how difficult that would be to setup. To your point I could probably hire someone to manage that if need be. It seems much more complicated than what I'm hoping to find. If I can't find something simpler, I might have to build a service to do this Nov 25, 2012 at 19:31
  • You'll want to look into httpd.apache.org/docs/trunk/vhosts/mass.html or per-user web directories httpd.apache.org/docs/2.2/howto/public_html.html
    – Anagio
    Nov 25, 2012 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.