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:
- Large selection of fares
- Connection within 24 hours from the moment of receipt of payment
- Connection to the host network 1000 mbps full-duplex, 1 IP address
- Shared Internet connection 100 mbps without limits
- Guaranteed allocation of resources (processor, memory, disk) without overselling
- Installation and configuration of the operating system
- All administrator privileges (root access)
- Ability to install your own operating system kernel
- Xen based paravirtualization and Xen and KVM based hardware virtualization
- Pre-installed software (presets)
- Service Level Agreement (SLA) with compensation
- Guaranteed availability of services over 99.5%
- Replacing faulty equipment within 1 hour
- Storage Area Network (SAN)
- Mirrored RAID1 Duplication
Hosting purchase
It consists of simple steps:
- Choose tariff www.truevds.ru/price
- Pay (there are a lot of ways, we transferred via Sberbank, 4 days)
- After the payment you will receive a letter with the specification of the distribution kit and the preset - select and wait a couple of hours :)
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- Download the latest version
- Unpack and install
- 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/64295Config to run nginx
gist.github.com/174518Installing 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
redmineCreate 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 nginx5.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 :)