Jekyll on VPS for 30 rubles for wealthy people

Jekyll on VPS for 30 rubles for wealthy people
Static HTML is almost a thing of the past. Sites are now database-bound applications that dynamically respond to user queries. However, this also has its drawbacks: higher requirements for computing resources and numerous vulnerabilities in the CMS. Today we will talk about how to raise your simple blog on Jekyll - a generator of static sites, the content of which is taken straight from GitHub.

Step 1. Hosting: we take the cheapest on the market

For static sites, inexpensive shared hosting is enough. In this case, the content will be generated on the side: on the local machine or directly using hosting GitHub Pagesif the user needs a version control system. The latter, by the way, launches the same Jekyll to create pages, but the possibilities for manually configuring the program are very limited. VPS is much more interesting than shared hosting, but it costs a little more. 

Today we at RUVDS are reopening tariff "PROMO" for 30 rubles, which allows you to rent a virtual machine on Debian, Ubuntu or CentOS. The tariff has restrictions, but for ridiculous money you get one core, 512 MB of RAM, 10 GB SSD, 1 IP and the ability to run any application. 

Let's get on it and deploy our Jekyll blog.

Jekyll on VPS for 30 rubles for wealthy people

After starting the VPS, you need to go to it via SSH and configure the necessary software: web server, FTP server, mail server, etc. In this case, the user does not have to install Jekyll on his own computer or endure the restrictions of GitHub Pages hosting, although the site sources can be kept in a GitHub repository.

Step 2Install Jekyll

In short, Jekyll is a simple static site generator that was originally designed to create blogs and then host them on GitHub Pages. The idea is to separate the content and design it using Liquid templating systems: a directory with text files in Markdown or Textile format is processed by the Liquid converter and renderer, and the output is a set of linked HTML pages. You can place them on any server, this does not require CMS or access to a DBMS - everything is simple and safe.

Since Jekyll is a Ruby package (gem), install its easy. To do this, Ruby version 2.5.0 or higher must be installed on the system, rubygems, GCC and Make:

gem install bundler jekyll # 

Use sudo if necessary.

As you can see, everything is very simple.

Step 3. Create a blog

To create a new site in the ./mysite subdirectory, run the following command:

jekyll new mysite

Let's go to it and see the contents

cd mysite
ls -l

Jekyll on VPS for 30 rubles for wealthy people

Jekyll has its own server, which can be started with the following command:

bundle exec jekyll serve

It listens for content changes and listens on port 4000 on localhost (http://localhost:4000/) - this option can be useful if Jekyll is deployed on a local machine. 

Jekyll on VPS for 30 rubles for wealthy people

In our case, it is worth generating a site and setting up a web server to view it (or upload files to a third-party hosting):

jekyll build

The generated files are located in the _site subdirectory of the mysite directory.

Jekyll on VPS for 30 rubles for wealthy people

We have not told about all the intricacies of Jekyll. With its syntax highlighting code layout capabilities, this content generator is most suitable for creating developer blogs, but it can be used to create a wide variety of static sites based on templates available on the web. There are plugins for Jekyll that allow you to change the HTML generation process itself. If you need version control, content files can be placed in a repository on GitHub (then you will have to install Git on the VPS).

Most importantly, the user does not need expensive tariffs for this. Everything will work even on the same 30-ruble VPS.

Jekyll on VPS for 30 rubles for wealthy people

Jekyll on VPS for 30 rubles for wealthy people

Source: habr.com

Add a comment