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 perform openresty installation and deployment scripts

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article shows you how to do the openresty installation and deployment script, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.

Openresty is often deployed to do a sh at work.

Unzip it to / opt and execute the script, which will be installed to / usr/local/openresty

The script is as follows:

#! / bin/bash

# init dir

AutoDir= "/ 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." fi4. The source package below is how to implement the openresty installation and deployment script. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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