YOU'VE MADE A BRAVE DECISION, WELCOME.

A LITTLE BIT MORE FAST,A LITTLE BIT MORE STRONG。

ubuntu14.04下nginx安装

获取nginx安装包所需要的PGP key

为了能够签名nginx包,使安装过程能够顺利进行,须首先向软件包密钥钟添加nginx签名密钥:

  • 新建一个nginx_signing.key

    1
    2
    cd ~
    touch nginx_signing.key
  • 点击获取签名密钥,
    并将\
    -----BEGIN PGP PUBLIC KEY BLOCK-----\
    -----END PGP PUBLIC KEY BLOCK-----\
    这两行(包括这两行)包裹的部分贴到nginx_signing.key里;

  • 将密钥添加到apt密钥包

    1
    sudo apt-key add nginx_signing.key

更新软件源,将下面两行追加到/etc/apt/source.list(下面两行中的trusty只有在系统为ubuntu14.04时才有效,其他系统版本请参考codename),:

1
2
deb http://nginx.org/packages/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/ubuntu/ trusty nginx

然后

1
2
apt-get update
apt-get install nginx

安装完成后,浏览器访问

1
http://localhost

若出现以下文字,表示安装成功

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.