Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

2014/02/08

Ultimate hosting solution for static websites


How often do you create simple web pages? No PHP, or anything, just pure HTML+CSS. How ofter do you update them? Do you use version control system for this purpose just like for other dev projects? How about hosting your project directly from the source code repository? Wouldn't that be perfect?

In the previous post I described how to use lftp to effectively update website on FTP server with the trick of reverse mirror mode. But if you are using GIT for versioning your HTML (which I strongly recommend even if there are no other people working on the project), you are also quite likely using GitHub for keeping your source code. Do you know that you can host your website directly from GitHub infrastructure? For free.

Of course it is possible to use custom domain name. In order to fully utilize GitHub's global Content Delivery Network it is advised to use CNAME record with for example www subdomain prefix to canonicalize domain name. Be sure to choose domain registrar which will allow you to configure HTTP 301 redirection for the main domain.

2013/12/22

FTP synchronization. How to update your sites via FTP?

Upload your site via FTP. This is usual offer bundled with web hosting solutions. Nowadays it is mostly SFTP, for secure communication.

There are various sophisticated FTP synchronization solutions. But you can also use simple LFTP script to achieve the same. The lftp command is available in most of the Linux distributions.

Here is example script I put in some of the projects which are deployed as pure static HTML/CSS:

lftp -u username -e "set ssl:verify-certificate no; mirror --reverse --delete --only-newer -v site_source_dir /; exit" ftp.somewebhosting.org

It works like a charm thanks to this reverse mirror approach.

But there are better ways of pushing changes to your static sites. If your are interested, watch out the next post which should appear soon.