您当前的位置:首页 > 电脑百科 > 站长技术 > 服务器

nginx1.19.1自动安装部署脚本

时间:2021-03-01 11:30:48  来源:  作者:

请注意阅读git上的README.md

1、本脚本支持离线与在线安装:
脚本自行判断连接:

curl -I -m 10 -o /dev/null -s -w %{http_code}'n' http://www.baidu.com

是否返回200,返回200表示有网络,将使用yum安装相关依赖,否则视为无网络情况,将使用rpm -ivh方式安装所需依赖包(在无网络条件时,请切记上传packages_Nginx、packages_gcc否则脚本将无法自动安装自动安装部署)
2、脚本也可以自行根据需要修改于在线使用wget直接下载相关软件包,这样会更灵活
(1)pcre8.44软件包下载地址如下:https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
(2)zlib1.2.11软件包下载址如下:http://www.zlib.net/fossils/zlib-1.2.11.tar.gz
(3)openssl1.1.1g软件包下载地址如下:https://ftp.openssl.org/source/old/1.1.1/openssl-1.1.1g.tar.gz
(4)nginx1.19.1软件包下载地址如下: http://nginx.org/download/nginx-1.19.1.tar.gz
3、所有gcc依赖包、nginx依赖包下载地址:https://github.com/domdanrtsey/nginx_auto_install/tree/master

nginx1.19.1自动安装部署脚本

 


4、nginx服务已添加自启动,启停采用systemctl管理

停止
# systemctl stop nginx
启动
# systemctl start nginx

5、脚本内容如下,请参阅,执行如有疑问,请反馈给我修改,谢谢支持:

#!/bin/bash
# script_name: nginx_install.sh
# Author: Danrtsey.Shun
# Email:mydefiniteaim@126.com
# auto_install_nginx version=1.19.1
#################### Upload nginx software ####################
#|     version: nginx-1.19.1             |#
#|     version: openssl-1.1.1           |#
#|     version: pcre-8.44                 |#
#|     version: zlib-1.2.11                |#
#|     packages: packages_gcc       |#
#|     packages: packages_nginx    |#
#|     configfile: nginx.conf             |#
#|     script: nginx_install.sh            |#
#
#################### Install nginx software ####################
# attentions:
# 1.上传软件包/依赖包/nginx_install.sh/nginx.conf至服务器任意路径下,如 /opt
#
# 2.执行
# chmod + nginx_install.sh
# sh -x nginx_install.sh


export PATH=$PATH
#Source function library.
. /etc/init.d/functions

#Require root to run this script.
uid=`id | cut -d( -f1 | cut -d= -f2`
if [ $uid -ne 0 ];then
  action "Please run this script as root." /bin/false
  exit 1
fi

###set firewalld & optimize the os system & set selinux
echo "################# Optimize system parameters  ##########################"
firewall_status=`systemctl status firewalld | grep Active |awk '{print $3}'`
if [ ${firewall_status} == "(running)" ];then
  firewall-cmd --permanent --zone=public --add-port=80/tcp && firewall-cmd --reload
else
  systemctl start firewalld
  firewall-cmd --permanent --zone=public --add-port=80/tcp && firewall-cmd --reload
fi

SELINUX=`cat /etc/selinux/config |grep ^SELINUX=|awk -F '=' '{print $2}'`
if [ ${SELINUX} == "enforcing" ];then
  sed -i "s@SELINUX=enforcing@SELINUX=disabled@g" /etc/selinux/config
else
  if [ ${SELINUX} == "permissive" ];then
    sed -i "s@SELINUX=permissive@SELINUX=disabled@g" /etc/selinux/config
  fi
fi
setenforce 0

###set the ip in hosts
echo "############################   Ip&Hosts Configuration  #######################################"
hostname=`hostname`
HostIP=`ip a|grep 'inet '|grep -v '127.0.0.1'|awk '{print $2}'|awk -F '/' '{print $1}'`
for i in ${HostIP}
do
    A=`grep "${i}" /etc/hosts`
    if [ ! -n "${A}" ];then
        echo "${i} ${hostname}" >> /etc/hosts 
    else
        break
    fi
done

###set the sysctl,limits and profile
echo "############################   Configure environment variables #######################################"
D=`grep 'ip_local_port_range' /etc/sysctl.conf`
if [ ! -n "${D}" ];then
cat << EOF >> /etc/sysctl.conf
fs.file-max = 6815744
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 40960
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.ip_local_port_range = 1024 65000
EOF
/sbin/sysctl -p
fi
E=`grep '65535' /etc/security/limits.conf`
if [ ! -n "${E}" ];then
cat << EOF >> /etc/security/limits.conf
* soft nproc 16384
* hard nproc 16384
* soft nofile 65535
* hard nofile 65535
EOF
fi

PRENAME="/usr/local"
OPENSSLPATH=${PRENAME}/openssl
PCREPATH=${PRENAME}/pcre
ZLIBPATH=${PRENAME}/zlib

echo "############################   Create Group&User  #######################################"
ng_user=nginx
ng_group=nginx
groupadd -r ${ng_group} && useradd -s /sbin/nologin -r -g ${ng_group} ${ng_user}

count=0
while [ $count -lt 3 ]
do
        read -p "Please input the NGINXPATH(e.g:/usr/local/nginx):" S1
        read -p "Please input the NGINXPATH again(/usr/local/nginx):" S2
        if [ "${S1}" == "${S2}" ];then
                export NGINXPATH=${S1}
                break
        else    
                echo "You input NGINXPATH not same."
                count=$[${count}+1]
        fi 
done
if [ ! -d ${NGINXPATH} ];then
    mkdir -pv ${NGINXPATH}/{logs,client_body,proxy,fastcgi,uwsgi,scgi}
fi
chown -R ${ng_user}:${ng_group}  ${NGINXPATH}

#------------------------------------------------OFF--VERSION------------------------------------------------------#
openssl_version=`basename openssl-*.tar.gz .tar.gz | awk -F '-' '{print$2}'`
pcre_version=`basename pcre-*.tar.gz .tar.gz | awk -F '-' '{print$2}'`
zlib_version=`basename zlib-*.tar.gz .tar.gz | awk -F '-' '{print$2}'`
nginx_version=`basename nginx-*.tar.gz .tar.gz | awk -F '-' '{print$2}'`
#------------------------------------------------ON---VERSION------------------------------------------------------#
opensslv="1.1.1g"
pcrev="8.44"
zlibv="1.2.11"
nginxv="1.19.1"
#------------------------------------------------SOFTWARE_PATH--------------------------------------------------------#
softwarepath=$(cd `dirname $0`; pwd)
gccoffpath=${softwarepath}/packages_gcc
nginxoffpath=${softwarepath}/packages_nginx

 #------------------------------------------------------GCCSTRAT----------------------------------------------------#
function environment(){
    echo "|------------------------ CHECK GCC--------------------------|"
    GCCBIN=`which gcc`
    GCCV=$(echo $GCCBIN | grep "gcc")
    if [[ "$GCCV" != "" ]]
    then
        echo "gcc was installed "
    else
        echo "install gcc starting"
        httpcode=`curl -I -m 10 -o /dev/null -s -w %{http_code}'n' http://www.baidu.com`
        net1=$(echo $httpcode | grep "200")
        if [[ "$net1" != "" ]];then
          echo "|-----------------------[    成功    ]-----------------------|"
          echo "|-----------------------[准备联网安装]-----------------------|"
          /usr/bin/sleep 2
          yum install gcc gcc-c++ -y >/dev/null 2>&1
          gcc -v >/dev/null 2>&1
          if [[ $? -eq 0 ]]; then
            echo "gcc was on_installed successed"
          else
            echo "gcc was on_installed failed"
          exit 2
          fi
        else
          echo "|-----------------------[    失败    ]-----------------------|"
          echo "|-----------------------[检测不到网络]-----------------------|"
          echo "|-----------------------[准备离线安装]-----------------------|"
          /usr/bin/sleep 2
          gccinstall_off
        fi
    fi
}

function gccinstall_off(){
    echo "|---------------------[正在安装离线包]----------------------|"
    cd ${gccoffpath}
    rpm -ivh *.rpm --nodeps --force
    gcc -v
    if [[ $? -eq 0 ]]; then
        echo "gcc was off_installed successed"
    else
        echo "gcc was off_installed failed"
		exit 3
    fi
}
 #------------------------------------------------------GCCEND----------------------------------------------------#
 #------------------------------------------------------SSLSTRAT----------------------------------------------------#
function Openssl(){
    echo "install openssl starting"
    httpcode=`curl -I -m 10 -o /dev/null -s -w %{http_code}'n' http://www.baidu.com`
    net1=$(echo $httpcode | grep "200")
    if [[ "$net1" != "" ]]
      then
      echo "|-----------------------[    成功    ]-----------------------|"
      echo "|-----------------------[准备联网安装]-----------------------|"
      /usr/bin/sleep 2
      yum install openssl-devel -y >/dev/null 2>&1
    else
      echo "|-----------------------[    失败    ]-----------------------|"
      echo "|-----------------------[检测不到网络]-----------------------|"
      echo "|-----------------------[准备离线安装]-----------------------|"
      /usr/bin/sleep 2
      opensslinstall_off
    fi
}

function opensslinstall_off(){
    echo "|---------------------[正在安装离线包]----------------------|"
    cd ${nginxoffpath}
	rpm -ivh *.rpm --nodeps --force
    cd ${softwarepath}
    ssl=`ls | grep openssl-*.tar.gz`
    if [[ "$ssl" != "" ]];then
      mkdir -p logs && touch logs/{openssl.log,pcre.log,zlib.log,nginx.log}
      tar -zxvf openssl-${openssl_version}.tar.gz >/dev/null 2>&1
	  cd openssl-${openssl_version}
      ./config --prefix=${OPENSSLPATH} >${softwarepath}/logs/openssl.log >/dev/null 2>&1
        if [[ $? -ne 0 ]]; then
          echo "openssl was off_configed failed"
          exit 4
        else
          make && make install >>${softwarepath}/logs/openssl.log >/dev/null 2>&1
          if [[ $? -ne 0 ]]; then
              echo "openssl was off_make_installed failed"
              exit 5
          else
             ln -s ${OPENSSLPATH}/lib/libssl.so.1.1 /usr/local/lib/
             ln -s ${OPENSSLPATH}/lib/libcrypto.so.1.1  /usr/local/lib/
             ln -s /usr/local/lib/libssl.so.1.1  /usr/lib/
             ln -s /usr/local/lib/libcrypto.so.1.1  /usr/lib/
             ln -s /usr/local/lib/libssl.so.1.1  /usr/lib64/
             ln -s /usr/local/lib/libcrypto.so.1.1  /usr/lib64/
             ${OPENSSLPATH}/bin/openssl version
             ldd ${OPENSSLPATH}/bin/openssl
             ldconfig -v
             mv /usr/bin/openssl /usr/bin/openssl.old
             ln -s ${OPENSSLPATH}/bin/openssl /usr/bin/openssl
             openssl_nowv=`openssl version |awk -F' ' '{print $2}'|awk -F'-' '{print $1}'`
             if [ "$openssl_nowv" = "$openssl_version" ];then
			   echo "openssl update successed"
			 else
			   echo "openssl update failed"
			   exit 6
			 fi
          fi
        fi
    else
      echo "please upload the openssl-*.tar.gz"
      exit 7
    fi
}
#---------------------------------------------------SSLEND---------------------------------------------------------#
#--------------------------------------------------PCRESTART-------------------------------------------------------#
function pcre(){
    echo "install pcre starting"
    httpcode=`curl -I -m 10 -o /dev/null -s -w %{http_code}'n' http://www.baidu.com`
    net1=$(echo $httpcode | grep "200")
    if [[ "$net1" != "" ]]
      then
      echo "|-----------------------[    成功    ]-----------------------|"
      echo "|-----------------------[准备联网安装]-----------------------|"
      /usr/bin/sleep 2
      yum install pcre-devel -y >/dev/null 2>&1
    else
      echo "|-----------------------[    失败    ]-----------------------|"
      echo "|-----------------------[检测不到网络]-----------------------|"
      echo "|-----------------------[准备离线安装]-----------------------|"
      /usr/bin/sleep 2
      pcreinstall_off
    fi
}

function pcreinstall_off(){
    echo "|---------------------[正在安装离线包]----------------------|"
    cd ${softwarepath}
    pcr=`ls | grep pcre-*.tar.gz`
    if [[ "$pcr" != "" ]];then
      tar -zxvf pcre-${pcre_version}.tar.gz >/dev/null 2>&1
	  cd pcre-${pcre_version}
      ./configure >${softwarepath}/logs/pcre.log >/dev/null 2>&1
        if [[ $? -ne 0 ]]; then
          echo "pcre was off_configed failed"
          exit 8
        else
          make && make install >>${softwarepath}/logs/pcre.log
          if [[ $? -ne 0 ]]; then
              echo "pcre was off_make_installed failed"
              exit 9
          else
             echo "pcre update successed"
          fi
        fi
    else
      echo "please upload the pcre-*.tar.gz"
      exit 10
    fi
}
#----------------------------------------------------PCREEND-------------------------------------------------------#
#---------------------------------------------------STARTZLIB------------------------------------------------------#
function zlib(){
    echo "install zlib starting"
    httpcode=`curl -I -m 10 -o /dev/null -s -w %{http_code}'n' http://www.baidu.com`
    net1=$(echo $httpcode | grep "200")
    if [[ "$net1" != "" ]]
      then
      echo "|-----------------------[    成功    ]-----------------------|"
      echo "|-----------------------[准备联网安装]-----------------------|"
      /usr/bin/sleep 2
      yum install zlib-devel -y >/dev/null 2>&1
    else
      echo "|-----------------------[    失败    ]-----------------------|"
      echo "|-----------------------[检测不到网络]-----------------------|"
      echo "|-----------------------[准备离线安装]-----------------------|"
      /usr/bin/sleep 2
      zlibinstall_off
    fi
}

function zlibinstall_off(){
    echo "|---------------------[正在安装离线包]----------------------|"
    cd ${softwarepath}
    zli=`ls | grep zlib-*.tar.gz`
    if [[ "$zli" != "" ]];then
      tar -zxvf zlib-${zlib_version}.tar.gz >/dev/null 2>&1
	  cd zlib-${zlib_version}
      ./configure >${softwarepath}/logs/zlib.log >/dev/null 2>&1
        if [[ $? -ne 0 ]]; then
          echo "zlib was off_configed failed"
          exit 11
        else
          make && make install >>${softwarepath}/logs/zlib.log
          if [[ $? -ne 0 ]]; then
              echo "zlib was off_make_installed failed"
              exit 12
          else
             echo "zlib update successed"
          fi
        fi
    else
      echo "please upload the zlib-*.tar.gz"
      exit 13
    fi
}
#----------------------------------------------------ZLIBEND-------------------------------------------------------#
#---------------------------------------------------STRATNGINX-----------------------------------------------------#
function nginx(){
    echo "install nginx dependent packages starting"
    httpcode=`curl -I -m 10 -o /dev/null -s -w %{http_code}'n' http://www.baidu.com`
    net1=$(echo $httpcode | grep "200")
    if [[ "$net1" != "" ]]
      then
      echo "|-----------------------[    成功    ]-----------------------|"
      echo "|-----------------------[准备联网安装]-----------------------|"
      /usr/bin/sleep 2
      yum install automake autoconf libtool make wget net-tools libxslt* libxml2* gd-devel perl-devel perl-ExtUtils-Embed GeoIP 
	  GeoIP-devel GeoIP-data -y >/dev/null 2>&1
      if [[ $? -eq 0 ]];then
        cd ${softwarepath}
        ngin=`ls | grep nginx-*.tar.gz`
        if [[ "$ngin" != "" ]];then
          tar -zxvf nginx-${nginx_version}.tar.gz >/dev/null 2>&1
	      cd nginx-${nginx_version}
      ./configure --prefix=${NGINXPATH} --pid-path=${NGINXPATH}/logs/nginx.pid  --user=${ng_user} --group=${ng_group} 
	  --with-http_ssl_module --with-http_v2_module --with-http_dav_module --with-http_flv_module --with-http_realip_module 
	  --with-http_addition_module --with-http_xslt_module --with-http_stub_status_module --with-http_sub_module 
	  --with-http_random_index_module --with-http_degradation_module --with-http_secure_link_module --with-http_gzip_static_module 
	  --with-http_perl_module --with-debug --with-file-aio --with-mail --with-mail_ssl_module 
	  --http-client-body-temp-path=${NGINXPATH}/client_body --http-proxy-temp-path=${NGINXPATH}/proxy 
	  --http-fastcgi-temp-path=${NGINXPATH}/fastcgi --http-uwsgi-temp-path=${NGINXPATH}/uwsgi --http-scgi-temp-path=${NGINXPATH}/scgi 
	  --with-stream --with-ld-opt="-Wl,-E"
          if [[ $? -ne 0 ]]; then
            echo "nginx was off_configed failed"
            exit 14
          else
            make && make install
            if [[ $? -ne 0 ]]; then
                echo "nginx was off_make_installed failed"
                exit 15
            else
               echo "nginx installed successed"
			   mkdir ${NGINXPATH}/conf/conf.d/ -p
			   cp ${softwarepath}/nginx.conf ${NGINXPATH}/conf/
			   sed -i "s!/usr/local/nginx!${NGINXPATH}!g" ${NGINXPATH}/conf/nginx.conf
            fi
          fi
        else
          echo "please upload the nginx-*.tar.gz"
		  exit 16
        fi
      else
        echo "yum install failed"
        exit 17
      fi
    else
      echo "|-----------------------[    失败    ]-----------------------|"
      echo "|-----------------------[检测不到网络]-----------------------|"
      echo "|-----------------------[准备离线安装]-----------------------|"
      /usr/bin/sleep 2
      nginxinstall_off
    fi
}

function nginxinstall_off(){
    echo "|---------------------[正在安装离线包]----------------------|"
    cd ${softwarepath}
    ngin=`ls | grep nginx-*.tar.gz`
    if [[ "$ngin" != "" ]];then
      tar -zxvf nginx-${nginx_version}.tar.gz >/dev/null 2>&1
	  cd nginx-${nginx_version}
      ./configure --prefix=${NGINXPATH} --pid-path=${NGINXPATH}/logs/nginx.pid  --user=${ng_user} --group=${ng_group} 
	  --with-http_ssl_module --with-http_v2_module --with-http_dav_module --with-http_flv_module --with-http_realip_module 
	  --with-http_addition_module --with-http_xslt_module --with-http_stub_status_module --with-http_sub_module 
	  --with-http_random_index_module --with-http_degradation_module --with-http_secure_link_module --with-http_gzip_static_module 
	  --with-http_perl_module --with-pcre=${softwarepath}/pcre-${pcre_version} --with-zlib=${softwarepath}/zlib-${zlib_version} 
	  --with-openssl=${softwarepath}/openssl-${openssl_version} --with-debug --with-file-aio --with-mail --with-mail_ssl_module 
	  --http-client-body-temp-path=${NGINXPATH}/client_body --http-proxy-temp-path=${NGINXPATH}/proxy 
	  --http-fastcgi-temp-path=${NGINXPATH}/fastcgi --http-uwsgi-temp-path=${NGINXPATH}/uwsgi --http-scgi-temp-path=${NGINXPATH}/scgi 
	  --with-stream --with-ld-opt="-Wl,-E" >${softwarepath}/logs/nginx.log >/dev/null 2>&1
        if [[ $? -ne 0 ]]; then
          echo "nginx was off_configed failed"
          exit 18
        else
          make && make install >>${softwarepath}/logs/nginx.log
          if [[ $? -ne 0 ]]; then
              echo "nginx was off_make_installed failed"
              exit 19
          else
             echo "nginx installed successed"
			 mkdir ${NGINXPATH}/conf/conf.d/ -p
			 cp ${softwarepath}/nginx.conf ${NGINXPATH}/conf/
             sed -i "s!/usr/local/nginx!${NGINXPATH}!g" ${NGINXPATH}/conf/nginx.conf
          fi
        fi
    else
      echo "please upload the nginx-*.tar.gz"
      exit 20
    fi
}

function ng_service(){
echo "############################   nginx sys_service  #######################################"
cat >/etc/systemd/system/nginx.service <<EOF
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=network.target

[Service]
Type=forking
PIDFile=${NGINXPATH}/logs/nginx.pid
ExecStart=${NGINXPATH}/sbin/nginx -c ${NGINXPATH}/conf/nginx.conf
ExecReload=${NGINXPATH}/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=false

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable nginx
systemctl start nginx
if [ $? -ne 0 ];then
  action "nginx service start failed." /bin/false
  exit 21
fi

systemctl stop nginx
if [ $? -ne 0 ];then
  action "nginx service stop failed." /bin/false
  exit 22
fi

systemctl restart nginx
if [ $? -ne 0 ];then
  action "nginx service restart failed." /bin/false
  exit 23
fi
ps -ef|grep nginx
}

#----------------------------------------------------NGINXEND-------------------------------------------------------#
function ok(){
echo "|****************************************************************************************************************|"
echo "|            WW             WW EEEEEEE LL     CCCCC   OOOOOO      MM      MM     EEEEEEE                         |"
echo "|             WW    WWWW   WW  EE      LL    CC      OO    OO    MMMM    MMMM    EE                              |"
echo "|              WW  WW WW  WW   EEEEE   LL   CC      OO      OO  MM  MM  MM  MM   EEEEE                           |"
echo "|               WW W   W WW    EE      LL    CC      OO    OO  MM    M M     MM  EE                              |"
echo "|                WW     WW     EEEEEEE LLLLLL CCCCC   OOOOOO  MM     MMM      MM EEEEEEE                         |"
echo "|****************************************************************************************************************|"
}

function main(){
environment
Openssl
pcre
zlib
nginx
ng_service
ok
}
main


Tags:nginx   点击:()  评论:()
声明:本站部分内容及图片来自互联网,转载是出于传递更多信息之目的,内容观点仅代表作者本人,如有任何标注错误或版权侵犯请与我们联系(Email:2595517585@qq.com),我们将及时更正、删除,谢谢。
▌相关推荐
项目中,遇到了一个问题,就是PDF等文档不能够在线预览,预览时会报错。错误描述浏览器的console中,显示如下错误:nginx代理服务报Mixed Content: The page at ******** was loaded...【详细内容】
2021-12-17  Tags: nginx  点击:(7)  评论:(0)  加入收藏
前言Nginx是前后端开发工程师必须掌握的神器。该神器有很多使用场景,比如反向代理、负载均衡、动静分离、跨域等等。把 Nginx下载下来,打开conf文件夹的nginx.conf文件,Nginx服...【详细内容】
2021-12-08  Tags: nginx  点击:(18)  评论:(0)  加入收藏
最近客户有个新需求,就是想查看网站的访问情况,由于网站没有做google的统计和百度的统计,所以访问情况,只能通过日志查看,通过脚本的形式给客户导出也不太实际,给客户写个简单的页...【详细内容】
2021-10-09  Tags: nginx  点击:(48)  评论:(0)  加入收藏
安全服务器是只允许所需数量的服务器。理想情况下,我们将通过单独启用其他功能来基于最小系统构建服务器。进行最少的配置也有助于调试。如果该错误在最小系统中不可用,则分别...【详细内容】
2021-09-26  Tags: nginx  点击:(60)  评论:(0)  加入收藏
在今年的NGINX Sprint 2.0虚拟大会上,NGINX(来自流行的开源web服务器/负载均衡器和反向代理背后的公司F5),发布了NGINX现代应用参考架构(MARA)。该公司在一篇博客文章中说,这将帮...【详细内容】
2021-09-26  Tags: nginx  点击:(60)  评论:(0)  加入收藏
Ubuntu下安装Nginx一、系统基本信息查看1、查看Ubuntu版本信息:使用命令:cat /proc/version 查看~$ cat /proc/versionLinux version 4.15.0-106-generic (buildd@lcy01-amd6...【详细内容】
2021-09-16  Tags: nginx  点击:(60)  评论:(0)  加入收藏
出于安全审查或者对于系统安全性的要求,都要求我们生产环境部署的系统需要做一定的权限控制。那么如何简单快速地部署满足安全要求的权限系统呢?其实可以通过nginx的相关功能...【详细内容】
2021-09-07  Tags: nginx  点击:(69)  评论:(0)  加入收藏
什么是NginxNginx(engine x)是一个高性能的HTTP和反向代理服务器,具有内存少,高并发特点强。1、处理静态文件,索引文件以及自动检索打开文件描述符缓冲2、无缓冲的反向代理加速...【详细内容】
2021-09-02  Tags: nginx  点击:(70)  评论:(0)  加入收藏
本文适用于 php7.4+NGINX环境,适用于运行 wordpress 环境一、更新服务器sudo apt update二、命令快捷缩写设置通过ssh登录服务器,在用户目录下执行以下命令sudo nano .bashrca...【详细内容】
2021-08-31  Tags: nginx  点击:(87)  评论:(0)  加入收藏
一、nginx正向代理介绍及配置(需要在客户端配置代理服务器进行指定网站访问)#模块 ngx_http_proxy_module: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy...【详细内容】
2021-08-16  Tags: nginx  点击:(75)  评论:(0)  加入收藏
▌简易百科推荐
阿里云镜像源地址及安装网站地址https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b111kK44P更新源之前把之前的国外的镜像先备份一下 切换到yumcd...【详细内容】
2021-12-27  干程序那些事    Tags:CentOS7镜像   点击:(1)  评论:(0)  加入收藏
前言在实现TCP长连接功能中,客户端断线重连是一个很常见的问题,当我们使用netty实现断线重连时,是否考虑过如下几个问题: 如何监听到客户端和服务端连接断开 ? 如何实现断线后重...【详细内容】
2021-12-24  程序猿阿嘴  CSDN  Tags:Netty   点击:(12)  评论:(0)  加入收藏
一. 配置yum源在目录 /etc/yum.repos.d/ 下新建文件 google-chrome.repovim /etc/yum.repos.d/google-chrome.repo按i进入编辑模式写入如下内容:[google-chrome]name=googl...【详细内容】
2021-12-23  有云转晴    Tags:chrome   点击:(7)  评论:(0)  加入收藏
一. HTTP gzip压缩,概述 request header中声明Accept-Encoding : gzip,告知服务器客户端接受gzip的数据 response body,同时加入以下header:Content-Encoding: gzip:表明bo...【详细内容】
2021-12-22  java乐园    Tags:gzip压缩   点击:(8)  评论:(0)  加入收藏
yum -y install gcc automake autoconf libtool makeadduser testpasswd testmkdir /tmp/exploitln -s /usr/bin/ping /tmp/exploit/targetexec 3< /tmp/exploit/targetls -...【详细内容】
2021-12-22  SofM    Tags:Centos7   点击:(7)  评论:(0)  加入收藏
Windows操作系统和Linux操作系统有何区别?Windows操作系统:需支付版权费用,(华为云已购买正版版权,在华为云购买云服务器的用户安装系统时无需额外付费),界面化的操作系统对用户使...【详细内容】
2021-12-21  卷毛琴姨    Tags:云服务器   点击:(6)  评论:(0)  加入收藏
参考资料:Hive3.1.2安装指南_厦大数据库实验室博客Hive学习(一) 安装 环境:CentOS 7 + Hadoop3.2 + Hive3.1 - 一个人、一座城 - 博客园1.安装hive1.1下载地址hive镜像路径 ht...【详细内容】
2021-12-20  zebra-08    Tags:Hive   点击:(9)  评论:(0)  加入收藏
以下是服务器安全加固的步骤,本文以腾讯云的CentOS7.7版本为例来介绍,如果你使用的是秘钥登录服务器1-5步骤可以跳过。1、设置复杂密码服务器设置大写、小写、特殊字符、数字...【详细内容】
2021-12-20  网安人    Tags:服务器   点击:(7)  评论:(0)  加入收藏
项目中,遇到了一个问题,就是PDF等文档不能够在线预览,预览时会报错。错误描述浏览器的console中,显示如下错误:nginx代理服务报Mixed Content: The page at ******** was loaded...【详细内容】
2021-12-17  mdong    Tags:Nginx   点击:(7)  评论:(0)  加入收藏
转自: https://kermsite.com/p/wt-ssh/由于格式问题,部分链接、表格可能会失效,若失效请访问原文密码登录 以及 通过密钥实现免密码登录Dec 15, 2021阅读时长: 6 分钟简介Windo...【详细内容】
2021-12-17  LaLiLi    Tags:SSH连接   点击:(16)  评论:(0)  加入收藏
最新更新
栏目热门
栏目头条