Installing or upgrading on Debian or Ubuntu

本文提供了一步式指南,说明如何在Debian和Ubuntu服务器上安装Phusion Passenger,包括添加官方APT仓库、安装所需软件包、编辑配置文件以及重启服务等步骤。

We provide an official Phusion Passenger APT repository. This APT repository contains Phusion Passenger packages for multiple versions of Debian and Ubuntu. These packages are automatically built by our build server after we push out a source release, and thus are always up to date with the official source releases.

If you use these packages to install Phusion Passenger then you do not need to run passenger-install-apache2-module or passenger-install-nginx-module. These packages contain all the binaries that you need.

Packages are available for the x86 and x86_64 architectures. Our policy is to support all Ubuntu LTS releases that are still supported by Canonical, plus the latest Ubuntu release, plus all Debian releases that are still supported by Debian.

2.3.1. Adding our APT repository
  1. Install our PGP key. Packages are signed by "Phusion Automated Software Signing (auto-software-signing@phusion.nl)", fingerprint 1637 8A33 A6EF 1676 2922 526E 561F 9B9C AC40 B2F7.

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
  2. Add HTTPS support for APT. Our APT repository is stored on an HTTPS server.

    sudo apt-get install apt-transport-https ca-certificates
  3. Create a file /etc/apt/sources.list.d/passenger.list and insert one of the following lines, depending on your distribution.

    Open source
    ##### !!!! Only add ONE of these lines, not all of them !!!! #####
    # Ubuntu 14.04
    deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main
    # Ubuntu 12.04
    deb https://oss-binaries.phusionpassenger.com/apt/passenger precise main
    # Ubuntu 10.04
    deb https://oss-binaries.phusionpassenger.com/apt/passenger lucid main
    # Debian 7
    deb https://oss-binaries.phusionpassenger.com/apt/passenger wheezy main
    # Debian 6
    deb https://oss-binaries.phusionpassenger.com/apt/passenger squeeze main
    Enterprise
    ##### !!!! Only add ONE of these lines, not all of them !!!! #####
    # Ubuntu 14.04
    deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt trusty main
    # Ubuntu 12.04
    deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt precise main
    # Ubuntu 10.04
    deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt lucid main
    # Debian 7
    deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt wheezy main
    # Debian 6
    deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt squeeze main

    You can find the correct value for YOUR_DOWNLOAD_TOKEN in the Customer Area.

  4. Secure passenger.list and update your APT cache:

    sudo chown root: /etc/apt/sources.list.d/passenger.list
    sudo chmod 600 /etc/apt/sources.list.d/passenger.list
    sudo apt-get update
2.3.2. Installing packages
Note You should install nginx-extras even if you have already installed an Nginx package from the official Debian/Ubuntu repository. This is because the Nginx binary that our packages supply is compiled with the Passenger module.
Open source
  1. Add our APT repository.

  2. Install the packages:

    sudo apt-get install nginx-extras passenger
  3. Edit /etc/nginx/nginx.conf and uncomment passenger_root and passenger_ruby.

    Especially passenger_root is important: Phusion Passenger won’t work without it! If you don’t see a commented version of passenger_root inside nginx.conf, then you need to insert it yourself.

  4. Restart Nginx:

    sudo service nginx restart
Enterprise
  1. Download your license key from the Customer Area and save it as /etc/passenger-enterprise-license.

  2. Add our APT repository.

  3. Install the packages:

    sudo apt-get install nginx-extras passenger-enterprise
  4. Edit /etc/nginx/nginx.conf and uncomment passenger_root and passenger_ruby.

    Especially passenger_root is important: Phusion Passenger won’t work without it! If you don’t see a commented version of passenger_root inside nginx.conf, then you need to insert it yourself.

  5. Restart Nginx:

    sudo service nginx restart
2.3.3. Inserting passenger_root into nginx.conf

During step 3 of the Installing packages subsection, you were instructed to uncomment the passenger_rootdirective in /etc/nginx/nginx.conf. If there is no commented version in there, then you need to insert it yourself.

First, run the following command and take note of its output:

/usr/bin/passenger-config --root

Next, insert the following snippet into /etc/nginx/nginx.conf, under the http block:

passenger_root whatever_value_you_got_from_previous_command;

Here is an example:

...
http {
   # path-to-locations.ini is given to you by `passenger-config --root`.
   passenger_root /path-to-locations.ini;
   ...
}

Once you’re done editing nginx.conf, continue with step 4.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值