官术网_书友最值得收藏!

Getting ready

Although there are a number of different application servers for Rails, one of the more popular is Passenger. With the highest performance and great documentation, Passenger's popularity is well deserved. This recipe has been tested with Ruby 2.3, Rails 4.2, and Passenger 5.0.

We can install Passenger via gem:

gem install passenger

To integrate with NGINX, this requires a special module to be enabled. We'll compile NGINX from scratch as per our installation in Chapter 1, Let's Get Started and compile Passenger support as a static module.

Make sure you have the mainline repository from nginx.org installed.

For a Debian- / Ubuntu-based system, you'll need to create the build environment:

apt-get build-dep Nginx
mkdir ~/nginxbuild
cd ~/nginxbuild
apt-get source nginx

Then, in the NGINX source directory, edit the debian/rules file to add:

--add-module=/var/lib/gems/2.3.0/gems/passenger-5.0.27/src/nginx_module \

You can confirm the passenger directory with the following command:

passenger-config --nginx-addon-dir

To make the package name unique, you can edit the changelog and add additional lines to the changelog. Consider this example:

nginx (1.9.14-1-passenger) wily; urgency=low 
 
  * Added Passenger as a dynamic module 

You can now compile the package with the following command:

fakeroot debian/rules binary

This will take a few minutes to complete. Once we have the updated package, we can now install it:

dpkg -i ../nginx_1.9.14-1-passenger_amd64.deb
主站蜘蛛池模板: 望都县| 广丰县| 宿州市| 长宁县| 南川市| 廊坊市| 越西县| 建瓯市| 托克逊县| 绥阳县| 蚌埠市| 明星| 清新县| 东阿县| 申扎县| 彭水| 金秀| 黄陵县| 赤壁市| 巴楚县| 剑川县| 孙吴县| 富宁县| 会东县| 囊谦县| 柳州市| 洪洞县| 旅游| 上犹县| 溧水县| 新泰市| 白沙| 竹山县| 蛟河市| 历史| 西盟| 无棣县| 北京市| 中江县| 安新县| 公安县|