当前位置:网站首页>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;
}
}
边栏推荐
- Horizon development board commissioning
- MQ消息中间件理论详解
- 列表查询排序参数处理
- Variable declaration of go language
- Introduction to the push function in JS
- How can genetic testing help patients fight disease?
- Top 10 purchase, sales and inventory software rankings!
- Nfnet: extension of NF RESNET without BN's 4096 super batch size training | 21 year paper
- Important knowledge of golang: detailed explanation of context
- Large area and availability area
猜你喜欢

JSON——学习笔记(消息转换器等)
Redis缓存三大异常的处理方案梳理总结

FPN特征金字塔网络

Half wave loss equal thickness and equal inclination interference

嵌入式软件架构设计-程序分层
![[opencv450] salt and pepper noise demo](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[opencv450] salt and pepper noise demo

Tencent ECS failed to send email

Important knowledge of golang: waitgroup parsing

Important knowledge of golang: sync Once explanation

Big factory Architect: how to draw a grand business map?
随机推荐
2022年个人理财利率是多少?个人如何选择理财产品?
要买的理财产品年限长,划算吗?
Gartner's latest report: development of low code application development platform in China
打印内存站信息
SQL窗口函数怎么使用
Important knowledge of golang: timer timer
基因检测,如何帮助患者对抗疾病?
Starting from 3, add paging function in the business system
139. 单词拆分
Converging ecology, enabling safe operation, Huawei cloud security, cloud brain intelligent service security
C. Product 1 Modulo N-Codeforces Round #716 (Div. 2)
Important knowledge of golang: atomic atomic operation
Half wave loss equal thickness and equal inclination interference
Big factory Architect: how to draw a grand business map?
SFOD:无源域适配升级优化,让检测模型更容易适应新数据(附论文下载)
Gartner最新报告:低代码应用开发平台在国内的发展
Three simple tips for accelerating yarn install
快速排序的簡單理解
云上探“店”,云商店全新升级!
mysql事务与锁