• Linux系统之部署Linux命令大全搜索工具


    一、linux-command介绍

    Linux命令大全搜索工具(linux-command),内容包含Linux命令手册、详解、学习、搜集。linux-command是一个非常实用的Linux命令查询工具,适用于各类Linux用户,特别是对Linux命令掌握程度不高的用户。

    二、本次实践介绍

    2.1 本地环境规划

    本次实践为个人测试环境,操作系统版本为centos7.6。

    hostnameIP地址操作系统版本内核版本
    jeven192.168.3.166centos 7.63.10.0-957.el7.x86_64

    2.2 本次实践介绍

    1.本次实践部署环境为个人测试环境,生产环境请谨慎;
    2.在centos7.6环境下部署Linux命令大全搜索工具(linux-command)。

    三、安装httpd软件

    3.1 检查yum仓库

    如果没有镜像源,可以使用阿里云的镜像源。

    curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
    sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
    
    • 1
    • 2

    检查yum仓库状态,确保各镜像源正常。

    [root@jeven ~]# yum repolist enabled
    Loaded plugins: fastestmirror, langpacks
    Determining fastest mirrors
     * epel: mirrors.bestthaihost.com
    repo id                                                                       repo name                                                                                  status
    !base/7/x86_64                                                                CentOS-7 - Base - mirrors.aliyun.com                                                       10,072
    !epel/x86_64                                                                  Extra Packages for Enterprise Linux 7 - x86_64                                             13,767
    !extras/7/x86_64                                                              CentOS-7 - Extras - mirrors.aliyun.com                                                        518
    !mongodb-org                                                                  MongoDB Repository                                                                            342
    !mysql-connectors-community/x86_64                                            MySQL Connectors Community                                                                    227
    !mysql-tools-community/x86_64                                                 MySQL Tools Community                                                                         100
    !mysql57-community/x86_64                                                     MySQL 5.7 Community Server                                                                    678
    !updates/7/x86_64                                                             CentOS-7 - Updates - mirrors.aliyun.com                                                     5,176
    repolist: 30,880
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    3.2 安装httpd软件

    直接使用yum安装httpd软件。

    yum -y install  httpd
    
    • 1

    在这里插入图片描述

    3.3 启动httpd服务

    启动httpd服务,并使开机自启。

    systemctl start httpd
    systemctl enable  httpd
    
    • 1
    • 2

    在这里插入图片描述

    3.4 查看httpd服务状态

    查看httpd服务,确保httpd服务正常运行。

    [root@jeven ~]# systemctl status httpd
    ● httpd.service - The Apache HTTP Server
       Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
       Active: active (running) since Mon 2023-10-02 00:50:04 CST; 33s ago
         Docs: man:httpd(8)
               man:apachectl(8)
     Main PID: 38291 (httpd)
       Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
       CGroup: /system.slice/httpd.service
               ├─38291 /usr/sbin/httpd -DFOREGROUND
               ├─38293 /usr/sbin/httpd -DFOREGROUND
               ├─38294 /usr/sbin/httpd -DFOREGROUND
               ├─38295 /usr/sbin/httpd -DFOREGROUND
               ├─38296 /usr/sbin/httpd -DFOREGROUND
               └─38297 /usr/sbin/httpd -DFOREGROUND
    
    Oct 02 00:50:03 jeven systemd[1]: Starting The Apache HTTP Server...
    Oct 02 00:50:04 jeven systemd[1]: Started The Apache HTTP Server.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    3.5 防火墙和selinux设置

    • 设置selinux
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    setenforce 0
    
    • 1
    • 2
    • 关闭防火墙,如果想要开启防火墙,需放行80端口。
    systemctl stop firewalld && systemctl disable firewalld
    
    • 1

    3.6 浏览器测试web服务

    浏览器打开:http://192.168.3.166,将IP替换为自己服务器IP地址。

    在这里插入图片描述

    四、安装linux-command

    4.1 进入到网站根目录

    进入到网站根目录

    [root@jeven ~]# cd /var/www/html/
    [root@jeven html]#
    
    • 1
    • 2

    4.2 下载linux-command

    使用以下命令,下载linux-command的github上gh-pages 分支代码。

    git clone https://github.com/jaywcjlove/linux-command.git
    
    • 1

    4.3 查看linux-command内容

    查看linux-command内容

    [root@jeven html]# ls ./linux-command
    c  contributors.html  CONTRIBUTORS.svg  css  hot.html  img  index.html  js  linux-command.docset.tgz  linux-command-docset.xml  list.html
    
    • 1
    • 2

    4.4 重启httpd服务

    重启httpd服务

     systemctl restart httpd
    
    • 1

    五、访问linux-command

    5.1 访问linux-command首页

    访问地址:http://192.168.3.166/linux-command/,将IP地址替换为自己服务器IP地址。

    在这里插入图片描述

    5.2 查询Linux命令

    查询Linux命令,例如查询ping命令的用法,搜索框输入“ping”,就会得到ping命令的详细用法。

    在这里插入图片描述

    在这里插入图片描述

  • 相关阅读:
    shell基础(2):编程基础之变量:全局/局部/shell变量(作用域、定义、操作)、位置参数、数组
    JWT 破解
    JAVA 设计模式篇
    .NET 纯原生实现 Cron 定时任务执行,未依赖第三方组件 (Timer 优化版)
    秒懂Hadoop和Spark联系与区别
    高伸缩高可用大并发可负载的网站架构
    Spring boot Actuator监控管理的快速入门和实战
    PMP_第7章章节试题
    A review of visual SLAM methods for autonomous driving vehicles
    Qt 5.12.12 静态编译(MinGW)
  • 原文地址:https://blog.csdn.net/jks212454/article/details/133467093