2
14 Comments

Static HTML Cloud Hosting for my SaaS

Cloud website hosting service experience?

I am thinking of adding some static website hosting to my SaaS
I was wondering if anyone has experience setting up such a thing?
Ideally:

  1. all API driven
  2. auto SSL
  3. subdomains to my domain setup for users
  4. DNS name pointing to our subdomain (theirsite.mydomain.com)
  5. Completly could hosting...cheap, don't much care where
  6. a whole site really could be hosted
  7. Maybe metered or usage tracked for billing
    8 . SEO friendly
  8. ...etc.
    Happy to pay a developer if we can work together.
  1. 1

    Greg, you can do it in AWS using s3 + cloudfront + route 53. For each of you subdomains, you need to create s3 bucket and cloudfront and point that to various record in route 53.
    I have done this for a main website (xyz.com) and blog website (blog.xyz.com) both pointing to same route 53.

    1. 1

      Thank you! Are there API calls for all three services to do these tasks?

      1. 1

        yup, all the aws services are accessible by api, there is some learning curve though initially inorder to get it correct.

        1. 1

          I want to avoid the AWS learning curve if possible. How much work to set this up? with local API to configure and update sites and pages? Cost estimate...assuming you can do it.

  2. 1

    Hi Greg,

    For my project, I'm prototyping something similar using Apache on a cheap VM. I'm a bit old-school and have yet to see the benefit of AWS for the really simple stuff.

    I'm using the 'mod_vhost_alias' module which allows you to map subdomains to directories on the filesystem. https://httpd.apache.org/docs/2.4/mod/mod_vhost_alias.html

    If you dedicate a domain name to the hosting of your customer content, you can simply point the main record to the IP of your server/load balancer.

    If no subdomain directory is found, you can redirect to your main site, or serve some promotional content to say that the subdomain is available for registration and show a registration link.

    If your needs are like mine, where you're potentially only dealing with up to a thousand low-traffic sites, you might find this approach is workable.

    For SSL you can use letsencrypt to provision a wildcard certificate to your server/loadbalancer. https://dev.to/nabbisen/let-s-encrypt-wildcard-certificate-with-certbot-plo

    One set up it's good for all subdomains and will auto-renew. It does mean that all users share the same SSL certificate so, without knowing your specific needs, this could be a problem.

    You can then write an API, like me, to publish files into the relevant subdomain directories from your backend system. I have my API running on a different domain with a job queue to manage the publishing of new content to the content server.

    I'm still working out how best to track requests and usage for the individual subdomains but since I'm publishing out PWAs which will mostly work from a client cache I may skip this part as it's the main API that will be hit most often to update stuff in the database.

    HTH

    Stephen

  3. 1

    Hey Greg. I would recommend AWS. You can deploy unlimited static websites on S3, and you can fully automate the deployment process.

    1. 1

      Thanks...but is there a way to configure domains and folders/directories for 1000s of sites via their API?

      It seemed a manual process to me with my research.

      1. 1

        Yes. You can configure just about anything for S3 via the API. You can also dynamically subdomain the static website buckets with Route 53. You can do this from the command line, via the SDKs, or with templates (CloudFormation or Cloud Development Kit). Personally, I start all new projects on AWS. There's a learning curve, but its worth it. Most of the latest successful startups are on AWS. You could most likely run free or very cheap until your service takes off.

  4. 1

    hi @gbardwell, just so I know what to propose, can you please clarify the below:

    1. are you comfortable with using git?
    2. as part of your static website strategy, are you needing a dynamic backend?
      Or will you be using some kind of offline app to generate the static files?
    1. 1

      Why git?

      My saas has an html editor built in.
      I want to be able to

      1. create websites (1000s) in the cloud via an API
      2. Deploy HTML files there...from my SaaS app via a API. Site could have any structure.
      3. Have my users point a cname setting to the site and I can tell the cloud hosting of the domain via an API

      Site should be in the cloud and have network caching...like cloudflare.

      1. 1

        Seems like your end goal is to create a static website hosting service or to include this service as part of your saas.

        Honestly, if someone has to invest time to code this whole thing for you, he/she would probably be better off creating their own service - as this on itself is an indie product.

        Good luck on your project though. cheers

        Why git

        git is an important piece in an automated deploy strategy.

        If you would have done some homework on your side, you'll see most of this kind of hosting services include a git-deploy strategy, except for this new one which allow for a zip-download of static files.

        1. 1

          Thanks.
          My use case is not to deploy one app...I have that.
          But host 1000s of static sites.
          Yes as a service...

  5. 1

    Yep, I've got many websites, and have solved these problems. For example, subdomains hitting the same app, with custom content and themes:

    https://oregon.public.law/
    https://texas.public.law/
    etc.

    Those are fully dynamic (Ruby on Rails), pulling from a database (MySQL), hosted on Heroku. I'm working on several new sites, though, which are completely static, serving pages built offline from a JSON file. E.g.:

    https://allowedguns.com/ — I've created the basic site structure. I host it for free on GitHu via the "GitHub Pages" feature. You can see it seems like a dynamic site because it's data driven. But it's actually static.
    https://repocheck.com/#ruby%2Fruby — Another static site hosted with GitHub Pages.

    I've been using "Middleman" to create static sites, and really like it so far. I'm free for dev work at the moment.

    1. 1

      Thanks for your response. But i am not seeing how any of this helps me or solves my problem. Maybe I need more details on how to solve my need.

Trending on Indie Hackers
How I grew a side project to 100k Unique Visitors in 7 days with 0 audience 49 comments Competing with Product Hunt: a month later 33 comments Why do you hate marketing? 29 comments My Top 20 Free Tools That I Use Everyday as an Indie Hacker 17 comments $15k revenues in <4 months as a solopreneur 14 comments Use Your Product 13 comments