- NGINX Cookbook
- Tim Butler
- 215字
- 2021-07-03 00:04:29
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.
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
- C語言程序設(shè)計實踐教程(第2版)
- Hands-On Data Structures and Algorithms with JavaScript
- Learning Data Mining with Python
- Django:Web Development with Python
- Android 7編程入門經(jīng)典:使用Android Studio 2(第4版)
- 大學(xué)計算機基礎(chǔ)(第2版)(微課版)
- Serverless架構(gòu)
- Node.js全程實例
- Java EE核心技術(shù)與應(yīng)用
- Windows Embedded CE 6.0程序設(shè)計實戰(zhàn)
- Node.js 12實戰(zhàn)
- Scratch·愛編程的藝術(shù)家
- uni-app跨平臺開發(fā)與應(yīng)用從入門到實踐
- JQuery風(fēng)暴:完美用戶體驗
- 官方 Scratch 3.0 編程趣味卡:讓孩子們愛上編程(全彩)