-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-openresty.sh
46 lines (31 loc) · 1.34 KB
/
install-openresty.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
#VERSION=1.11.2.3
openresty -v
mode=$1
if [ "$mode" == 'update' ]; then
sudo apt-get update
sudo apt-get install openresty
else
# https://openresty.org/en/linux-packages.html
sudo apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential
# cd /tmp
# wget https://openresty.org/download/openresty-$VERSION.tar.gz
# tar zxvf openresty-$VERSION.tar.gz -C .
# cd openresty-$VERSION
# #./configure
# ./configure -j2 --with-pcre-jit --with-ipv6
# make -j2
# sudo make install
# echo "ADD: export PATH=/usr/local/openresty/bin:/usr/local/openresty/nginx/sbin:$PATH"
# import our GPG key:
wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
# for installing the add-apt-repository command
# (you can remove this package and its dependencies later):
sudo apt-get -y install software-properties-common
# add the our official APT repository:
sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
# to update the APT index:
sudo apt-get update
sudo apt-get install openresty
fi
openresty -v