链接: https://pan.baidu.com/s/1A2_3A13X35LGjLC3ETpRsw?pwd=khvn 提取码: khvn
一、相关jar包准备:
二、安装gcc
[root@bogon /]# mkdir -p /opt/gcc
[root@bogon gcc]# tar -zxvf gcc_centos7_20230423.tar.gz
[root@bogon gcc]# cd gcc_centos7_20230423
[root@bogon gcc_centos7_20230423]# rpm -Uvh *.rpm --nodeps --force
警告:cpp-4.8.5-44.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:libgcc-4.8.5-44.el7 ################################# [ 5%]
2:glibc-common-2.17-317.el7 ################################# [ 11%]
3:glibc-2.17-317.el7 ################################# [ 16%]
4:mpfr-3.1.1-4.el7 ################################# [ 21%]
5:libmpc-1.0.1-3.el7 ################################# [ 26%]
6:libstdc++-4.8.5-44.el7 ################################# [ 32%]
7:libstdc++-devel-4.8.5-44.el7 ################################# [ 37%]
8:cpp-4.8.5-44.el7 ################################# [ 42%]
9:kernel-tools-libs-3.10.0-1160.el7################################# [ 47%]
10:libgomp-4.8.5-44.el7 ################################# [ 53%]
11:kernel-headers-3.10.0-1160.el7 ################################# [ 58%]
12:glibc-headers-2.17-317.el7 ################################# [ 63%]
13:glibc-devel-2.17-317.el7 ################################# [ 68%]
14:gcc-4.8.5-44.el7 ################################# [ 74%]
15:gcc-c++-4.8.5-44.el7 ################################# [ 79%]
16:kernel-tools-3.10.0-1160.el7 ################################# [ 84%]
17:kexec-tools-2.0.15-51.el7 ################################# [ 89%]
18:kernel-devel-3.10.0-1160.el7 ################################# [ 95%]
19:kernel-3.10.0-1160.el7 ################################# [100%]
[root@bogon gcc_centos7_20230423]# gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
三、安装依赖
pcre-devel-8.32-17.el7.x86_64.rpm
zlib-1.2.7-18.el7.x86_64.rpm
zlib-devel-1.2.7-18.el7.x86_64.rpm
[root@bogon nginx]# ll
总用量 1676
-rw-r--r--. 1 root root 1073948 4月 23 21:38 nginx-1.22.1.tar.gz
-rw-r--r--. 1 root root 491272 4月 23 21:51 pcre-devel-8.32-17.el7.x86_64.rpm
-rw-r--r--. 1 root root 91960 4月 23 21:51 zlib-1.2.7-18.el7.x86_64.rpm
-rw-r--r--. 1 root root 51128 4月 23 21:51 zlib-devel-1.2.7-18.el7.x86_64.rpm
[root@bogon nginx]# rpm -Uvh *.rpm --nodeps --force
四、Nginx安装
[root@bogon nginx]# tar -zxvf nginx-1.22.1.tar.gz
[root@bogon nginx]# cd nginx-1.22.1
[root@bogon nginx-1.22.1]# ./configure --prefix=/usr/local/nginx
[root@bogon nginx-1.22.1]# make && make install
[root@bogon nginx-1.22.1]# cd /usr/local/nginx/sbin/
[root@bogon sbin]# ./nginx
[root@bogon sbin]# systemctl stop firewalld
浏览器访问ip地址,截图如下: