当前位置:网站首页>OpenResty 基础
OpenResty 基础
2022-06-23 15:08:00 【chinusyan】
安装前的准备
您必须将这些库 perl 5.6.1+, libpcre, libssl安装在您的电脑之中。 对于 Linux来说,
yum install pcre-devel openssl-devel gcc curl postgresql-devel
构建 OpenResty
从下载页 Download下载最新的 OpenResty 源码包,并且像下面的示例一样将其解压:
wget https://openresty.org/download/openresty-1.21.4.1.tar.gz
tar -xvzf openresty-1.21.4.1.tar.gz
./configure
然后在进入 openresty-1.21.4.1/ 目录, 然后输入以下命令配置:
./configure --prefix=/usr/local/openresty \
--with-luajit \
--without-http_redis2_module \
--with-http_iconv_module \
--with-http_postgres_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-luajit \
--with-http_ssl_module
默认, --prefix=/usr/local/openresty 程序会被安装到/usr/local/openresty目录。
试着使用 ./configure --help 查看更多的选项。
make
您可以使用下面的命令来编译:
make
如果您的电脑支持多核 make 工作的特性, 您可以这样编译:
make -j2 #假设您是的机器是双核。
make install
如果前面的步骤都没有问题的话,您可以使用下面的命令安装 OpenResty 到您的系统中:
make install
ssl 证书
https://cloud.tencent.com/document/product/400/35244
nginx 配置
server {
listen 443 ssl;
#配置HTTPS的默认访问端口为443。
#如果未在此处配置HTTPS的默认访问端口,可能会造成Nginx无法启动。
#如果您使用Nginx 1.15.0及以上版本,请使用listen 443 ssl代替listen 443和ssl on。
server_name yourdomain.com; #需要将yourdomain.com替换成证书绑定的域名。
root html;
index index.html index.htm;
ssl_certificate cert/cert-file-name.pem; #需要将cert-file-name.pem替换成已上传的证书文件的名称。
ssl_certificate_key cert/cert-file-name.key; #需要将cert-file-name.key替换成已上传的证书私钥文件的名称。
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
#表示使用的加密套件的类型。
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; #表示使用的TLS协议的类型。
ssl_prefer_server_ciphers on;
location / {
root html; #站点目录。
index index.html index.htm;
}
}
边栏推荐
- 直播间源码在开发前期必须做的工作及开发步骤
- 重卡界销售和服务的“扛把子”,临沂广顺深耕产品全生命周期服务
- MySQL日志管理怎么配置
- Mysql双主配置的详细步骤
- SFOD:无源域适配升级优化,让检测模型更容易适应新数据(附论文下载)
- [cloud based co creation] how manufacturing enterprises build "barcode factories"
- Usestate vs useref and usereducer: similarities, differences and use cases
- RF analyzer demo setup
- Six programming insights in these five years!
- How is it safe to open an account for futures? Which futures company has a relatively low handling fee for futures and is suitable for retail investors to open an account?
猜你喜欢

5 minutes to quickly launch web applications and APIs (vercel)

FPN特征金字塔网络

js遍历数组(用forEach()方法)

Important knowledge of golang: detailed explanation of context

golang 重要知识:RWMutex 读写锁分析

Six programming insights in these five years!

Embedded software architecture design - program layering

Important knowledge of golang: rwmutex read / write lock analysis

进销存软件排行榜前十名!

SQL注入漏洞(原理篇)
随机推荐
地平线开发板 调试
Large area and availability area
他山之石 | 微信搜一搜中的智能问答技术
Error creating bean with name xxx Factory method ‘sqlSessionFactory‘ threw exception; nested excepti
C. Product 1 Modulo N-Codeforces Round #716 (Div. 2)
VIM backup history command
Detailed steps for MySQL dual master configuration
Important knowledge of golang: rwmutex read / write lock analysis
《墨者学院——SQL手工注入漏洞测试(MySQL数据库)》
Important knowledge of golang: atomic atomic operation
MySQL series: overview of the overall architecture
golang 重要知识:定时器 timer
xcbdfbs xcvb
【无标题】激光焊接在医疗中的应用
C. Phoenix and Towers-Codeforces Global Round 14
System design and analysis - Technical Report - a solution for regularly clearing verification code
Force deduction solution summary 513- find the value of the lower left corner of the tree
golang 重要知识:sync.Cond 机制
F5《2022年应用策略现状报告》:边缘部署及负载安全成亚太地区关注焦点
Tencent ECS failed to send email