中科方德安装jdk、redis、mysql、nginx

前提:联系中科方德客服索取已适配的安装包。

1,jdk
rpm -i java-11-openjdk-headless-11.0.5.10-5.nfs4.x86_64.rpm
rpm -i java-11-openjdk-11.0.5.10-5.nfs4.x86_64.rpm
rpm -i java-11-openjdk-devel-11.0.5.10-5.nfs4.x86_64.rpm
update-alternatives --config java
rpm -qa | grep java
rpm -ql java-11-openjdk-headless-11.0.5.10-5.nfs4.x86_64
/usr/lib/jvm/java-11-openjdk-11.0.5.10-5.nfs4.x86_64/bin/java -version

2,redis(开放端口6379)
rpm -i redis-7.0.4-1.nfs.x86_64.rpm
systemctl enable redis-server.service
systemctl start redis-server.service
redis-cli
set groupName xqqGroup
get groupName
exit

3,mysql(开放端口3306)
rpm -i ncurses-compat-libs-6.1-7.20180224.nfs.x86_64.rpm
rpm -i mysql-8.0.20-1.nfs.x86_64.rpm
如果有冲突,可能是系统预装了mariadb,强制安装即可(覆盖掉mariadb的my.cnf)
cp -f my.cnf /etc/my.cnf
service mysql start
chkconfig --add mysql
chkconfig --list
mysql -p
select host, user from mysql.user;
create user 'root'@'%' identified with mysql_native_password by 'root';
grant all on *.* to 'root'@'%' with grant option;
drop user 'root'@'localhost';
FLUSH PRIVILEGES;
create database ffs;
use ffs;
source /root/files/ffs.sql

4,nginx(开放端口8000)
rpm -i nginx-1.23.1-1.nfs.x86_64.rpm
cp -f nginx.cnf /opt/nginx/conf
之后部署页面到/opt/nginx/html
systemctl enable nginx.service
systemctl start nginx.service

 

my.cnf

 1 [mysqld]
 2 basedir = /opt/mysql
 3 datadir = /opt/mysql/data
 4 log-error = /var/log/mysqld.log
 5 port=3306
 6 max_connections=200
 7 character-set-server=utf8
 8 sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
 9 [mysql]
10 default-character-set=utf8
11 [client]
12 port=3306
13 default-character-set=utf8

nginx.conf

 1 #user  nobody;
 2 worker_processes  1;
 3 
 4 #error_log  logs/error.log;
 5 #error_log  logs/error.log  notice;
 6 #error_log  logs/error.log  info;
 7 
 8 #pid        logs/nginx.pid;
 9 
10 
11 events {
12     worker_connections  1024;
13 }
14 
15 
16 http {
17     include       mime.types;
18     default_type  application/octet-stream;
19 
20     #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
21     #                  '$status $body_bytes_sent "$http_referer" '
22     #                  '"$http_user_agent" "$http_x_forwarded_for"';
23 
24     #access_log  logs/access.log  main;
25 
26     sendfile        on;
27     #tcp_nopush     on;
28 
29     #keepalive_timeout  0;
30     keepalive_timeout  65;
31 
32     #gzip  on;
33 
34     server {
35         listen       8000;
36         server_name  localhost;
37         location / {
38             root   html;
39             index  index.html index.htm;
40             try_files $uri $uri/ /index.html;
41         }
42         location ^~ /api/ {
43             proxy_pass  http://localhost:2000/;
44             proxy_set_header Host $host; 
45             proxy_set_header X-Real-IP $remote_addr;
46             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
47             proxy_set_header REMOTE-HOST $remote_addr;
48             proxy_set_header Upgrade $http_upgrade;
49             proxy_set_header Connection "upgrade";
50             autoindex on;
51             autoindex_localtime on;
52             autoindex_exact_size off;
53             error_page   500 502 503 504  /50x.html; 
54         }
55     }
56 }

 

posted @ 2023-08-10 10:26  光何  阅读(666)  评论(0编辑  收藏  举报