📜 ⬆️ ⬇️

Elasticweb is the most democratic shared hosting



Hello, Habr! Probably, I apologize right away for my absence and for such a long break in the publication of my digests. Life has radically changed, but I eagerly re-read all the tapes and will soon continue my public gathering of interesting and useful things for web developers.

And now I want to tell you about our creation with our colleagues. Elasticweb is the most democratic shared hosting. Probably sounded too ambitious, but after getting acquainted with the tariff plans of dozens of hosters, we just have to think so. In Elasticweb there is no minimum and maximum cost, we used the cloud approach to the shared hosting service and do not limit you by the number of domains, subdomains or databases. Clients only pay for server hardware resources used.
')

Billing




Monthly maintenance of the n-th number of sites with a total attendance of 1000 people per day can cost ~ 30 rubles per month or less. Orient on the cost of the content of your projects will help our calculator .


Hosting


PHP version 5.6 with Opcache. By default, Git, Composer, Drush, wpcli, antivirus and firewall are installed on each server. And the most piquant is that Nginx is used as a web server. Of course, there are both pluses and minuses in this, but in order not to create another holivar on “Apache vs Nginx”, I will not focus on the factors of this choice. For obvious reasons, .htaccess files will not work, so we wrote and automated the choice of configurations for the most common CMS and frameworks: Wordpress 4, Drupal 7-8, Yii, Joomla 2-3, Octobercms, OpenCart 1.5, ZenCart 1.5, CMS Made Simple , KodiCMS, MaxSite CMS, MODx Revolution, Zend Framework, Symfony, Laravel, Codeigniter, Kohana, phpBB3, MediaWiki, Asgard CMS. We are also working on creating a full-fledged Nginx configuration editor with interactive hints and auto-completion. And at the moment we are ready absolutely for free to help everyone in transferring an existing project to Elasticweb.

Statistics Server


All of our servers run on Debian. The statistics daemon, with the frequency required for the resource, polls each user process and generates a report that is sent to the statistics server. Such a daemon is on every server. After that, the data is grouped by servers and accounts and presented in the form of graphs in the control panel. To ensure no delays, we implemented scheduled exports in a separate stream.

We monitor all system processes, whether it is web server activity, command line activity, or interpreter operation. Doctrine of statistics system - any interaction with the server should be taken into account (CPU%, RAM Memory usage, IO operations, Disk usage, Web bandwidth, MySQL bandwidth). In other words, even an open SSH session is taken into account.

The daemon is written in Python using the libraries daemon, psutil, pwd, os, time, requests, json, datetime, MySQLdb, threading, re, platform, and the third-party module nginx-module-vts is used to analyze traffic.

Control Panel


Instead of CPanel and ISPmanager, it was decided to invent their own bike. First: the adaptation of existing products under the “elastic” seemed to us a very voluminous task, which would require a lot of crutches. Secondly: we still have plenty of ideas and it is much easier to implement them on our own platform.

The main goal in the design and development of the server manager was to provide fault tolerance. We have implemented a queuing system with priorities and logical sequence of tasks. All commands are executed only after the verification of the security keys and are sharpened strictly on interaction with the server control panel. In case of failure of any operation administrators receive an informative message about the problem.

We wrote a demon in Python to listen to the commands that are transmitted from the control panel in JSON format. The panel itself is written in PHP. It was important for us to get the initial architecture and the minimum set of basic functions, so we abandoned large frameworks like Symfony or Zend and based on Codeigniter 3 + HMVC (for creating modules).

Initially, the project was supposed to appear in Russian and English. We rewrote the CodeIgniter default functions for working with URIs so that they can take language into account. Speaking of localization itself, we did not like the way to store translations in files and access them as keys. Therefore, we use English as the base language in the code and drive it into a function, which, in turn, connects to the database and searches for the necessary translation for this string, taking into account the language selected on the site.

The control panel implies a lot of forms, their code and processing took up too much space in the controllers. Plus, some forms need to be displayed several times. Therefore, we wrote Formbuilder for CodeIgnitor and put it on GitHub , assuming that this tool would be useful for someone. In general, our team is very altruistic about the OpenSource movement and we plan to keep this practice.

Payment system


In the development of billing, we went from bills / invoices and monthly payments. By analogy with cellular subscribers, Elasticweb customers have a personal balance, from which they pay for services. The balance may be negative for 7 days, after which the sites will be blocked, and deleted in a month. In the future, it is planned to develop a system of credibility to users. And now we have a referral program for our partners, the conditions of which can be found here .

Apotheosis


The first thought about Elasticweb came quite by accident in a normal conversation about hardware, servers, cloud technologies and hosting. The development lasted for almost 3 months in free time from the main work. Another month we spent on testing the product and now the time has come to one of the most important and significant tests for us - to go through the opinion of habravchan.



Thank you all for your attention. We look forward to hearing from you critics, questions and suggestions.

Source: https://habr.com/ru/post/268003/


All Articles