国产系统:麒麟之常用应用服务nginx、redis、tomcat部署

服务器信息:

[root@7PGxjKPL4 ~]# cat /etc/*release
Kylin Linux Advanced Server release V10 (Sword)
DISTRIB_ID=Kylin
DISTRIB_RELEASE=V10
DISTRIB_CODENAME=juniper
DISTRIB_DESCRIPTION="Kylin V10"
DISTRIB_KYLIN_RELEASE=V10
DISTRIB_VERSION_TYPE=enterprise
DISTRIB_VERSION_MODE=normal
NAME="Kylin Linux Advanced Server"
VERSION="V10 (Sword)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Sword)"
ANSI_COLOR="0;31"

Kylin Linux Advanced Server release V10 (Sword)

一、nginx

1.获取 nginx 安装包

官网:nginx: download

2.安装 nginx 必要依赖

yum install gcc gcc-c++ make unzip pcre pcre-devel zlib zlib-devel libxml2 libxml2-devel  readline readline-devel ncurses ncurses-devel perl-devel perl-ExtUtils-Embed openssl-devel -y

3.解压 nginx 文件

[root@7PGxjKPL4 soft]# tar -zxvf nginx-1.24.0.tar.gz

4.进行 nginx 编译安装

[root@7PGxjKPL4 soft]# cd nginx-1.24.0/
[root@7PGxjKPL4 nginx-1.24.0]# ./configure
[root@7PGxjKPL4 nginx-1.24.0]# make
[root@7PGxjKPL4 nginx-1.24.0]# make install

5.启动并查看 nginx 服务

[root@7PGxjKPL4 nginx-1.24.0]# ll /usr/local/nginx/
总用量 0
drwxr-xr-x 2 root root 333  5月 26 22:07 conf
drwxr-xr-x 2 root root  40  5月 26 22:07 html
drwxr-xr-x 2 root root   6  5月 26 22:07 logs
drwxr-xr-x 2 root root  19  5月 26 22:07 sbin
[root@7PGxjKPL4 nginx-1.24.0]# /usr/local/nginx/sbin/nginx 
[root@7PGxjKPL4 nginx-1.24.0]# ps -ef |grep nginx
root     1592945       1  0 22:08 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
nobody   1592946 1592945  0 22:08 ?        00:00:00 nginx: worker process
root     1592958 1589964  0 22:08 pts/1    00:00:00 grep nginx
[root@7PGxjKPL4 nginx-1.24.0]# netstat -tunlp |grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1592945/nginx: mast

二、redis

1.获取 redis 安装包

官网:Download | Redis

2.安装 redis 相关依赖

[root@7PGxjKPL4 soft]# yum install -y gcc-c++

3.解压 redis 文件

[root@7PGxjKPL4 soft]# tar -zxvf redis-7.0.11.tar.gz

4.进行 redis 编译安装

[root@7PGxjKPL4 soft]# cd /usr/local/redis-7.0.11
[root@7PGxjKPL4 soft]# mv redis-7.0.11 /usr/local
[root@7PGxjKPL4 redis-7.0.11]# make 
[root@7PGxjKPL4 redis-7.0.11]# make test
[root@7PGxjKPL4 redis-7.0.11]# make install

5.启动并查看服务状态

[root@7PGxjKPL4 redis-7.0.11]# 
[root@7PGxjKPL4 redis-7.0.11]# /usr/local/redis-7.0.11/src/redis-server &
[1] 1618447
[root@7PGxjKPL4 redis-7.0.11]# 1618447:C 26 May 2023 22:33:03.456 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1618447:C 26 May 2023 22:33:03.456 # Redis version=7.0.11, bits=64, commit=00000000, modified=0, pid=1618447, just started
1618447:C 26 May 2023 22:33:03.456 # Warning: no config file specified, using the default config. In order to specify a config file use /usr/local/redis-7.0.11/src/redis-server /path/to/redis.conf
1618447:M 26 May 2023 22:33:03.457 * Increased maximum number of open files to 10032 (it was originally set to 1024).
1618447:M 26 May 2023 22:33:03.457 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 7.0.11 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 1618447
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           https://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

1618447:M 26 May 2023 22:33:03.457 # Server initialized
1618447:M 26 May 2023 22:33:03.457 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1618447:M 26 May 2023 22:33:03.458 * Ready to accept connections

[root@7PGxjKPL4 redis-7.0.11]# ps -ef |grep redis
root     1618447 1589964  0 22:33 pts/1    00:00:00 /usr/local/redis-7.0.11/src/redis-server *:6379
root     1618511 1589964  0 22:33 pts/1    00:00:00 grep redis
[root@7PGxjKPL4 redis-7.0.11]# netstat -tunlp |grep redis
tcp        0      0 0.0.0.0:6379            0.0.0.0:*               LISTEN      1618447/redis-serve 
tcp6       0      0 :::6379                 :::*                    LISTEN      1618447/redis-serve

三、tomcat

1.获取 tomcat 安装包

官网:Apache Tomcat® - Apache Tomcat 8 Software Downloads

2.查看是否已经有 jdk

(麒麟系统一般默认已经安装)

#查看是否安装 java
[root@7PGxjKPL4 soft]# java -version
openjdk version "1.8.0_272"
OpenJDK Runtime Environment Bisheng (build 1.8.0_272-b10)
OpenJDK 64-Bit Server VM Bisheng (build 25.272-b10, mixed mode)
#没有泽安装
[root@7PGxjKPL4 soft]# yum install -y java-1.8.0-openjdk
#配置环境变量 加入如下配置,按实际安装目录及名称修改
[root@7PGxjKPL4 soft]# vi /etc/profile
export  JAVA_HOME=/usr/java/jdk1.8.0_272
export  JRE_HOME=${JAVA_HOME}/jre
export  CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export  JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export  PATH=$PATH:${JAVA_HOME}/bin
#生效配置
[root@7PGxjKPL4 soft]# source /etc/profile

3.解压 tomcat 文件

[root@7PGxjKPL4 soft]# tar -zxvf apache-tomcat-8.5.83.tar.gz

4.启动并查看 tomcat 服务状态

[root@7PGxjKPL4 soft]# mv apache-tomcat-8.5.83 /usr/local/

[root@7PGxjKPL4 soft]# /usr/local/apache-tomcat-8.5.83/bin/startup.sh 
Using CATALINA_BASE:   /usr/local/apache-tomcat-8.5.83
Using CATALINA_HOME:   /usr/local/apache-tomcat-8.5.83
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.83/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/apache-tomcat-8.5.83/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.83/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
Tomcat started.

[root@7PGxjKPL4 soft]# ps -ef |grep tomcat
root     1620034       1 13 22:55 pts/1    00:00:04 /usr/bin/java -Djava.util.logging.config.file=/usr/local/apache-tomcat-8.5.83/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/apache-tomcat-8.5.83/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.83/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/apache-tomcat-8.5.83 -Dcatalina.home=/usr/local/apache-tomcat-8.5.83 -Djava.io.tmpdir=/usr/local/apache-tomcat-8.5.83/temp org.apache.catalina.startup.Bootstrap start
root     1620119 1589964  0 22:56 pts/1    00:00:00 grep tomcat
[root@7PGxjKPL4 soft]# netstat -tunlp |grep java
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      1620034/java        
tcp6       0      0 :::8080                 :::*                    LISTEN      1620034/java

你可能感兴趣的:(国产化,nginx,运维,redis,tomcat)