Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nasa114/6204fa9f6d3b350c9985a6712c40cbf5 to your computer and use it in GitHub Desktop.
Save nasa114/6204fa9f6d3b350c9985a6712c40cbf5 to your computer and use it in GitHub Desktop.
nginx with OpenSSL 1.0.2 (ALPN) on Amazon Linux(2016.03)
yum -y install epel-release
yum -y groupinstall 'Development Tools'
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel
OPENSSL="openssl-1.0.2i"
NGINX="nginx-1.11.4-1"
mkdir -p /opt/lib
wget https://www.openssl.org/source/$OPENSSL.tar.gz -O /opt/lib/$OPENSSL.tar.gz
tar -zxvf /opt/lib/$OPENSSL.tar.gz -C /opt/lib
rpm -ivh http://nginx.org/packages/mainline/centos/6/SRPMS/$NGINX.el6.ngx.src.rpm
sed -i "s|--with-http_ssl_module|--with-http_ssl_module --with-openssl=/opt/lib/$OPENSSL|g" /usr/src/rpm/SPECS/nginx.spec
rpmbuild -ba /usr/src/rpm/SPECS/nginx.spec
rpm -Uvh /usr/src/rpm/RPMS/x86_64/$NGINX.amzn1.ngx.x86_64.rpm
@nasa114
Copy link
Author

nasa114 commented Sep 15, 2016

Attention

[en-us]

You use this gist, please write of final row 'exclude=nginx*' on '[amzn-main]' and '[amzn-updates]'. (repository file, location: /etc/yum.repos.d/amzn-(main|updates).repo )Because of not write it, update nginx by Amazon Linux default repository.

[ja]

このgistを使うときには、'[amzn-main]'と'[amzn-updates]'レポジトリの最終行に'exclude=nginx*'を記述してください。(場所は /etc/yum.repos.d以下にレポジトリと同じ名前の.repoファイルが入っています)デフォルトで入っているリポジトリでnginxのアップデートがされてしまうためです。以下に例を示します。

for example)

[amzn-updates]
...
exclude=nginx*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment