Linux system deployment Linux command encyclopedia search tool
1. Introduction to linux-command
Linux command encyclopedia search tool (linux-command), which includes Linux command manuals, detailed explanations, learning, and collection. linux-command is a very practical Linux command query tool, suitable for all types of Linux users, especially those who do not have a good grasp of Linux commands.
2. Introduction to this practice
2.1 Local environment planning
This practice is a personal test environment, and the operating system version is centos7.6.
hostname | IP address | Operating system version | Kernel version |
---|---|---|---|
jeven | 192.168.3.166 | centos 7.6 | 3.10.0-957.el7.x86_64 |
2.2 Introduction to this practice
1. The deployment environment for this practice is a personal test environment, please be cautious about the production environment;
2. Deploy the Linux command encyclopedia search tool (linux-command) in the centos7.6 environment.
3. Install httpd software
3.1 Check the yum repository
If there is no mirror source, you can use Alibaba Cloud's mirror source.
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
Check the status of the yum warehouse to ensure that each mirror source is normal.
[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 Install httpd software
Use yum directly to install the httpd software.
yum -y install httpd
3.3 Start httpd service
Start the httpd service and enable it to start automatically at boot.
systemctl start httpd
systemctl enable httpd
3.4 Check httpd service status
Check the httpd service to ensure that the httpd service is running normally.
[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 Firewall and selinux settings
- Set up selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
- Turn off the firewall. If you want to turn on the firewall, you need to allow port 80.
systemctl stop firewalld && systemctl disable firewalld
3.6 Browser testing web services
Open the browser: http://192.168.3.166 and replace the IP with your own server IP address.
4. Install linux-command
4.1 Enter the website root directory
Go to the website root directory
[root@jeven ~]# cd /var/www/html/
[root@jeven html]#
4.2 Download linux-command
Use the following command to download the gh-pages branch code on github of linux-command.
git clone https://github.com/jaywcjlove/linux-command.git
4.3 View linux-command content
View linux-command content
[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 Restart the httpd service
Restart httpd service
systemctl restart httpd
5. Access linux-command
5.1 Visit the linux-command home page
Access address: http://192.168.3.166/linux-command/, replace the IP address with your own server IP address.
5.2 Query Linux commands
To query Linux commands, for example, to query the usage of the ping command, enter "ping" in the search box, and you will get the detailed usage of the ping command.