本次实践为个人测试环境,操作系统版本为centos7.6。
hostname | 本地P地址 | 操作系统版本 | 内核版本 | python版本 |
---|---|---|---|---|
jeven | 192.168.3.166 | centos 7.6 | 3.10.0-957.el7.x86_64 v16.17.0 | 3.6.8 |
1.本次实践部署环境为个人测试环境;
2.在centos7.6环境下安装my-mind思维导图工具。
检查本地操作系统版本
[root@jeven ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
检查系统内核版本
[root@jeven ~]# uname -r
3.10.0-957.el7.x86_64
检查默认的80端口,以及my-mind服务的自定义端口7899端口是否被占用。
[root@jeven ~]# ss -tunlp |grep 80
udp UNCONN 0 0 fe80::8a83:7297:7cb8:9934%ens33:546 :::* users:(("dhclient",pid=119624,fd=5))
tcp LISTEN 0 128 127.0.0.1:3880 *:* users:(("fastgithub",pid=8948,fd=131))
tcp LISTEN 0 128 *:6000 *:* users:(("X",pid=10807,fd=6))
tcp LISTEN 0 128 ::1:3880 :::* users:(("fastgithub",pid=8948,fd=132))
tcp LISTEN 0 128 :::6000 :::* users:(("X",pid=10807,fd=5))
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 tmp]# yum repolist all |grep enable
!base/7/x86_64 CentOS-7 - Base - m enabled: 10,072
!extras/7/x86_64 CentOS-7 - Extras - enabled: 518
!mysql-connectors-community/x86_64 MySQL Connectors Co enabled: 227
!mysql-tools-community/x86_64 MySQL Tools Communi enabled: 100
!mysql80-community/x86_64 MySQL 8.0 Community enabled: 425
!updates/7/x86_64 CentOS-7 - Updates enabled: 5,061
使用yum直接安装httpd服务
yum install httpd -y
systemctl disable firewalld && systemctl stop firewalld
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
创建网站目录
mkdir /var/www/myweb
在/etc/httpd/conf.d/目录下,新建mind.conf文件。编辑如下内容:
vim mind.conf
Listen 7899
<VirtualHost *:7899>
ServerName web2.mind.com
DocumentRoot /var/www/myweb
</VirtualHost>
systemctl enable --now httpd
systemctl restart httpd
[root@jeven conf.d]# 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 Fri 2023-08-18 18:17:16 CST; 15s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 130731 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
Tasks: 6
Memory: 2.9M
CGroup: /system.slice/httpd.service
├─130731 /usr/sbin/httpd -DFOREGROUND
├─130734 /usr/sbin/httpd -DFOREGROUND
├─130735 /usr/sbin/httpd -DFOREGROUND
├─130736 /usr/sbin/httpd -DFOREGROUND
├─130737 /usr/sbin/httpd -DFOREGROUND
└─130738 /usr/sbin/httpd -DFOREGROUND
Aug 18 18:17:16 jeven systemd[1]: Starting The Apache HTTP Server...
Aug 18 18:17:16 jeven systemd[1]: Started The Apache HTTP Server.
在网站根目录/var/www/myweb/,下载my-mind
git clone https://github.com/ondras/my-mind.git
重启httpd服务
systemctl restart httpd
查看监听端口7899
[root@jeven myweb]# ss -tunlp |grep 7899
tcp LISTEN 0 128 :::7899 :::* users:(("httpd",pid=130875,fd=6),("httpd",pid=130874,fd=6),("httpd",pid=130873,fd=6),("httpd",pid=130872,fd=6),("httpd",pid=130871,fd=6),("httpd",pid=130868,fd=6))
访问地址:http://192.168.3.166:7899/my-mind/
将IP地址替换为自己服务器的IP地址