rpm基本命令
- 1.安装一个包 命令:rpm -ivh
- 2.升级一个包 命令:rpm -Uvh
- 3.移走一个包 命令:rpm -e
- 4.查看安装包 命令 :rpm -qa | grep mysql
yum基本命令
- 1.使用YUM查找软件包 命令:yum search
- 2.列出所有可安装的软件包 命令:yum list
- 3.列出所有可更新的软件包 命令:yum list updates
- 4.列出所有已安装的软件包 命令:yum list installed
- 5.列出所有已安装但不在 Yum Repository 内的软件包 命令:yum list extras
- 6.列出所有软件包的信息 命令:yum info
- 7.列出所有可更新的软件包信息 命令:yum info updates
- 8.列出所有已安装的软件包信息 命令:yum info installed
- 9.列出所有已安装但不在 Yum Repository 内的软件包信息 命令:yum info extras
- 10.列出软件包提供哪些文件 命令:yum provides
查看所有端口
netstat -ntlp
查看端口是否占用
lsof -i:9091
rz sz 安装
yum install lrzsz -y
防止暴力破解
yum install fail2ban
vim /etc/fail2ban/jail.d/jail.local
#defalut这里是设定全局设置,如果下面的监控没有设置就以全局设置的值设置。
[DEFAULT]
# 用于指定哪些地址ip可以忽略 fail2ban 防御,以空格间隔。
ignoreip = 127.0.0.1/8
# 客户端主机被禁止的时长(默认单位为秒)
bantime = 3600
# 过滤的时长(秒)
findtime = 600
# 匹配到的阈值(次数)
maxretry = 3
[ssh-iptables]
# 是否开启
enabled = true
# 过滤规则
filter = sshd
# 动作
action = iptables[name=SSH, port=ssh, protocol=tcp]
# 日志文件的路径
logpath = /var/log/secure
# 匹配到的阈值(次数)
maxretry = 3
# 启动
systemctl start fail2ban.service
# 查看被禁止的ip
fail2ban-client status ssh-iptables
# 重新加载配置
fail2ban-client reload
mysql 安装
wget https://repo.mysql.com//mysql57-community-release-el7.rpm
rpm -Uvh mysql57-community-release-el7.rpm
yum repolist all | grep mysql
yum install mysql-community-server
systemctl start mysqld.service
grep 'password' /var/log/mysqld.log
mysql -uroot -p
alter user 'root'@'localhost' identified by '123qwe!@#QWE'
use mysql
update user set host = '%' where host = 'localhost'
flush privileges
rabbitmq安装
github上面有仓库的地址 https://github.com/rabbitmq/erlang-rpm 我们只需要将源配置好就可以了
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.12/rabbitmq-server-3.7.12-1.el7.noarch.rpm
vim /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1
yum clean all
yum makecache
yum install rabbitmq-server-3.7.12-1.el7.noarch.rpm
rabbitmq命令
启动RabbitMQ服务
systemctl start rabbitmq-server.service
关闭
rabbitmqctl stop
状态查看
rabbitmqctl status
启用插件
rabbitmq-plugins enable rabbitmq_management
重启服务
service rabbitmq-server restart
添加帐号:root 密码:root
rabbitmqctl add_user root root
赋予其administrator角色
rabbitmqctl set_user_tags root administrator
设置权限
rabbitmqctl set_permissions -p / root ".*" ".*" ".*"
访问
http://129.204.2.246:15672/