首先下载安装所需要的资源如下:
1.gcc和gcc-c++环境 https://download.csdn.net/download/huqingpeng321/11575224
2.Nginx及相关组件 https://download.csdn.net/download/huqingpeng321/11575243
ps.由于本人积分实在是用完了,所以有积分限制,挣点积分,实在抱歉了。
一:安装nginx依赖环境gcc和gcc-c++
unzip -d /home/ nginxyl.zip && cd /home/nginxyl
rpm -Uvh *.rpm --nodeps --force
二:安装Nginx及相关组件
unzip -d /home/ nginxzj.zip && cd /home/nginxzj
1)openssl安装
tar zxvf openssl-fips-2.0.14.tar.gz
cd openssl-fips-2.0.14
./config && make && make install
备注:若安装openssl失败并且提示如下报错则需要安装perl5
Operating system: x86_64-whatever-linux2 You need Perl 5.
-- perl5安装(安装openssl成功则跳过此此步骤)
tar -zxvf perl-5.28.0.tar.gz
cd perl-5.28.0
./Configure -des -Dprefix=$HOME/localperl
make
make install
2)pcre安装
tar zxvf pcre-8.43.tar.gz
cd pcre-8.43
./configure && make && make install
3)zlib安装
tar zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure && make && make install
4)nginx安装
tar zxvf nginx-1.14.2.tar.gz
cd nginx-1.14.2
./configure && make && make install
三:Nginx的使用
1)启动Nginx
查找nginx安装位置
whereis nginx
2)进入nginx目录并启动
cd /usr/local/nginx/sbin/
./nginx
3)nginx启动
/usr/local/nginx/sbin/nginx
4)nginx停止
/usr/local/nginx/sbin/nginx -s stop
5)nginx参数配置
vi /usr/local/nginx/conf/nginx.conf