随笔分类 -  Linux基础

课堂作业与周作业
摘要:一、wordpress 5.7.2更新到5.8.1 1.备份数据库 [root@localhost ~]# mkdir -pv /backup/wp/ mkdir: created directory ‘/backup’ mkdir: created directory ‘/backup/wp/’ 阅读全文
posted @ 2021-11-19 09:14 人生值得 阅读(189) 评论(0) 推荐(0)
摘要:##编译安装LAMP 1.环境准备 ##系统版本 [root@lamp ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) ##软件版本 httpd-2.4.43.tar.gz apr-1.7.0.tar.bz2 apr- 阅读全文
posted @ 2021-08-20 10:12 人生值得 阅读(101) 评论(0) 推荐(0)
摘要:##1.配置nginx反向代理,实现api.x.com域名代理本地9001端口 1.准备nginx安装环境 [root@nginx ~]# systemctl stop firewalld [root@nginx ~]# setenforce 0 [root@nginx ~]# yum instal 阅读全文
posted @ 2021-08-17 10:37 人生值得 阅读(277) 评论(0) 推荐(0)
摘要:##1.编译安装LNMP,并安装wordpress 1.准备nginx安装环境 [root@lnmp ~]# systemctl stop firewalld [root@lnmp ~]# setenforce 0 [root@lnmp ~]# yum -y install gcc pcre-dev 阅读全文
posted @ 2021-08-16 17:52 人生值得 阅读(121) 评论(0) 推荐(0)
摘要:##一.简述lvs四种集群特点及使用场景。 1.LVS的NAT模式 lvs-nat:本质是多目标IP的DNAT,通过将请求报文中的目标地址和目标端口修改为某挑出的RS的RIP和 PORT实现转发 (1)RIP和DIP应在同一个IP网络,且应使用私网地址;RS的网关要指向DIP (2)请求报文和响应报 阅读全文
posted @ 2021-07-27 16:39 人生值得 阅读(277) 评论(0) 推荐(0)
摘要:##一.实现基于MYSQL验证的vsftpd虚拟用户访问 1.部署环境 一台做为FTP服务器,CentOS 7 IP:10.50.100.22 一台做MySQL 数据库服务器 IP:10.50.100.7 关闭两台服务器上防火墙设置 [root@ftp ~]# systemctl stop fire 阅读全文
posted @ 2021-07-13 15:05 人生值得 阅读(298) 评论(0) 推荐(0)
摘要:##一.部署分离的LAMP,部署到二台服务器上,php加载xcache模块 1.部署环境 HOST IP SOFTWARE PLATFORM 主机1 10.50.100.20 httpd+php+xcache CentOS7 主机2 10.50.100.22 mariadb CentOS7 关闭Fi 阅读全文
posted @ 2021-06-11 16:29 人生值得 阅读(141) 评论(0) 推荐(0)
摘要:##1.使用ansible的playbook实现自动化安装httpd 配置ansible主机文件 [root@localhost ~]# vim /etc/ansible/hosts [websrvs] 10.50.100.8 配置ansible与管理端的ssh连接 [root@localhost 阅读全文
posted @ 2021-05-12 15:55 人生值得 阅读(437) 评论(0) 推荐(0)
摘要:##1.编写脚本,支持让用户自主选择,使用mysqldump还是xtraback全量备份。 ##实现备份,需要开启数据库二进制日志 [root@localhost ~]# vim /etc/my.cnf.d/mariadb-server.cnf [mysqld] log-bin [root@loca 阅读全文
posted @ 2021-04-15 14:53 人生值得 阅读(101) 评论(0) 推荐(0)
摘要:##1. 导入hellodb.sql生成数据库 (1) 在students表中,查询年龄大于25岁,且为男性的同学的名字和年龄 MariaDB [hellodb]> select name,age from students where age > 25 and gender='M'; + + + 阅读全文
posted @ 2021-03-01 17:34 人生值得 阅读(110) 评论(0) 推荐(0)
摘要:二进制格式安装mariadb-10.2.36 ##1.官网(www.mariadb.org)下载二进制包,以及查看系统版本。 [root@localhost mysql]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) ## 阅读全文
posted @ 2021-01-13 15:39 人生值得 阅读(322) 评论(0) 推荐(0)
摘要:##1.简述DNS服务器原理,并搭建主-辅服务器。 DNS工作原理: 第一步:客户机提出域名解析请求,并将该请求发送给本地的域名服务器。 第二步:当本地的域名服务器收到请求后,就先查询本地的缓存,如果有该纪录项,则本地的域名服务器就直接把查询的结果返回。 第三步:如果本地的缓存中没有该纪录,则本地域 阅读全文
posted @ 2021-01-12 16:05 人生值得 阅读(172) 评论(0) 推荐(0)
摘要:##1.配置chrony服务,实现服务器时间自动同步 [root@localhost ~]# dnf install -y chrony [root@localhost ~]# systemctl enable --now chronyd [root@localhost ~]# systemctl 阅读全文
posted @ 2020-12-24 16:21 人生值得 阅读(256) 评论(0) 推荐(0)
摘要:##1.编写脚本selinux.sh,实现开启或禁用SELinux功能。 [root@localhost ~]#bash SElinux.sh ###################################################### Current status: SELinux 阅读全文
posted @ 2020-11-13 10:29 人生值得 阅读(271) 评论(0) 推荐(0)
摘要:##1.编写脚本,接受二个位置参数,magedu和/www,判断系统是否有magedu,如果没有则自动创建magedu用户,并自动设置家目录为/www。 [root@localhost /data]#./createusertest.sh Please Input 2 Args,Usage:./cr 阅读全文
posted @ 2020-11-10 13:26 人生值得 阅读(232) 评论(0) 推荐(0)
摘要:##1.文件host_list.log 如下格式,请提取”.magedu.com”前面的主机名部分并写入到回到该文件中。 1 www.magedu.com 2 blog.magedu.com 3 study.magedu.com 4 linux.magedu.com 5 python.magedu. 阅读全文
posted @ 2020-11-06 17:28 人生值得 阅读(230) 评论(0) 推荐(0)
摘要:##1.每周的工作日1:30,将/etc备份至/backup目录中,保存的文件名称格式为“etcbak-yyyy-mm-ddHH.tar.xz”,其中日期是前一天的时间。 [root@localhost /data/scripts]#cat etc_backup.sh #!/bin/bash #** 阅读全文
posted @ 2020-10-21 17:09 人生值得 阅读(129) 评论(0) 推荐(0)
摘要:##1.显示统计占用系统内存最多的进程,并排序. [root@localhost ~]#ps aux --sort -rss |head -5 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 6311 0.0 0.6 57381 阅读全文
posted @ 2020-10-16 16:19 人生值得 阅读(174) 评论(0) 推荐(0)
摘要:##1.编写函数,实现OS的版本判断。 [root@localhost /data/scripts]#bash os.sh os version is 7 [root@localhost /data/scripts]#cat os.sh #!/bin/bash #****************** 阅读全文
posted @ 2020-10-16 14:02 人生值得 阅读(205) 评论(0) 推荐(0)
摘要:##1.每隔3秒钟到系统上获取已经登录的用户的信息;如果发现用户hacker登录,则将登录时间和主机记录于日志/var/log/login.log中,并退出脚本。 [root@localhost /data/scripts]#bash !* bash while_hacker.sh ^C [root 阅读全文
posted @ 2020-09-29 15:03 人生值得 阅读(261) 评论(0) 推荐(0)