Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and deploy openresty with script

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

How to install and deploy openresty with script? I believe that most people have not yet learned this skill, in order to let you learn, to give you a summary of the following content, do not say much, let's move on. Unzip it to / opt and execute the script, which will be installed to / usr/local/openresty

The script is as follows:

#! / bin/bash

# init dirautoDir= "/ usr/local/src"

SourceDir= "/ opt/openresty"

OpenrestyTarGz= "openresty-1.15.8.2.tar.gz"

OpensslTarGz= "openssl-1.0.1l.tar.gz"

ZlibTarGz= "zlib-1.2.8.tar.gz"

PcreTarGz= "pcre-8.31.tar.gz"

Mkdir-p / usr/local/src/ {zlib,pcre,openssl,openresty}

# openresty

Cd / usr/local/

If [[- d openresty]]; then

Echo "WARN: openresty is already installed, exit."

# return

Exit

Fi

# install Dependent package

# yum install-y gcc gcc-c++ pcre zlib openssl

# untar

Cd ${sourceDir}

Tar zxvf ${openrestyTarGz}-C / usr/local/src/openresty-- strip-component=1

Tar zxvf ${opensslTarGz}-C / usr/local/src/openssl-- strip-component=1

Tar zxvf ${zlibTarGz}-C / usr/local/src/zlib-- strip-component=1

Tar zxvf ${pcreTarGz}-C / usr/local/src/pcre-- strip-component=1

Chmod-R 777 ${autoDir}

# install openresty

Cd ${autoDir} / openresty./configure-- prefix=/usr/local/openresty-- with-http_stub_status_module-- with-stream-- with-stream_ssl_module-- with-pcre=/usr/local/src/pcre-- with-openssl=/usr/local/src/openssl-- with-zlib=/usr/local/src/zlibmake & & make installif [[$? = 0]] Then cp-fv $sourceDir/openresty.service / usr/lib/systemd/system & & systemctl daemon-reload echo "OK: openresty is installed, exit." Else echo "ERROR: openresty is NOT installed, exit." fi after reading the above, have you mastered the method of installing and deploying openresty with scripts? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report