一、linux-command介绍
二、本次实践介绍
2.1 本地环境规划
2.2 本次实践介绍
三、安装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
[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
3.2 安装httpd软件
yum -y install httpd
3.3 启动httpd服务
systemctl start httpd
systemctl enable httpd
3.4 查看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.
3.5 防火墙和selinux设置
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
systemctl stop firewalld && systemctl disable firewalld
3.6 浏览器测试web服务
四、安装linux-command
4.1 进入到网站根目录
[root@jeven ~]# cd /var/www/html/
[root@jeven html]#
4.2 下载linux-command
git clone https://github.com/jaywcjlove/linux-command.git
4.3 查看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
4.4 重启httpd服务
systemctl restart httpd
五、访问linux-command
5.1 访问linux-command首页
5.2 查询Linux命令