当前位置:网站首页>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;
}
}
边栏推荐
- How strong is Jingdong's takeout after entering meituan and starving the hinterland?
- mysql 系列:总体架构概述
- Top 10 purchase, sales and inventory software rankings!
- glibc nptl库pthread_mutex_lock和pthread_mutex_unlock浅析
- Résumé de la méthode de déduction de la force 513 - trouver la valeur du coin inférieur gauche de l'arbre
- Memory Consistency and Cache Coherence —— 内存一致性
- C. Product 1 Modulo N-Codeforces Round #716 (Div. 2)
- [普通物理] 半波损失 等厚与等倾干涉
- 力扣每日一题-第25天-495.提莫攻击
- 重卡界销售和服务的“扛把子”,临沂广顺深耕产品全生命周期服务
猜你喜欢
随机推荐
变压器只能转换交流电,那直流电怎么转换呢?
Important knowledge of golang: sync Cond mechanism
打印内存站信息
快速排序的简单理解
自监督学习(SSL)Self-Supervised Learning
Thymeleaf——学习笔记
云上探“店”,云商店全新升级!
[cloud based co creation] intelligent supply chain plan: improve the decision-making level of the supply chain and help enterprises reduce costs and increase efficiency
C. Product 1 Modulo N-Codeforces Round #716 (Div. 2)
mysql 系列:存储引擎
任何代码未动的情况下第二天项目访问速度明显下降,案例分析
JS traversal array (using the foreach () method)
股票开账户如何优惠开户?在线开户安全么?
Why is Xiaomi stuck in the chip quagmire?
力扣每日一题-第25天-495.提莫攻击
Important knowledge of golang: rwmutex read / write lock analysis
Print memory station information
嵌入式软件架构设计-程序分层
glibc nptl库pthread_mutex_lock和pthread_mutex_unlock浅析
B. AND 0, Sum Big-Codeforces Round #716 (Div. 2)






