目录
1.安装jdk
- 解压jdk安装包
# 解压 tar -zxvf jdk-8u271-linux-x64.tar.gz # 修改解压后的文件名称为jdk1.8 mv xxx/ jdk1.8
- 配置环境变量
vim /etc/profile # 在最后边加 # JAVA环境变量 JAVA_HOME=/xxx/xxx/xxx PATH=$JAVA_HOME/bin:$PATH CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JAVA_HOME export PATH export CLASSPATH
- 测试是否安装成功
[root@VM-8-4-centos java]# javac Usage: javac <options> <source files> where possible options include: -g Generate all debugging info -g:none Generate no debugging info -g:{lines,vars,source} Generate only some debugging info -nowarn Generate no warnings -verbose Output messages about what the compiler is doing -deprecation Output source locations where deprecated APIs are used -classpath <path> Specify where to find user class files and annotation processors -cp <path> Specify where to find user class files and annotation processors -sourcepath <path> Specify where to find input source files -bootclasspath <path> Override location of bootstrap class files -extdirs <dirs> Override location of installed extensions -endorseddirs <dirs> Override location of endorsed standards path -proc:{none,only} Control whether annotation processing and/or compilation is done. -processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process -processorpath <path> Specify where to find annotation processors -parameters Generate metadata for reflection on method parameters -d <directory> Specify where to place generated class files -s <directory> Specify where to place generated source files -h <directory> Specify where to place generated native header files -implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files -encoding <encoding> Specify character encoding used by source files -source <release> Provide source compatibility with specified release -target <release> Generate class files for specific VM version -profile <profile> Check that API used is available in the specified profile -version Version information -help Print a synopsis of standard options -Akey[=value] Options to pass to annotation processors -X Print a synopsis of nonstandard options -J<flag> Pass <flag> directly to the runtime system -Werror Terminate compilation if warnings occur @<filename> Read options and filenames from file
- 查看版本
[root@VM-8-4-centos java]# java -version java version "1.8.0_202" Java(TM) SE Runtime Environment (build 1.8.0_202-b08) Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
2.yum 安装Nginx
- 查看gcc版本
gcc -v
- gcc安装命令
yum -y install gcc
- 安装openssl
# openssl是web安全通信的基石,没有openssl,可以说我们的信息都是在裸奔。。。。。。 yum install -y openssl openssl-devel
- 安装nginx
yum install -y nginx
- 启动并设置开机自启
sudo systemctl start nginx sudo systemctl enable nginx
3.yum 安装Redis
- 安装redis
yum install -y redis
- 设置redis远程连接和密码
/etc/redis.conf bin 127.0.0.1 注释掉,否则只有本地才能访问 #bin 127.0.0.1 保护模式 protected-mode yes 改为 protected-mode no 要想修改端口号 修改port即可 修改密码 requirepass 123456
- 启动redis
#启动 systemctl start redis #重启 systemctl restart redis #查看状态 systemctl status redis
- 开放端口号
firewall-cmd --zone=public --add-port=6379/tcp --permanent #重新加载 firewall-cmd --reload
- 本地连接redis
[root@VM-8-4-centos ~]# redis-cli -h 127.0.0.1 -p 6379 127.0.0.1:6379> auth 123456 OK 127.0.0.1:6379>
- 查看redis版本
redis-server -v
4.开启防火墙(开放端口)
-
开启防火墙
systemctl start firewalld.service
-
关闭防火墙
systemctl stop firewalld.service
-
重启防火墙
systemctl restart firewalld
-
开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent #重新加载 firewall-cmd --reload
-
查看已开放的端口
firewall-cmd --list-ports
5.安装nodejs、npm
-
yum下载
[root@VM-8-4-centos home]# yum install nodejs [root@VM-8-4-centos home]# yum install npm
-
检查版本
[root@VM-8-4-centos home]# node -v v16.18.1 [root@VM-8-4-centos home]# npm -v 8.19.2
-
npm阿里云镜像源加速
[root@VM-8-4-centos home]# npm config set registry "https://registry.npm.taobao.org" #验证npm设置阿里云源是否设置成功 [root@VM-8-4-centos home]# npm config get registry https://registry.npm.taobao.org/