zoukankan      html  css  js  c++  java
  • Linux基础系统优化

    1.查看yum源仓库
      ls /etc/yum.repos.d/

    2.查看CentOs-Base.repo文件
      [root@localhost yum.repos.d]# cat CentOS-Base.repo

    3.配置yum源
      https://opsx.alibaba.com/mirror
      找到这个网站,然后找到centos7
      执行下载阿里云yum源
        wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
        yum clean all 清空yum软件源
        yum makecache 生成缓存

    4.查看yum源仓库
      ls

    5.安装epel源,用于下载第三方额外的软件(nginx,redis等等)
      yum install -y epel-release #通过这条命令安装epel源,

    6.安装nginx软件测试
      yum install nginx -y

    7.系统服务管理命令
      启动nginx服务

        systemctl start nginx           启动nginx服务
        systemctl status nginx      查看nginx服务存活状态

        systemctl stop nginx      停止nginx服务

        systemctl restart nginx             重启nginx服务

    8.此时浏览器访问10.0.0.10:80

    9.有时安装好了,但是windows访问不了,nginx服务
      这就是防火墙的问题了
        1)关闭系统自带的selinux
          setenforce 0 临时关闭
          getenforce 查看selinux状态
          sed -i "s/enable/disable/" /etc/selinux/config
          永久关闭(需要重启) 但是!!!在生产环境公司服务器上,慎用!你可别瞎重启!!
        2)关闭软件防火墙 iptables/firewalld
          iptables -F 清空防火墙规则
          systemctl disable firewalld #禁止防火墙开机自启
          systemctl stop firewalld #关闭防火墙服务

    9.uname -r   查看内核版本

    1 [root@localhost yum.repos.d]# uname -r
    2 3.10.0-862.el7.x86_64

    10.cat /etc/redhat-release  查看linux发形版本

    1 [root@localhost yum.repos.d]# cat /etc/redhat-release
    2 CentOS Linux release 7.5.1804 (Core) 

    11.添加用户     

    1 [root@localhost yum.repos.d]# useradd wdd          添加wdd用户,并创建wdd用户组
    2 [root@localhost yum.repos.d]# passwd wdd           为用户wdd创建密码
    3 Changing password for user wdd.
    4 New password: 
    5 BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
    6 Retype new password: 
    7 passwd: all authentication tokens updated successfully.

      添加普通用时,会在/home/wdd  创建一个用户家目录

  • 相关阅读:
    vue /deep/ ::v-deep >>> 深度选择器
    雪碧图优缺点
    自适应高度文本框 react contenteditable
    textarea 高度自适应
    UMI.js开发知识总结
    flex布局下img图片变形的解决方法
    umi model 注册
    HEVC标准介绍
    《推荐系统》阅读笔记
    互联网名词诙谐解释
  • 原文地址:https://www.cnblogs.com/wdbgqq/p/9800563.html
Copyright © 2011-2022 走看看