yun install git
git version
安装docker:yum install -y docker
查看docker版本:docker version
开启docker服务:systemctl start docker.service
设置docker开机启动:systemctl enable docker.service
直接编辑配置⽂件: vim /etc/docker/daemon.json
i
加入镜像源:{ "registry-mirrors": ["http://hub-mirror.c.163.com"] }
esc
:wq
新加载配置⽂件: systemctl daemon-reload
重启 docker 服务: systemctl restart docker.service
https://www.oracle.com/java/technologies/downloads/#java8
登陆oracle后下载jdk-8u311-linux-x64.tar.gz
到本地
然后通过ftp移至服务器centos下的/usr/local/java/目录下
cd /usr/
mkdir java
cd java
tar -zxvf jdk-8u311-linux-x64.tar.gz
rm jdk-8u311-linux-x64.tar.gz
y
jdk1.8.0_311
java -version
解压:tar -xJvf node-v16.13.1-linux-x64.tar.xz
注意:J一定要大写
vi ~/.bash_profile
i
进入vim的插入模式
在⽂件末尾追加配置信息:export PATH=/usr/local/node/node-v16.13.1-linux-x64/bin:$PATH
esc
进入vim的命令行模式
:wq
保存退出vim
刷新环境变量,使之⽣效:source ~/.bash_profile
检查安装结果:node -v
npm version
npx -v
tar -xvf mysql-5.7.30-linux-glibc2.12-x86_64.tar
tar -xzvf mysql-5.7.30-linux-glibc2.12-x86_64.tar.gz
groupadd mysql
useradd -g mysql mysql
同时新建/usr/local/mysql/data ⽬录,后续备⽤
chown -R mysql:mysql ./
在/etc ⽬录下新建my.cnf ⽂件,并写⼊如下简化配置:
[mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 socket=/var/lib/mysql/mysql.sock [mysqld] skip-name-resolve #设置3306端⼝ port = 3306 socket=/var/lib/mysql/mysql.sock # 设置mysql的安装⽬录 basedir=/usr/local/mysql # 设置mysql数据库的数据的存放⽬录 datadir=/usr/local/mysql/data # 允许最⼤连接数 max_connections=200 # 服务端使⽤的字符集默认为8⽐特编码的latin1字符集 character-set-server=utf8 # 创建新表时将使⽤的默认存储引擎 default-storage-engine=INNODB lower_case_table_names=1 max_allowed_packet=16M
cd /etc/
touch my.cnf
vi my.cnf
i
esc
:wq
mkdir /var/lib/mysql
chmod 777 /var/lib/mysql
cd /usr/local/mysql
安装命令./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
https://blog.csdn.net/webnum/article/details/81257793
vi /etc/my.cnf
在[mysqld]下添加explicit_defaults_for_timestamp=true
再次执行安装命令
清理已生成的data
再次执行安装命令
mysql初始密码:oFQQosXaF8)5
在mysql安装路径下执行cp ./support-files/mysql.server /etc/init.d/mysqld
vi /etc/init.d/mysqld
service mysqld start
vi ~/.bash_profile
source ~/.bash_profile
以root 账户登录mysql ,使⽤上⽂安装完成提示的密码【oFQQosXaF8)5】进⾏登⼊
mysql -u root -p
在mysql的命令⾏执⾏如下命令即可,密码可以换成你想⽤的密码即可
mysql>alter user user() identified by "密码";
mysql>flush privileges;
mysql>use mysql;
mysql>update user set user.Host='%' where user.User='root';
mysql>flush privileges;
mysql>quit
退出命令行
https://blog.csdn.net/weixin_41471128/article/details/83189083
https://blog.csdn.net/zzf1510711060/article/details/82631700
mysql -u root p
Enter password:后键入修改后的密码+回车
mysql>use mysql;
mysql>select host,user from user;
mysql>grant all privileges on *.* to 'root'@'%' identified by '密码';
mysql>flush privileges;
mysql>select host,user from user;
mysql>quit
对外开放mysql的默认端口3306
firewall-cmd --permanent --zone=public --add-port=3306/tcp//--permanent永久生效,没有此参数防火墙重启便失效
firewall-cmd --reload
firewall-cmd --permanent --list-port
本地下载好的linux环境安装包通过sftp传送至centOS的root目录下
cd /usr/local/
mkdir nginx
cd nginx
tar zxvf /root/nginx-1.20.2.tar.gz -C ./
解压完之后, /usr/local/nginx ⽬录中会出现⼀个 nginx-1.20.2 的⽬录
yum -y install pcre-devel
yum -y install openssl openssl-devel
cd nginx-1.20.2
./configure
make && make install
安装完成后, Nginx的可执⾏⽂件位置位于: /usr/local/nginx/sbin/nginx
Nginx的配置文件:/usr/local/nginx/conf/nginx.conf
启动Nginx:/usr/local/nginx/sbin/nginx
停止Nginx:/usr/local/nginx/sbin/nginx -s stop
如果修改了配置⽂件后想重新加载Nginx,可执⾏:/usr/local/nginx/sbin/nginx -s reload
原解压文件夹已没用,可删除rm -rf nginx-1.20.2
启动Nginx后
可远程访问,默认80端口
cd opt
mkdir maven
tar zxvf /root/apache-maven-3.8.4-bin.tar.gz -C ./
cd apache-maven-3.8.4
cd conf
vi settings.xml
i
<mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror>
esc
:wq
vi /etc/profile
i
#maven export MAVEN_HOME=/opt/maven/apache-maven-3.6.3 export PATH=$MAVEN_HOME/bin:$PATH
esc
:wq
source /etc/profile
mvn -v
cd /usr/local/
mkdir tomcat
cd tomcat
tar -zxvf /root/apache-tomcat-8.5.73.tar.gz -C ./
防火墙开放8080端口
cd /apache-tomcat-8.5.73/bin/
./startup.sh
本地浏览器访问: 远程主机(服务器)IP:8080 ,得到如上画⾯说明启动成功了
cd /etc/rc.d/init.d/
touch tomcat
chmod +x tomcat
vi tomcat
i
#!/bin/bash #chkconfig:- 20 90 #description:tomcat #processname:tomcat TOMCAT_HOME=/usr/local/tomcat/apache-tomcat-8.5.73 case $1 in start) su root $TOMCAT_HOME/bin/startup.sh;; stop) su root $TOMCAT_HOME/bin/shutdown.sh;; *) echo "require start|stop" ;; esac
esc
:wq
快捷操作不生效,报错java_home
chkconfig --add tomcat
chkconfig tomcat on
cd /usr/local/
mkdir redis
cd redis
tar zxvf /root/redis-6.2.6.tar.gz -C ./
cd redis-6.2.6/
make && make install
cd utils/
./install_server.sh
https://blog.csdn.net/u010571102/article/details/108564855
此处我全部选择的默认配置即可,有需要可以按需定制
systemctl start redis_6379.service
systemctl stop redis_6379.service
systemctl status redis_6379.service
redis-cli
ctrl+c
退出cli客户端
vim /etc/redis/6379.conf
将bind 127.0.0.1 修改为 0.0.0.0
0.0.0.0表示任何IP都能访问的,当然这里也可以绑定单独的IP(远程本地主机的IP,不是服务器)
重启Redis服务systemctl restart redis_6379.service
vim /etc/redis/6379.conf
或者这样也可以
vim /etc/redis/6379.conf
https://blog.csdn.net/weixin_45869725/article/details/114670943
查看端口列表firewall-cmd --permanent --list-port
防火墙开放6379端口firewall-cmd --zone=public --add-port=6379/tcp --permanent //--permanent永久生效,没有此参数防火墙重启便失效
重启防火墙firewall-cmd --reload 或者 service firewalld restart
查找进程&杀死进程:https://www.cnblogs.com/piwefei/p/9100181.html