CentOS下安装Nginx(linux)(Nginx+Tomcat集群)CentOS7.4(腾讯云)pcre库zlib库opensslNginx服务器安装gccg++开发类库yum-yinstallgccautomakeautoconflibtoolmakeyuminstallgccgcc-c++下载pcre库wgethttps://ftp.pcre.org/pub/pcre/pcre-8.42.tar.gz解压pcre库tar-zxvfpcre-8.42.tar.gz在Environment下新建pcre文件夹,移动进入解压后的文件夹(非必要)cd/root/Environment/pcre-8.42配置./configure--prefix=/root/Environment/pcre编译安装make&&makeinstall回到/rootcd/root下载zlib库wgethttp://zlib.net/zlib-1.2.11.tar.gz解压zlib库tar-zvxfzlib-1.2.11.tar.gz在Environment下新建一个zlib文件夹,移动进入解压后的文件夹(非必须)cd/root/Environment/zlib-1.2.11configure./configure--prefix=/root/Environment/zlibcompileinstallmake&&makeinstall回到/rootcd/rootinstallandupgradeopensslyuminstallopensslyumupdateopenssldownloadnginxserverwgethttp://nginx。org/download/nginx-1.15.1.tar.gz解压nginxtar-zvxfnginx-1.15.1.tar.gz在Server下新建nginx文件夹,移动进入解压后的文件夹(非必须)cd/root/Server/nginx-1.15.1配置./configure--prefix=/root/Server/nginx--with-pcre=/root/Environment/pcre--with-zlib=/root/Environment/zlib编译安装make&&makeinstall打开nginx.conf(/root/Server/nginx/conf)在文件头部添加代码用户root;nginx服务器安装好启动,重启并关闭nginx服务器cd/root/Server/nginx/sbinstart./nginxshutdown(quickstopstop,completeandorderlystopquit)./nginx-sstop./nginx-squitrestart./nginx-s重新加载
