sh在ubuntu14.04上从源代码安装nginx,openssl和ngx_pagespeed(代码片段)

author author     2022-12-20     286

关键词:

#!/bin/sh

##############################################################################################
## Install Nginx with OpenSSL and ngx_pagespeed
## Author: Andrew Maxwell <amaxwell@traffixdevices.com>
## Date: 2016/05/27
## Version: 0.1
##
## Disclaimer: I am not responsible for how you use this script. Do not assume this script
##  will work in all envrionments or any Ubuntu version other than 14.04. This script assumes
##  you have had a version of nginx already installed from Ubuntu PPAs and that it has been
##  removed via `sudo apt-get remove nginx nginx-common`
##
## ngx_pagespeed code adapted from:
## https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source
## openssl code adapted from:
## https://www.digitalocean.com/community/questions/how-to-get-already-installed-nginx-to-use-openssl-1-0-2-for-alpn#answer_27588
##############################################################################################

# Current version of nginx, openssl, and ngx_pagespeed you want to install
NGINX_VERSION=1.11.0
OPENSSL_VERSION=1.0.2h
NPS_VERSION=1.11.33.2

##############################################################################################
########## STOP EDITING
##############################################################################################

## Currently installed version of openssl
OPENSSL_CURRENT_VERSION=$(openssl version | awk ' print $2 ')
## Nginx ./configure flags
# Automagically grab current Nginx flags
#NGINX_USER_FLAGS="$(nginx -V  2>&1 | tail -1| tr ' ' '\n' | tail -n +3)"
# Or use default Nginx flags
NGINX_USER_FLAGS="--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_v2_module"
OPENSSL_FLAGS="--with-openssl=$HOME/openssl-$OPENSSL_VERSION"
NPS_FLAGS="--add-module=$HOME/ngx_pagespeed-release-$NPS_VERSION-beta"
NGINX_FLAGS="$NGINX_USER_FLAGS $OPENSSL_FLAGS $NPS_FLAGS"

# Ensure lib and build packages are installed
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev unzip

## Ensure we are in home directory
cd $HOME

## Download sources
# Download nginx
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
# Download openssl
wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
# Download ngx_pagespeed
wget https://github.com/pagespeed/ngx_pagespeed/archive/release-$NPS_VERSION-beta.zip

## Extract sources
# Extract nginx
tar -xvzf nginx-$NGINX_VERSION.tar.gz
# Extract openssl
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
# Extract ngx_pagespeed
unzip release-$NPS_VERSION-beta.zip

## Download and Extract PSOL (PageSpeed Optimization Library)
cd ngx_pagespeed-release-$NPS_VERSION-beta/
wget https://dl.google.com/dl/page-speed/psol/$NPS_VERSION.tar.gz
tar -xzvf $NPS_VERSION.tar.gz # extracts to psol/
cd $HOME

## Install openssl
cd openssl-$OPENSSL_VERSION/
./config
make depend
make
make test
sudo make install
sudo mv /usr/bin/openssl /usr/bin/openssl_$OPENSSL_CURRENT_VERSION
sudo ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
cd $HOME

## Install nginx + ngx_pagespeed
cd nginx-$NGINX_VERSION/
./configure $NGINX_FLAGS
make
sudo make install

echo "Installation Complete!"

sh在ubuntu14.04上安装spark(代码片段)

查看详情

sh在ubuntu14.04上进行rtorrent安装/更新(代码片段)

查看详情

sh在ubuntu14.04上进行rtorrent安装/更新(代码片段)

查看详情

sh另一个docker安装在ubuntu14.04lts上(代码片段)

查看详情

sh在ubuntu14.04上安装maven3.3.3(代码片段)

查看详情

sh使用php7在ubuntu14.04上安装mongodb(代码片段)

查看详情

在 Ubuntu 14.04 上从源代码编译时如何链接到 opencv 3.0?

】在Ubuntu14.04上从源代码编译时如何链接到opencv3.0?【英文标题】:Howtolinktoopencv3.0whencompiledfromsourceonUbuntu14.04?【发布时间】:2014-12-0720:48:35【问题描述】:我正在尝试编译和链接我在网上找到的以下opencv程序:main.cpp:#include<op... 查看详情

sh在ubuntu14.04上安装--boost1-64-with-python3.sh(代码片段)

查看详情

sh在ubuntu14.04上为开发人员计算机安装所有必需的工具(代码片段)

查看详情

sh在ubuntu14.04上使用pyenv安装python2.7.10(代码片段)

查看详情

sh易于安装openresty(在ubuntu14.04,15.10和16.04上使用和测试)(代码片段)

查看详情

sh在osx上从dmg文件安装包(代码片段)

查看详情

sh从源代码为ubuntu14.04安装最新的nginx(代码片段)

查看详情

sh在ubuntu14.04上使用rbenv和ruby-build安装ruby2.2.3(代码片段)

查看详情

sh易于安装openresty和nvm(在ubuntu14.04,15.10和16.04上使用和测试)(代码片段)

查看详情

sh安装docker和dockercompose到ubuntu14.04lts。(代码片段)

查看详情

sh升级/安装ruby2.1.2#ubuntu#12.04#14.04(代码片段)

查看详情

sh升级/安装ruby2.1.2#ubuntu#12.04#14.04(代码片段)

查看详情