First, the use of
passenger-install-nginx-module
Installation:
Install Passenger:gem installed passenger first, and if you do not have permission, add sudo to the front.
Because nginx
dynamic module loading is not supported, it is used passenger
to compile and install the passenger
modifiednginx
Installing Nginx with passenger:
passenger-install-nginx-module
按照提示,一步步安装。
In the Nginx configuration file (by default in the/opt/nginx/conf/directory), you can see the following configuration:
At this point, nginx and passenger installation is complete.
Ii. installing ruby and Rails
First install RVM: \curl-ssl Https://get.rvm.io | Bash-s stable, see more: http://rvm.io/
View the installed Rvm:rvm-v
Installing RUBY:RVM install with RVM 2.1.5
2.1.5 is the version number of Ruby and can be selected according to your needs.
This installation will take some time, after successful installation can be viewed: ruby-v
Installing Rails:gem install Rails-v 4.2 with gem
After the installation is complete, rails-v
Ruby on Rails has also been installed successfully.
Three, mina configuration:
Add: Gem ' Mina ' in the project's gemfile, then run bundle install
Then view Mina:mina-v
Run: Mina Init, will be in the Config directory under the product of a deploy.rb file, will be such as:
Here to do the corresponding configuration, after the modification is completed, run: Mina setup, this initializes the server (the corresponding directory is established on the server).
Iv. Deployment
Run deployment command: Mina deploy
Enter the password to deploy it.
In addition, to use a no-password deployment, first use RSA to generate key, the contents of Id_rsa.pub added to the server's. ssh/authorized_keys file at the end. Also generate the same RSA on the service (preferably with a blank password), add its id_rsa.pub content to the corresponding settings of the code management station, such as GitHub, coding, etc.
Nginx+passenger+mina+ruby on Rails Combat deployment