阿里云主机Centos7配置

系统为centos 7.3

#查看 88 端口占用
netstat -lnp|grep 88

访问Tomcat相关问题

访问Tomcat特别慢
解决问题链接
解决问题链接

#原因是云主机的熵源不够大
yum install rngd-tools
#或者yum install rng-tools
systemctl start rngd

防火墙原因无法访问

##Add
firewall-cmd --permanent --zone=public --add-port=8080/tcp
##Reload
firewall-cmd --reload
##检查是否生效
firewall-cmd --zone=public --query-port=8080/tcp

1、ssh互信

1、修改配置文件

sudo vim /etc/ssh/sshd_config
#将以下内容前的#号去掉
RSAAuthentication yes
PubkeyAuthentication yes
#重启ssh服务
systemctl restart sshd
AuthorizedKeysFile      .ssh/authorized_keys

2、通过密码传输公钥(云主机默认没设置密码,需要去网页设置)

scp /root/.ssh/id_rsa.pub root@worker1:/root/.ssh/id_rsa.pub.master

3、追加到对应认证秘钥中

cat /root/.ssh/id_rsa.pub.master >>/root/.ssh/authorized_keys

2、mysql安装

#before installation,we need to uninstall mariadb
rpm -qa | grep -i mariadb
# the edition might be different
rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64
#download the mysql
 wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.23-1.el7.x86_64.rpm-bundle.tar
#mysql need the support by perl
yum install perl -y
# installation
rpm -ivh mysql-community-common-5.7.23-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.23-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.23-1.el7.x86_64.rpm
rpm install libaio
rpm -ivh mysql-community-server-5.7.23-1.el7.x86_64.rpm
#init
systemctl start mysqld.service
# query the temporary password
cat /var/log/mysqld.log |grep temporary
# log in 
mysql -u root -p 
# change the password
set password = passsord('××××××××××××');
# allow the remote access 
grant all privileges on *.* to 'root' @'%' identified by '×××××××××××';
flush privileges;
#开启3306端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent  
#刷新防火墙
firewall-cmd --reload  
#设置开机自启动
chkconfig mysqld on

猜你喜欢

转载自blog.csdn.net/u011809553/article/details/83479140