1、先将官网下载的nginx-1.17.8.tar上传Linux系统
image.png
2、安装Nginx依赖,pcre、openssl、gcc、zlib(推荐使用yum源自动安装)
image.png

所需要的依赖:
image.png

出现如下提示缺失的依赖包:
其实按着提示安装对应的rpm包即可
image.png

image.png

安装命令: rpm -Uvh /home/rpmtest/*.rpm —nodeps —force

image.png

再次运行,提示已经是当前系统最大的版本

  1. yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

image.png

tar -xvf nginx-1.17.8.tar
cd nginx-1.17.8
命令行执行./configure
命令行执行 make
命令行执行 make install,完毕之后在  cd  /usr/local/下会产一个nginx目录

执行完make后,出现下面这个(将资源放在/sur/local/nginx,也可以自定义应该)
image.png

image.png

cd nginx/sbin
./nginx

image.png

image.png

通过命令进入到:Nginx的核心配置文件conf/nginx.conf
将端口号80改为81

image.png

image.png

image.png

下面错误的做法引以为戒(弄坏了一个节点,很是痛心啊)

错误做法之一:修改参数(引发后续一系列问题)

image.png

image.png

安装出异常

image.png

==============================================================
安装网上下载的
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm ls*.rpm

image.png

安装

image.png

将/mnt/iso/CentOS-6.5-x86_64-bin-DVD1.iso挂载到/mnt/cdron/下,并用df -h命令查看:
image.png

image.png

如果出现yum安装各种报错

rror: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: libc.so.6(GLIBC_2.15)(64bit)
Error: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: libverto-devel
Error: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: libc.so.6(GLIBC_2.14)(64bit)
Error: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: krb5-libs(x86-64) = 1.15.1-50.el7
Installed: krb5-libs-1.10.3-57.el6.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
krb5-libs(x86-64) = 1.10.3-57.el6
Error: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: libcom_err-devel
Error: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: libselinux-devel
Error: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: libkrad.so.0()(64bit)
Error: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: libkdb5.so.8()(64bit)
Error: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: keyutils-libs-devel
Error: Package: krb5-devel-1.15.1-50.el7.x86_64 (/krb5-devel-1.15.1-50.el7.x86_64)
Requires: libkadm5(x86-64) = 1.15.1-50.el7
You could try using —skip-broken to work around the problem

解决方案:(前提:所用的linux内核版本要7.0以上,否则没用)
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i ‘s/$releasever/7/g’ /etc/yum.repos.d/CentOS-Base.repo
yum repolist

image.png

yum clean all
rpm --rebuilddb
yum -y update

命令作用: 【yum clean all】yum 会把下载的软件包和header存储在cache中,而不自动删除。如果觉得占用磁盘空间,可以使用yum clean指令进行清除,更精确 的用法是yum clean headers清除header,yum clean packages清除下载的rpm包,yum clean all一全部清除。(参考:yum clean all的作用) 【rpm —rebuilddb】rpm 有自己的数据库,出现此错误是因为数据库异常导致的,使用rpm —rebuilddb重构一下数据库即可,重构只会重新建立了rpm库表,不安装和删除任何的包 【yum -y update】升级所有包同时也升级软件和系统内核(参考:用实验来证实CentOS7中yum之update与upgrade之间的异同

种种命令操作都不可以

Error: Package: gnome-power-manager-2.28.3-7.el6_4.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
           Requires: libpanel-applet-2.so.0()(64bit)
           Removing: gnome-panel-libs-2.30.2-16.el6.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
               libpanel-applet-2.so.0()(64bit)
           Obsoleted By: gnome-classic-session-3.28.1-14.el7.noarch (base)
               Not found
Error: Package: gthumb-2.10.11-8.el6.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
           Requires: libgphoto2_port.so.0()(64bit)
           Removing: libgphoto2-2.4.7-4.el6.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
               libgphoto2_port.so.0()(64bit)
           Updated By: libgphoto2-2.5.15-3.el7.x86_64 (base)
               Not found
Error: Package: xorg-x11-drv-voodoo-1.2.5-11.el6.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
           Requires: xserver-abi(videodrv-19) >= 0
           Removing: xorg-x11-server-Xorg-1.17.4-9.el6.centos.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
               xserver-abi(videodrv-19) = 0
           Updated By: xorg-x11-server-Xorg-1.20.4-13.el7_9.x86_64 (updates)
               Not found
Error: Package: compiz-gnome-0.8.2-24.el6.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
           Requires: libgnome-window-settings.so.1()(64bit)
           Removing: 1:control-center-2.28.1-40.el6.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
               libgnome-window-settings.so.1()(64bit)
           Updated By: 1:control-center-3.28.1-7.el7.x86_64 (base)
               Not found
Error: Package: udisks-1.0.1-9.el6.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
           Requires: libpolkit-backend-1.so.0()(64bit)
           Removing: polkit-0.96-11.el6.x86_64 (@anaconda-CentOS-201605220104.x86_64/6.8)
               libpolkit-backend-1.so.0()(64bit)
           Updated By: polkit-0.112-26.el7.x86_64 (base)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

后面经过翻译:很简单就是版本冲突了。
把要求删更新()
image.png

———————
======================================================

因为本身是6.8版本,而不想搞到7.0版本

最后只能通过rpm实现离线安装

gcc的离线安装。按顺序安装,如果安装过程中显示already install不需要管直接按顺序安装即可



 (1.)rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm

 (2.)rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm

 (3.)rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm

 (4.)rpm -ivh cpp-4.4.7-17.el6.x86_64.rpm

 (5.)rpm -ivh kernel-headers-2.6.32-642.el6.x86_64.rpm

 (6.)rpm -ivh glibc-headers-2.12-1.192.el6.x86_64.rpm

 (7.)rpm -ivh glibc-devel-2.12-1.192.el6.x86_64.rpm

 (8.)rpm -ivh libgomp-4.4.7-17.el6.x86_64.rpm

 (9.)rpm -ivh gcc-4.4.7-17.el6.x86_64.rpm --nodeps(如果执行此句有错,请在后面加上--nodeps)

 (10.)rpm -ivh libstdc++-devel-4.4.7-17.el6.x86_64.rpm

 (11.)rpm -ivh gcc-c++-4.4.7-17.el6.x86_64.rpm

7.安装成功后查看版本:gcc -v

离线安装pcre库、zlib库

sudo rpm -ivh pcre-devel-7.8-7.el6.x86_64.rpm
sudo rpm -ivh zlib-devel-1.2.3-29.el6.x86_64.rpm

centos 6.8安装openssl-devel

image.png

image.png

再次执行命令时候提示不需要装了
image.png