2018年9月25日
摘要: 使用请参考:shell脚本 if的使用和判断条件 if判断语句 exit跳出判读语句 不加exit的结果 read -n(不换行) 判断是否输入的是数字 read age[[ $age =~ ^[0-9]+$ ]]if [ $? -ne 0 ]; then echo "你输入的不是一个数字" exi 阅读全文
posted @ 2018-09-25 23:27 阿小杜 阅读(19094) 评论(0) 推荐(0)
  2018年9月24日
摘要: 查看一下系统支持的shell # chsh -l # cat /etc/shells [root@localhost ~]# chsh -l /bin/sh /bin/bash /sbin/nologin /usr/bin/sh /usr/bin/bash /usr/sbin/nologin [ro 阅读全文
posted @ 2018-09-24 22:40 阿小杜 阅读(498) 评论(0) 推荐(0)
  2018年9月23日
摘要: 结构关系图 查看这两个防火墙文件 # cat /etc/hosts.deny # cat /etc/hosts.allow 查看Linux中防火墙的状态 某个服务是否能由tcpwraps来进行控制关键在于这个服务的模块 图形化界面firewall-config 命令行firewall-cmd 区域: 阅读全文
posted @ 2018-09-23 21:11 阿小杜 阅读(1535) 评论(0) 推荐(0)
  2018年9月20日
摘要: 一、RAID:Redundant Arrays of Independent Drives 价格便宜具有冗余能力的磁盘阵列(Inexpensive) 二、磁盘阵列功能: 在数组中任一颗磁盘故障时,仍可读出数据。 在数据重构时,将数据经过计算后重新置入新硬盘中。 三、使用RAID的好处: 通过把多个磁 阅读全文
posted @ 2018-09-20 20:05 阿小杜 阅读(605) 评论(0) 推荐(0)
  2018年9月19日
摘要: 首先添加三块硬盘 结构关系图 相关命令 查看磁盘 #fdisk -l 分区 #fdisk /dev/sda/ #n新建 ProMary主分区 extended扩展分区 #p查看 #q不保存退出 #w保存退出 创建物理卷 #pvcreate /dev/sdb1 /dev/sdb2 创建逻辑卷组 #vg 阅读全文
posted @ 2018-09-19 11:29 阿小杜 阅读(304) 评论(0) 推荐(0)
  2018年9月18日
摘要: scp远程复制 scp是 secure copy的缩写, scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令。 命令格式: scp local_file remote_username@remote_ip:remote_folder 本地到远端 # scp -r Discuz_X3.1 阅读全文
posted @ 2018-09-18 16:26 阿小杜 阅读(209) 评论(0) 推荐(0)
  2018年9月17日
摘要: 两台虚拟机,一台做服务端(server)用来存储,一台做客户端(client)用来访问。 注意,两台虚拟机都已经挂载完光盘,并配置好yum源。客户端client已经安装好lamp环境,服务端不做任何处理。 先到server端 #mkdir /opt/dvd 先挂载光盘 opt/dvd 关闭防火墙 查 阅读全文
posted @ 2018-09-17 11:52 阿小杜 阅读(613) 评论(0) 推荐(0)
  2018年9月15日
摘要: 先上传两个文件 上传到root目录 #yum install createrepo #createrepo . #ll #vi /etc/yum.repos.d/dvd.repo/dvd.repo 修改yum源如下 yum install -y httpd php php-mysql mariadb 阅读全文
posted @ 2018-09-15 15:15 阿小杜 阅读(302) 评论(0) 推荐(0)
  2018年9月13日
摘要: # yum install httpd httpd-devel mariadb-server mariadb-devel php php-mysql php-devel -y # systemctl start {httpd,mariadb} # systemctl status {httpd,ma 阅读全文
posted @ 2018-09-13 14:48 阿小杜 阅读(444) 评论(0) 推荐(0)
  2018年9月12日
摘要: systemctl stop httpd yum remove httpd (在做之前 先删掉httpd) 安装编译环境 yum -y groupinstall "Development Tools" "Server Platform Development" yum install -y apr* 阅读全文
posted @ 2018-09-12 11:39 阿小杜 阅读(191) 评论(0) 推荐(0)