πŸ“œ ⬆️ ⬇️

Choosing VDS Hosting for a Ruby on rails project

Task

From the experience of other rails, it is known that for hosting rails projects you need VDS hosting.
Knowledgeable people suggest that from openVZ and Xen , Xen is better.

Task conditions: find an inexpensive VDS hosting version of Xen.

After a brief search, choose http://www.truevds.ru/
')
Pros:

Hosting purchase

It consists of simple steps:

Domain Registration

Since truevds deal only with VDS, you need to register a domain yourself. We calculated the cost of registration on www.nic.ru : 620 rubles in the org + 600 zone Primary-Standard dns + 150 Secondary dns = 1370 rubles / year just for registering a domain. At Sweb, when purchasing hosting for a year, starting with the SX-2 tariff, the domain is given as a gift, plus a comfortable admin panel.

Result

VDS we have a tru :) Even Tru-12. It runs process.novgorodwebdev.org .
And novgorodwebdev.org is Svebovsky sx-2.
Total: 180 * 12 + 1440 = 3600 per year.

NB: found a sane registrar r01.ru/domain/pay (by the way, sweb is registered with them). .org for 440 per year, primary and secondary dns free

Software installation

You can take a preset of Ruby on Rails production, but for the freshness of the software it is better to install everything yourself.
We took debian .
Ruby we need is not simple, and Enterprise Edition
  1. Download the latest version
  2. Unpack and install
  3. Configure Ruby EE as a default ruby ​​in / etc / environmen:

PATH = "/ opt / ruby-enterprise-xxx / bin: / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / usr / games"
Could be so:
sudo ln -s / opt / ruby-enterprise / bin / ruby ​​/ usr / bin / ruby
sudo ln -s / opt / ruby-enterprise / bin / gem / usr / bin / gem
sudo ln -s / opt / ruby-enterprise / bin / rake / usr / bin / rake

Install and configure nginx
Ruby EE itself installs nginx and passender for it.
Help Habr habrahabr.ru/blogs/ror/64295
Config to run nginx gist.github.com/174518
Installing postresql
sudo aptitude install postgresql-server postgresql-server-dev

NB: postgresql-server-dev is needed to build gem postgres

For example, you need to create a base for redmine
Create user and database under redmine (username and redmine database)
1. sudo su postgres
2. #createuser redmine --no-superuser --no-createdb --no-createrole --login --pwprompt --encrypted
3. #createdb --owner = redmine --encoding = utf-8 redmine
4. #exit

Configuring , struggling with a long load of the application

Long loading rails nginx
5.8. Resource control and optimization options

5.8.3. passenger_pool_idle_time - here specify the time of unloading when idle (0 - do not unload)


Comments, additions are welcome :)

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


All Articles