1.安装java8(百度)


yum install java-1.8.0-openjdk.x86_64

[root@canteen jar]# yum install java-1.8.0-openjdk.x86_64

yum install java-1.8.0-openjdk-devel.x86_64

查java版本:

[root@localhost ~]# java -version
openjdk version "1.8.0_372"
OpenJDK Runtime Environment (build 1.8.0_372-b07)
OpenJDK 64-Bit Server VM (build 25.372-b07, mixed mode)

2.安装mysql(百度)


https://blog.csdn.net/weixin_42575720/article/details/126056711

https://dev.mysql.com/downloads/repo/yum/
下载
Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package 10.9K Download
(mysql80-community-release-el7-7.noarch.rpm)

rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-11.noarch.rpm
yum install mysql-community-server
systemctl start mysqld.service
grep 'temporary password' /var/log/mysqld.log
mysql -V

root@47.92.203.117's password:
Access denied
root@47.92.203.117's password:┌──────────────────────────────────────────────────────────────────────┐│                 • MobaXterm Personal Edition v24.2 •                 ││               (SSH client, X server and network tools)               ││                                                                      ││ ⮞ SSH session to root@47.92.203.117                                  ││   • Direct SSH      :  ✓                                             ││   • SSH compression :  ✓                                             ││   • SSH-browser     :  ✓                                             ││   • X11-forwarding  :  ✗  (disabled or not supported by server)      ││                                                                      ││ ⮞ For more info, ctrl+click on help or visit our website.            │└──────────────────────────────────────────────────────────────────────┘Last failed login: Fri Mar 14 14:26:49 CST 2025 from 119.48.197.124 on ssh:notty
There were 3 failed login attempts since the last successful login.Welcome to Alibaba Cloud Elastic Compute Service ![root@iZ8vb45ie77v5ybgcemxysZ ~]# rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-11.noarch.rpm
Retrieving https://dev.mysql.com/get/mysql80-community-release-el7-11.noarch.rpm
warning: /var/tmp/rpm-tmp.nt5kun: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...1:mysql80-community-release-el7-11 ################################# [100%]
[root@iZ8vb45ie77v5ybgcemxysZ ~]# yum install mysql-community-server
Loaded plugins: fastestmirror
Determining fastest mirrors
base                                                                                                                                  | 3.6 kB  00:00:00
epel                                                                                                                                  | 4.3 kB  00:00:00
extras                                                                                                                                | 2.9 kB  00:00:00
mysql-connectors-community                                                                                                            | 2.6 kB  00:00:00
mysql-tools-community                                                                                                                 | 2.6 kB  00:00:00
mysql80-community                                                                                                                     | 2.6 kB  00:00:00
updates                                                                                                                               | 2.9 kB  00:00:00
(1/10): epel/x86_64/updateinfo                                                                                                        | 1.0 MB  00:00:00
(2/10): base/7/x86_64/group_gz                                                                                                        | 153 kB  00:00:00
(3/10): base/7/x86_64/primary_db                                                                                                      | 6.1 MB  00:00:00
(4/10): extras/7/x86_64/primary_db                                                                                                    | 253 kB  00:00:00
(5/10): epel/x86_64/primary_db                                                                                                        | 8.7 MB  00:00:00
(6/10): updates/7/x86_64/primary_db                                                                                                   |  27 MB  00:00:00
(7/10): mysql-tools-community/x86_64/primary_db                                                                                       | 103 kB  00:00:00
(8/10): mysql-connectors-community/x86_64/primary_db                                                                                  | 124 kB  00:00:01
(9/10): mysql80-community/x86_64/primary_db                                                                                           | 322 kB  00:00:01
(10/10): epel/x86_64/group                                                                                                            | 399 kB  00:00:07
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:8.0.41-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 8.0.41-1.el7 for package: mysql-community-server-8.0.41-1.el7.x86_64
--> Processing Dependency: mysql-community-icu-data-files = 8.0.41-1.el7 for package: mysql-community-server-8.0.41-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 8.0.11 for package: mysql-community-server-8.0.41-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: mysql-community-server-8.0.41-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: mysql-community-server-8.0.41-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: mysql-community-server-8.0.41-1.el7.x86_64
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package mysql-community-client.x86_64 0:8.0.41-1.el7 will be installed
--> Processing Dependency: mysql-community-client-plugins = 8.0.41-1.el7 for package: mysql-community-client-8.0.41-1.el7.x86_64
--> Processing Dependency: mysql-community-libs(x86-64) >= 8.0.11 for package: mysql-community-client-8.0.41-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:8.0.41-1.el7 will be installed
---> Package mysql-community-icu-data-files.x86_64 0:8.0.41-1.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
---> Package mysql-community-client-plugins.x86_64 0:8.0.41-1.el7 will be installed
---> Package mysql-community-libs.x86_64 0:8.0.41-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:8.0.41-1.el7 will be obsoleting
--> Finished Dependency ResolutionDependencies Resolved=============================================================================================================================================================Package                                           Arch                      Version                              Repository                            Size
=============================================================================================================================================================
Installing:mysql-community-libs                              x86_64                    8.0.41-1.el7                         mysql80-community                    1.5 Mreplacing  mariadb-libs.x86_64 1:5.5.68-1.el7mysql-community-libs-compat                       x86_64                    8.0.41-1.el7                         mysql80-community                    669 kreplacing  mariadb-libs.x86_64 1:5.5.68-1.el7mysql-community-server                            x86_64                    8.0.41-1.el7                         mysql80-community                     65 M
Installing for dependencies:libaio                                            x86_64                    0.3.109-13.el7                       base                                  24 kmysql-community-client                            x86_64                    8.0.41-1.el7                         mysql80-community                     16 Mmysql-community-client-plugins                    x86_64                    8.0.41-1.el7                         mysql80-community                    3.5 Mmysql-community-common                            x86_64                    8.0.41-1.el7                         mysql80-community                    666 kmysql-community-icu-data-files                    x86_64                    8.0.41-1.el7                         mysql80-community                    2.2 MTransaction Summary
=============================================================================================================================================================
Install  3 Packages (+5 Dependent packages)Total download size: 89 M
Is this ok [y/d/N]: y
Downloading packages:
(1/8): libaio-0.3.109-13.el7.x86_64.rpm                                                                                               |  24 kB  00:00:00
warning: /var/cache/yum/x86_64/7/mysql80-community/packages/mysql-community-client-plugins-8.0.41-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID a8d3785c: NOKEY
Public key for mysql-community-client-plugins-8.0.41-1.el7.x86_64.rpm is not installed
(2/8): mysql-community-client-plugins-8.0.41-1.el7.x86_64.rpm                                                                         | 3.5 MB  00:00:02
(3/8): mysql-community-common-8.0.41-1.el7.x86_64.rpm                                                                                 | 666 kB  00:00:00
(4/8): mysql-community-icu-data-files-8.0.41-1.el7.x86_64.rpm                                                                         | 2.2 MB  00:00:00
(5/8): mysql-community-libs-8.0.41-1.el7.x86_64.rpm                                                                                   | 1.5 MB  00:00:00
(6/8): mysql-community-libs-compat-8.0.41-1.el7.x86_64.rpm                                                                            | 669 kB  00:00:00
(7/8): mysql-community-client-8.0.41-1.el7.x86_64.rpm                                                                                 |  16 MB  00:00:04
(8/8): mysql-community-server-8.0.41-1.el7.x86_64.rpm                                                                                 |  65 MB  00:00:07
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                        8.1 MB/s |  89 MB  00:00:11
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2023
Importing GPG key 0xA8D3785C:Userid     : "MySQL Release Engineering <mysql-build@oss.oracle.com>"Fingerprint: bca4 3417 c3b4 85dd 128e c6d4 b7b3 b788 a8d3 785cPackage    : mysql80-community-release-el7-11.noarch (installed)From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2023
Is this ok [y/N]: y
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Importing GPG key 0x3A79BD29:Userid     : "MySQL Release Engineering <mysql-build@oss.oracle.com>"Fingerprint: 859b e8d7 c586 f538 430b 19c2 467b 942d 3a79 bd29Package    : mysql80-community-release-el7-11.noarch (installed)From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Is this ok [y/N]: y
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:Userid     : "MySQL Release Engineering <mysql-build@oss.oracle.com>"Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5Package    : mysql80-community-release-el7-11.noarch (installed)From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : mysql-community-common-8.0.41-1.el7.x86_64                                                                                                1/9Installing : mysql-community-client-plugins-8.0.41-1.el7.x86_64                                                                                        2/9Installing : mysql-community-libs-8.0.41-1.el7.x86_64                                                                                                  3/9Installing : mysql-community-client-8.0.41-1.el7.x86_64                                                                                                4/9Installing : libaio-0.3.109-13.el7.x86_64                                                                                                              5/9Installing : mysql-community-icu-data-files-8.0.41-1.el7.x86_64                                                                                        6/9Installing : mysql-community-server-8.0.41-1.el7.x86_64                                                                                                7/9Installing : mysql-community-libs-compat-8.0.41-1.el7.x86_64                                                                                           8/9Erasing    : 1:mariadb-libs-5.5.68-1.el7.x86_64                                                                                                        9/9Verifying  : mysql-community-server-8.0.41-1.el7.x86_64                                                                                                1/9Verifying  : mysql-community-client-plugins-8.0.41-1.el7.x86_64                                                                                        2/9Verifying  : mysql-community-icu-data-files-8.0.41-1.el7.x86_64                                                                                        3/9Verifying  : mysql-community-common-8.0.41-1.el7.x86_64                                                                                                4/9Verifying  : mysql-community-libs-8.0.41-1.el7.x86_64                                                                                                  5/9Verifying  : mysql-community-libs-compat-8.0.41-1.el7.x86_64                                                                                           6/9Verifying  : libaio-0.3.109-13.el7.x86_64                                                                                                              7/9Verifying  : mysql-community-client-8.0.41-1.el7.x86_64                                                                                                8/9Verifying  : 1:mariadb-libs-5.5.68-1.el7.x86_64                                                                                                        9/9Installed:mysql-community-libs.x86_64 0:8.0.41-1.el7       mysql-community-libs-compat.x86_64 0:8.0.41-1.el7       mysql-community-server.x86_64 0:8.0.41-1.el7Dependency Installed:libaio.x86_64 0:0.3.109-13.el7                mysql-community-client.x86_64 0:8.0.41-1.el7          mysql-community-client-plugins.x86_64 0:8.0.41-1.el7mysql-community-common.x86_64 0:8.0.41-1.el7  mysql-community-icu-data-files.x86_64 0:8.0.41-1.el7Replaced:mariadb-libs.x86_64 1:5.5.68-1.el7Complete!
[root@iZ8vb45ie77v5ybgcemxysZ ~]# systemctl status mysqld.service
● mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: inactive (dead)Docs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.html
[root@iZ8vb45ie77v5ybgcemxysZ ~]# systemctl start mysqld.service
[root@iZ8vb45ie77v5ybgcemxysZ ~]# systemctl status mysqld.service
● mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: active (running) since Fri 2025-03-14 14:54:36 CST; 3s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 11850 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)Main PID: 11956 (mysqld)Status: "Server is operational"CGroup: /system.slice/mysqld.service└─11956 /usr/sbin/mysqldMar 14 14:54:29 iZ8vb45ie77v5ybgcemxysZ systemd[1]: Starting MySQL Server...
Mar 14 14:54:36 iZ8vb45ie77v5ybgcemxysZ systemd[1]: Started MySQL Server.
[root@iZ8vb45ie77v5ybgcemxysZ ~]# grep 'temporary password' /var/log/mysqld.log
2025-03-14T06:54:32.105792Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ?PAGMK_mn3vX
[root@iZ8vb45ie77v5ybgcemxysZ ~]# mysql -V
mysql  Ver 8.0.41 for Linux on x86_64 (MySQL Community Server - GPL)
[root@iZ8vb45ie77v5ybgcemxysZ ~]#


#yum localinstall mysql80-community-release-el7-7.noarch.rpm
[root@iZ0jle5emru0x0swmasdw9Z ~]# yum module disable mysql
[root@iZ0jle5emru0x0swmasdw9Z ~]# yum install mysql-community-server
[root@iZ0jle5emru0x0swmasdw9Z ~]# systemctl restart mysqld.service
[root@iZ0jle5emru0x0swmasdw9Z ~]# grep 'temporary password' /var/log/mysqld.log
2023-05-23T04:16:42.251099Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: E9ECySg5O)h>

查mysql版本:

[root@localhost ~]# mysql -V
mysql Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL)

2.1 配置mysql


用户名 root 密码 shizan#1234
进入MySQL: mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Jlrcgzwdb@2650';
CREATE USER 'developer'@'%' IDENTIFIED BY 'Developer@gzw283';
GRANT ALL ON *.* TO 'developer'@'%' WITH GRANT OPTION;

CREATE USER 'remotedeveloper'@'%' IDENTIFIED BY 'Developer@gzw283';
GRANT ALL ON *.* TO 'remotedeveloper'@'%' WITH GRANT OPTION;

远程登陆
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Jlrcgzwdb@2650' WITH GRANT OPTION;
FLUSH PRIVILEGES;

打开防火墙9090端口

firewall-cmd --zone=public --add-port=9090/tcp --permanent
重载配置使刚刚设置的开放端口9090生效

firewall-cmd --reload

创建 database:
cteate database shizan;
use shizan;
导入sql
source /*/*.sql;

3.安装redis(百度)

yum install epel-release
yum install redis
redis-server -v

建议使用源码安装:

2025年最新redis版本

wget https://download.redis.io/releases/redis-7.4.2.tar.gz
tar -zxf redis-7.4.2.tar.gz
cd redis-7.4.2/
make
make install/usr/local/bin/redis-server -v


wget https://download.redis.io/releases/redis-7.0.11.tar.gz
tar -zxf redis-7.0.11.tar.gz
进入解压目录
make
make install
测试启动
redis-server

查redis版本:

[root@localhost ~]# redis-server -v
Redis server v=7.0.11 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=9416842c89bef596

密码 mgrensheju@
redis-server /*/*.conf

设置redis 自启动systemctl

vim /etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory Data Store
After=network.target[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
Type=simple[Install]
WantedBy=multi-user.target
[root@iZ8vb45ie77v5ybgcemxysZ ~]# groupadd redis
groupadd: group 'redis' already exists
[root@iZ8vb45ie77v5ybgcemxysZ ~]# id redis
uid=997(redis) gid=995(redis) groups=995(redis)
[root@iZ8vb45ie77v5ybgcemxysZ ~]# mkdir -p /var/lib/redis
[root@iZ8vb45ie77v5ybgcemxysZ ~]# chown redis:redis /var/lib/redis
[root@iZ8vb45ie77v5ybgcemxysZ ~]# chmod 770 /var/lib/redis
[root@iZ8vb45ie77v5ybgcemxysZ ~]# systemctl daemon-reload
[root@iZ8vb45ie77v5ybgcemxysZ ~]# systemctl start redis
[root@iZ8vb45ie77v5ybgcemxysZ ~]# systemctl enable redis
Failed to execute operation: Bad message
# 检验/etc/systemd/system/redis.service文件格式
[root@iZ8vb45ie77v5ybgcemxysZ ~]# systemd-analyze verify /etc/systemd/system/redis.service
[/etc/systemd/system/redis.service:1] Assignment outside of section. Ignoring.
[/etc/systemd/system/redis.service:2] Assignment outside of section. Ignoring.
[/etc/systemd/system/redis.service:3] Assignment outside of section. Ignoring.
[root@iZ8vb45ie77v5ybgcemxysZ ~]# systemd-analyze verify /etc/systemd/system/redis.service
[root@iZ8vb45ie77v5ybgcemxysZ ~]#

4.项目目录下运行


java -jar *.jar

5.安装nginx

方法一:使用YUM仓库安装(只有1.20.1版本,没用新版本)
  1. 添加EPEL仓库(如果尚未添加): EPEL(Extra Packages for Enterprise Linux)是一个为RHEL和CentOS提供额外软件包的项目。

sudo yum install epel-release
  1. 安装Nginx: 一旦添加了EPEL仓库,就可以使用yum来安装Nginx。

sudo yum install nginx
  1. 启动Nginx: 安装完成后,启动Nginx服务。

sudo systemctl start nginx
  1. 设置开机自启: 如果你希望Nginx在系统启动时自动运行,可以设置它为开机自启。

sudo systemctl enable nginx
  1. 检查Nginx状态: 检查Nginx服务的状态。

sudo systemctl status nginx

[root@oaserver ~]# yum install epel-release
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
base                                                                                                                                         | 3.6 kB  00:00:00
docker-ce-stable                                                                                                                             | 3.5 kB  00:00:00
extras                                                                                                                                       | 2.9 kB  00:00:00
updates                                                                                                                                      | 2.9 kB  00:00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 安装
--> 解决依赖关系完成依赖关系解决====================================================================================================================================================================Package                                     架构                                  版本                                 源                                     大小
====================================================================================================================================================================
正在安装:epel-release                                noarch                                7-11                                 extras                                 15 k事务概要
====================================================================================================================================================================
安装  1 软件包总下载量:15 k
安装大小:24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                                 |  15 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装    : epel-release-7-11.noarch                                                                                                                        1/1验证中      : epel-release-7-11.noarch                                                                                                                        1/1已安装:epel-release.noarch 0:7-11完毕!
[root@oaserver ~]# yum install nginx
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                         | 5.1 kB  00:00:00* base: mirrors.aliyun.com* epel: repo.jing.rocks* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
epel                                                                                                                                         | 4.3 kB  00:00:00
(1/3): epel/x86_64/group                                                                                                                     | 399 kB  00:00:01
(2/3): epel/x86_64/updateinfo                                                                                                                | 1.0 MB  00:00:01
(3/3): epel/x86_64/primary_db                                                                                                                | 8.7 MB  00:00:03
正在解决依赖关系
--> 正在检查事务
---> 软件包 nginx.x86_64.1.1.20.1-10.el7 将被 安装
--> 正在处理依赖关系 nginx-filesystem = 1:1.20.1-10.el7,它被软件包 1:nginx-1.20.1-10.el7.x86_64 需要
--> 正在处理依赖关系 libcrypto.so.1.1(OPENSSL_1_1_0)(64bit),它被软件包 1:nginx-1.20.1-10.el7.x86_64 需要
--> 正在处理依赖关系 libssl.so.1.1(OPENSSL_1_1_0)(64bit),它被软件包 1:nginx-1.20.1-10.el7.x86_64 需要
--> 正在处理依赖关系 libssl.so.1.1(OPENSSL_1_1_1)(64bit),它被软件包 1:nginx-1.20.1-10.el7.x86_64 需要
--> 正在处理依赖关系 nginx-filesystem,它被软件包 1:nginx-1.20.1-10.el7.x86_64 需要
--> 正在处理依赖关系 redhat-indexhtml,它被软件包 1:nginx-1.20.1-10.el7.x86_64 需要
--> 正在处理依赖关系 libcrypto.so.1.1()(64bit),它被软件包 1:nginx-1.20.1-10.el7.x86_64 需要
--> 正在处理依赖关系 libprofiler.so.0()(64bit),它被软件包 1:nginx-1.20.1-10.el7.x86_64 需要
--> 正在处理依赖关系 libssl.so.1.1()(64bit),它被软件包 1:nginx-1.20.1-10.el7.x86_64 需要
--> 正在检查事务
---> 软件包 centos-indexhtml.noarch.0.7-9.el7.centos 将被 安装
---> 软件包 gperftools-libs.x86_64.0.2.6.1-1.el7 将被 安装
---> 软件包 nginx-filesystem.noarch.1.1.20.1-10.el7 将被 安装
---> 软件包 openssl11-libs.x86_64.1.1.1.1k-7.el7 将被 安装
--> 解决依赖关系完成依赖关系解决====================================================================================================================================================================Package                                      架构                               版本                                        源                                大小
====================================================================================================================================================================
正在安装:nginx                                        x86_64                             1:1.20.1-10.el7                             epel                             588 k
为依赖而安装:centos-indexhtml                             noarch                             7-9.el7.centos                              base                              92 kgperftools-libs                              x86_64                             2.6.1-1.el7                                 base                             272 knginx-filesystem                             noarch                             1:1.20.1-10.el7                             epel                              24 kopenssl11-libs                               x86_64                             1:1.1.1k-7.el7                              epel                             1.5 M事务概要
====================================================================================================================================================================
安装  1 软件包 (+4 依赖软件包)总下载量:2.4 M
安装大小:6.7 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): centos-indexhtml-7-9.el7.centos.noarch.rpm                                                                                            |  92 kB  00:00:00
warning: /var/cache/yum/x86_64/7/epel/packages/nginx-1.20.1-10.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 352c64e5: NOKEY75 kB/s | 340 kB  00:00:12 ETA
nginx-1.20.1-10.el7.x86_64.rpm 的公钥尚未安装
(2/5): nginx-1.20.1-10.el7.x86_64.rpm                                                                                                        | 588 kB  00:00:01
(3/5): gperftools-libs-2.6.1-1.el7.x86_64.rpm                                                                                                | 272 kB  00:00:01
(4/5): nginx-filesystem-1.20.1-10.el7.noarch.rpm                                                                                             |  24 kB  00:00:00
(5/5): openssl11-libs-1.1.1k-7.el7.x86_64.rpm                                                                                                | 1.5 MB  00:00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                1.0 MB/s | 2.4 MB  00:00:02
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 检索密钥
导入 GPG key 0x352C64E5:用户ID     : "Fedora EPEL (7) <epel@fedoraproject.org>"指纹       : 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5软件包     : epel-release-7-11.noarch (@extras)来自       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装    : 1:openssl11-libs-1.1.1k-7.el7.x86_64                                                                                                            1/5正在安装    : 1:nginx-filesystem-1.20.1-10.el7.noarch                                                                                                         2/5正在安装    : centos-indexhtml-7-9.el7.centos.noarch                                                                                                          3/5正在安装    : gperftools-libs-2.6.1-1.el7.x86_64                                                                                                              4/5正在安装    : 1:nginx-1.20.1-10.el7.x86_64                                                                                                                    5/5验证中      : gperftools-libs-2.6.1-1.el7.x86_64                                                                                                              1/5验证中      : centos-indexhtml-7-9.el7.centos.noarch                                                                                                          2/5验证中      : 1:nginx-filesystem-1.20.1-10.el7.noarch                                                                                                         3/5验证中      : 1:nginx-1.20.1-10.el7.x86_64                                                                                                                    4/5验证中      : 1:openssl11-libs-1.1.1k-7.el7.x86_64                                                                                                            5/5已安装:nginx.x86_64 1:1.20.1-10.el7作为依赖被安装:centos-indexhtml.noarch 0:7-9.el7.centos   gperftools-libs.x86_64 0:2.6.1-1.el7   nginx-filesystem.noarch 1:1.20.1-10.el7   openssl11-libs.x86_64 1:1.1.1k-7.el7完毕!

当nginx启动失败且产生如下报错时,原因是80端口被(docker)占用。

[root@oaserver ~]# systemctl start nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service"
[root@oaserver ~]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy serverLoaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)Active: failed (Result: exit-code) since 五 2024-08-30 15:32:06 CST; 26s agoProcess: 1956 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)Process: 1953 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)Process: 1950 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)8月 30 15:32:04 oaserver.jlrc nginx[1956]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
8月 30 15:32:05 oaserver.jlrc nginx[1956]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
8月 30 15:32:05 oaserver.jlrc nginx[1956]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
8月 30 15:32:05 oaserver.jlrc nginx[1956]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
8月 30 15:32:05 oaserver.jlrc nginx[1956]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
8月 30 15:32:06 oaserver.jlrc nginx[1956]: nginx: [emerg] still could not bind()
8月 30 15:32:06 oaserver.jlrc systemd[1]: nginx.service: control process exited, code=exited status=1
8月 30 15:32:06 oaserver.jlrc systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
8月 30 15:32:06 oaserver.jlrc systemd[1]: Unit nginx.service entered failed state.
8月 30 15:32:06 oaserver.jlrc systemd[1]: nginx.service failed.

当nginx启动失败且产生如下报错时,原因是SELinux处于Enforcing模式。

[root@oaserver ~]# systemctl start nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service"
[root@oaserver ~]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy serverLoaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)Active: failed (Result: exit-code) since 五 2024-08-30 15:34:36 CST; 5s agoProcess: 1956 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)Process: 2898 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)Process: 2895 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)8月 30 15:34:35 oaserver.jlrc systemd[1]: Starting The nginx HTTP and reverse proxy server...
8月 30 15:34:36 oaserver.jlrc nginx[2898]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
8月 30 15:34:36 oaserver.jlrc nginx[2898]: nginx: [emerg] bind() to 0.0.0.0:8001 failed (13: Permission denied)
8月 30 15:34:36 oaserver.jlrc nginx[2898]: nginx: configuration file /etc/nginx/nginx.conf test failed
8月 30 15:34:36 oaserver.jlrc systemd[1]: nginx.service: control process exited, code=exited status=1
8月 30 15:34:36 oaserver.jlrc systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
8月 30 15:34:36 oaserver.jlrc systemd[1]: Unit nginx.service entered failed state.
8月 30 15:34:36 oaserver.jlrc systemd[1]: nginx.service failed.
[root@oaserver ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

检查SELinux状态:如果系统启用了SELinux,它可能会阻止Nginx绑定到指定的端口。

检查SELinux状态:

getenforce

如果SELinux处于Enforcing模式,尝试将其设置为Permissive模式,然后再次尝试启动Nginx:

sudo setenforce 0
sudo systemctl start nginx

当nginx启动后没有报错,但8001仍无法访问时,原因是centos防火墙未开放8001端口。

检查防火墙设置:确保防火墙没有阻止Nginx绑定到端口8001(此处仅以8001端口为例,实际操作时填写使用的端口号)。

sudo firewall-cmd --permanent --zone=public --add-port=8001/tcp
sudo firewall-cmd --reload
[root@oaserver ~]# firewall-cmd --permanent --zone=public --add-port=8001/tcp
success
[root@oaserver ~]# firewall-cmd --reload
success

方法二:编译安装

2025年最新版本

yum -y install zlib zlib-devel openssl openssl-devel pcre-devel
wget https://nginx.org/download/nginx-1.27.4.tar.gz
tar -zxvf nginx-1.27.4.tar.gz
cd nginx-1.27.4/
#./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --with-pcre# 编译安装(包含常用模块)
./configure \
--prefix=/usr/local/nginx \
--with-http_ssl_module \
--with-http_gzip_static_module \
--with-pcre \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_v2_module \
--with-stream \
--with-threadsmake
make install
/usr/local/nginx/sbin/nginx -V


wget https://nginx.org/download/nginx-1.23.4.tar.gz

tar -zxvf nginx-1.23.4.tar.gz

yum -y install zlib zlib-devel openssl openssl-devel pcre-devel
进入解压后的目录
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-pcre
make
make install

为nginx增加流媒体(MP4播放)模块

使用nginx搭建音视频点播服务器 - seedoubleu - 博客园 (cnblogs.com)

./configure --prefix=/usr/local/nginx_mp4 --with-http_ssl_module --with-pcre

./configure --prefix=/usr/local/nginx-vod-hls --with-http_stub_status_module --with-http_gzip_static_module --with-http_gunzip_module --with-file-aio --with-threads --with-cc-opt="-O3" --with-http_ssl_module --with-openssl-opt=enable --with-http_mp4_module --with-stream --add-module=../nginx-vod-module-1.31

查nginx版本:

[root@localhost ~]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.23.4
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-pcre

6.安装maven配置环境变量:

Maven 环境配置 | 菜鸟教程

打印log-CSDN博客

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/web/94812.shtml
繁体地址,请注明出处:http://hk.pswp.cn/web/94812.shtml
英文地址,请注明出处:http://en.pswp.cn/web/94812.shtml

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【STM32】G030单片机的窗口看门狗

一、简单介绍窗口看门狗适合需要精确时序控制的场合&#xff0c;在一个受限的窗口期内喂狗&#xff0c;如果递减计数器还没有到窗口值就喂狗&#xff0c;会触发复位如果一直不喂狗&#xff0c;也会触发复位&#xff0c;和之前的独立看门狗的窗口选项有点类似需要指出的是&#…

完整代码注释:实现 Qt 的 TCP 客户端,实现和服务器通信

一、实验效果演示 实现 Qt 的 TCP 客户端&#xff0c;实现和服务器通信二、代码框架 三、代码 tcpclient客户端代码 tcpclient.cpp #include "tcpclient.h" #include "ui_tcpclient.h" #include <QDebug> #include <QMessageBox> #include …

AR培训系统:油气行业的安全与效率革新

在油气行业&#xff0c;一场由增强现实&#xff08;AR www.teamhelper.cn &#xff09;技术引领的培训革命正在悄然发生。新员工们不再需要冒着生命危险在真实的钻井平台上学习操作&#xff0c;而是通过AR眼镜在虚拟环境中模拟钻井、起下钻甚至处理井喷等复杂操作。这种创新的培…

Linux 多线程:互斥与同步

Linux 多线程中的互斥与同步 —— pthread_mutex 与 semaphore在 Linux 多线程编程中&#xff0c;线程间共享全局变量或数据结构是常见场景。如果多个线程同时读写同一块内存&#xff0c;就可能产生 数据竞争 和 不一致。为了解决这些问题&#xff0c;Linux 提供了多种 线程同步…

技术演进中的开发沉思-81 Linux系列:进程地址空间

上一个篇幅和大家聊了进程地址空间、内存描述符这些 Linux 内存管理的 “基本功”&#xff0c;我的一些学生问&#xff1a;“这些概念听起来简单&#xff0c;可实际开发中怎么用得上&#xff1f;” 我想今天把这些 “理论骨架” 填上 “实践血肉”—— 毕竟我当年踩过的坑、摸过…

【联通分量】题解:P13823 「Diligent-OI R2 C」所谓伊人_连通分量_最短路_01bfs_图论_C++算法竞赛

洛谷博客&#xff1a;https://www.luogu.com.cn/article/5n200x7y Link - P13823 讨论区中有很多有用的 hack&#xff0c;没过的话可以去看看。 每个点都可以换到其所在弱连通分量的最大点权&#xff0c;这是毋庸置疑的。 为了方便陈述&#xff0c;下文中记当前弱连通分量中…

区块链+隐私计算护航“东数西算”数据安全报告

一、背景与政策支持1.1 "东数西算"工程概况战略定位&#xff1a;作为数字经济时代的核心"底座"&#xff0c;"东数西算"工程是国家级算力资源跨域调配战略工程&#xff0c;旨在构建全国一体化算力网络体系。启动时间与布局&#xff1a;2022年2月&…

STM32——PWR

一、PWR1.1PWR简介PWR&#xff08;Power Control&#xff09;电源控制PWR负责管理STM32内部的电源供电部分&#xff0c;可以实现可编程电压监测器和低功耗模式的功能可编程电压监测器&#xff08;PVD&#xff09;可以监控VDD电源电压&#xff0c;当VDD下降到PVD阀值以下或上升到…

Linux系统网络管理学习.2

目录 一、学习目标与适用场景 二、网络管理基础概念 1. NetworkManager服务 2. 核心管理工具 三、NetworkManager服务管理&#xff08;基础操作&#xff09; 1. 服务状态控制 四、网络参数配置&#xff08;IP/DNS/网关&#xff09; 1. 图形化配置&#xff08;仅了解&…

响应式编程之Flow框架

文章目录一、技术背景与产生原因1.1 响应式编程的兴起1.2 响应式流规范&#xff08;Reactive Streams&#xff09;1.3 解决的问题1.4 响应式编程二、Flow API核心组件2.1 核心概念2.2 接口关系图2.2 接口详解2.3 背压机制三、完整示例3.1 入门示例3.2 基础发布-订阅示例3.3 带背…

ABeam中国 | 中国汽车市场(5)——软件定义汽车(SDV)的智能化应用场景

前言本系列前四篇深入探讨了中国新能源汽车市场的崛起与电动化进程中的挑战。本文聚焦软件定义汽车&#xff08;SDV&#xff09;的三大核心应用场景 ——高级驾驶辅助系统&#xff08;ADAS&#xff09;、智能驾驶舱人机界面&#xff08;HMI&#xff09;及出行即服务&#xff08…

BugKu Web渗透之成绩查询

打开网页&#xff0c;页面如下&#xff1a;输入框中输入不同的数字可以查询不同的结果。输入1后点击submit按钮&#xff0c;下方出现成绩结果。从题目上看感觉是一个SQL注入的漏洞。思路有下&#xff1a;1.自己手动拼接一些常见的SQL注入。2.用bp抓包后用SQLMap去跑。首先&…

【MES】工业4.0智能制造数字化工厂(数字车间、MES、ERP)解决方案:智能工厂体系架构、系统集成以及智能设计、生产、管理、仓储物流等

工业4.0智能制造数字化工厂的解决方案&#xff0c;涵盖了智能制造的背景、企业实现智能工厂的好处、智能工厂的规划与实现方法以及系统实施模块的详细介绍。通过上汽通用凯迪拉克工厂的案例展示了智能工厂的强大能力&#xff0c;强调了数据、技术、管理、人员等关键要素在智能制…

3.【鸿蒙应用开发实战: 从入门到精通】开发入门 Hello World

1.【鸿蒙应用开发实战: 从入门到精通】开发入门 Hello World1.1 前言1.2 创建一个新项目1.2.1 打开DevEco Studio1.2.2 点击 Create Project 创建项目1.3 遗留问题1.4 总结与开发建议1.5 结束语1.1 前言 上篇博文【2.【鸿蒙应用开发实战: 从入门到精通】开发环境搭建】我们已经…

mac系统本地部署Dify步骤梳理

更换终端&#xff0c;适配步骤梳理见笔记前提&#xff1a;已安装docker desktop&#xff0c;若未安装&#xff0c;跳转至文末先安装1.Git软件准备&#xff08;1&#xff09;确认查询Git版本&#xff08;2&#xff09;如果查询不到系统会提示安装&#xff0c;点击安装即可&#…

深度学习——基于卷积神经网络实现食物图像分类【1】(datalodar处理方法)

1. 项目概述 在这个项目中&#xff0c;我们将使用PyTorch框架构建一个卷积神经网络(CNN)来实现食物图像分类任务。我们的数据集包含20种不同的食物类别&#xff0c;包括八宝粥、巴旦木、白萝卜、板栗等常见食物。本文将详细介绍从数据准备、模型构建到训练和评估的完整流程。 …

华中科大联手小米推出ReCogDrive:自动驾驶迎来“认知革命”!

1.【前言】 在开放道路中实现安全、平稳、泛化的自动驾驶&#xff0c;是智能交通领域的“圣杯”。尽管近年来 端到端自动驾驶&#xff08;End-to-End Autonomous Driving, E2E-AD&#xff09; 框架&#xff08;如 UniAD、VAD&#xff09;在 NuScenes 等基准中展现出优异表现&a…

基于 Spring AMQP 的 RabbitMQ 分布式消息系统实战

在分布式系统中&#xff0c;服务间的解耦与异步通信是关键挑战。RabbitMQ 作为一款成熟的消息中间件&#xff0c;凭借其灵活的交换器模型&#xff08;Direct/Fanout/Topic&#xff09;、可靠的消息传递机制&#xff08;持久化、确认机制&#xff09;和丰富的客户端支持&#xf…

计算机网络:天气预报

一、预期结果程序运行输入所要查询的地点&#xff0c;然后出现三个选项实时天气、未来天气、生活指数。二、实现思路&#xff08;一&#xff09;Ubuntu中利用NOWapi服务器获取访问数据api地址&#xff0c;然后创建客户端利用TCP、IPV4协议分别访问实时天气&#xff0c;未来天气…

GD32VW553-IOT OLED移植

1.前言 本来想用他自身的硬件I2C实现的&#xff0c;但是不知道为啥跑demo一点波形都没有&#xff0c;改成推挽也没有波形&#xff0c;只有初始化的电平变化&#xff0c;而且I2C的驱动库好像有点复杂&#xff0c;起始信号结束信号都得单独发的&#xff0c;没有一个全部封装好的库…