Centos 7 安装 Tengine (开启HTTP2)

安全配置


# 修改 ssh 远程端口号
vim /etc/ssh/ssh_config

# 修改 Port

Port 22  #确认配置好防火墙后删除
Port xxxxx



# 关闭防火墙
firewall-cmd --state                 #查看 Firewall 状态
systemctl stop firewalld.service     #停止 Firewall
systemctl disable firewalld.service  #禁止firewall开机启动
firewall-cmd --state                 #查看 Firewall 状态

# 安装开启 IPTables
#先检查是否安装了iptables
service iptables status
#安装iptables
yum install -y iptables
#升级iptables
yum update iptables 
#安装iptables-services
yum install iptables-services

vim /etc/sysconfig/iptables

关闭 SELiunx
/usr/sbin/sestatus -v
# SELinux status:                 disabled 已经关闭

vi /etc/selinux/config
#将SELINUX=enforcing改为SELINUX=disabled 
# 重启生效

 

yum -y install openssl openssl-devel make zlib zlib-devel gcc gcc-c++ libtool    pcre pcre-devel

解决依赖项

yum install gcc-c++  
yum -y install pcre pcre-devel  
yum -y install zlib zlib-devel  
yum -y install openssl openssl-devyum -y install pcre-deve

修改 Tengine SSL 路径配置

cd tengine-x.x.x

vim auto/lib/openssl/conf

#在大概32行配置原来配置如下:
CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"


#修改成如下,保存退出
CORE_INCS="$CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"

 

安装完依赖后下面就可以放心开始安装nginx了,输入安装命令并指定安装路径:

./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_v2_module
make && make install

完成

posted @ 2021-06-30 16:02  游子善心  阅读(20)  评论(0编辑  收藏  举报  来源