Deploying a rails project using Apache + passenger

Source: Internet
Author: User

1. install Apache

Sudo apt-Get install apache2 apache2-mpm-prefork apache2-prefork-dev

2. Install passenger

Gem install passenger

3. Install the bridge module

Passenger-install-apache2-module

 

Or, if you are using nginx, then:

Passenger-install-nginx-Module

 

4. RunningPassenger-install-apache2-moduleCode similar to the following will appear during the command, so that you can put it at the end of the apaceh2.conf file.

LoadModule passenger_module /home/justqyx/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.13/ext/apache2/mode_passenger.soPassengerRoot /home/justqyx/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.13PassengerRuby /home/justqyx/.rvm/wrappers/ruby-1.9.2-p290/ruby

Check whether there are any of the following configurations. If not, add

Include sites-available/ServerName 127.0.0.1

 

Note: errors may occur in this step. Install additional things as prompted by the terminal.


 

5. configuration file apache2

 

Add the CL file in the ETC/apach2/sites-available Directory and

Listen 4100.
<Virtualhost *: 4100>
Servername localhost
DocumentRoot/home/Aaron/code/CL/Public
Railsenv Production
<Directory/home/Aaron/code/CL/Public>
AllowOverride all
Options-Multiviews
</Directory>
</Virtualhost>

Force reload the server configuration file
 

Sudo/etc/init. d/apache2 force-Reload

 

Or sudo/etc/init. d/apache2 reload

 

Restart the server

Sudo/etc/init. d/apache2 restart

 

Note: Terminate the server: sudo/etc/init. d/apache2/stop

Start server: sudo/etc/init. d/apache2/start

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.