How do you host a simple static site?

In addition to a couple of wordpress sites, I have a static HTML site that’s just a few pages. What’s the best way to implement this?

You upload all your files with FTP in the public_html directory.

The only public_html directories I see are inside the applications directories.
This way of setting up a web server is foreign to me and doesn’t make a whole lot of sense.
Is there a way to create a public_html folder that the server will recognize, at the root level?

I figured out a solution that’s not too ridiculous. I just created a new application (custom php) and turned everything off, including varnish, so it won’t use resources.

It’s now just a grab bag for whatever static content I want to throw in.

If anyone knows of a more elegant solution, I’m listening.

3 Likes

I’m not sure what is bothering you so much, yes the “public_html” folder is where you place your static content. It’s very common for this to reside in another folder, where you, for example, have private_html folder etc. Every hosting environment is a little different, no need to get frustrated about it. Cloudways really isn’t that different from other hosts.

Best way is to create a custom PHP stack and then delete the default index.php file in the public_html folder. And, then upload all of your html files

4 Likes

Hi @paul.raphaelson

This is the power of Cloudways that you can launch as many applications you want, regardless it is a WordPress, Magento or a custom PHP app.

To upload your static files, you need to create a custom PHP app (that you already did) and upload the files and delete the default index.php file.

Thanks @nicksanderos for an exact workaround.

The custom PHP stack solution has worked, but I’ve had a few problems, including domains not resolving and difficulty creating Let’s Encrypt certificates.

Tech support fixed it, but I don’t understand their explanation:
“Can you please check now, we have set the (application name) application as the default application. Currently, it is showing the default php stack application.”

I don’t see any options on setting a default application. When I created the app, I chose “Custom PHP”, deleted the index file, and put my files into public_html.

What else is there to do?

Click your server > Settings & Packages > Advanced

Scroll down to find “Default application”.

Issues with the domain sounds more like directing the domain to the server in question, then set Domain Management / Primary Domain. If that’s not set up properly you can’s use Let’s Encrypt: they must match.

This is pretty common on Linux boxes. Having it at the root level would make it impossible to put application-specific logs etc under the same root folder, and you want logs to track down problems with complex services. You also want application-specific backups etc. It’s a good thing.

Hi there Readers, today it is very easy to host static sites on cloudways in 2021. just have to create a custom PHP application, and follow some easy steps, read more