在入手服务器之后,一定记得在控制台中设置安全组,开放常用的端口,如:80、8080、3306、22122、23000等。
vim /etc/sysconfig/iptables
添加:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
设置项目nohup启动,避免关闭终端项目停止运行
nohup java -jar data-0.0.1-SNAPSHOT.jar &
systemctl stop firewalld
systemctl mask firewalld
yum install iptables-services
systemctl enable iptables
systemctl start iptables
service iptables save
vim /etc/profile
JAVA_HOME=/usr/local/java/jdk1.8.0_301
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH
export TOMCAT_HOME=/usr/local/tomcat/apache-tomcat-9.0.64
export CATALINA_HOME=/usr/local/tomcat/apache-tomcat-9.0.64
配置立即生效
source /etc/proile
cat /var/log/mysqld.log | grep password
首先使用ALTER USER 'root'@'localhost' IDENTIFIED BY '一个复杂密码';
设置一个复杂密码,不然会出现错误:
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
然后更改密码级别进和长度:
set global validate_password.policy=0;
set global validate_password.length=4;
最后在设置简单密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
首先关闭防火墙,并开放3306端口。
update user set host = '%' where user = 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
FLUSH PRIVILEGES;
yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io docker-compose-pluginy
systemctl start docker
ps -ef|grep docker