Showdoc是一款在线文档工具,支持Markdown语法,可以用于快速记录、分享和协作文档。它拥有简洁的界面和丰富的功能,包括在线编辑、多人协作、讨论评论、版本管理、权限管理等特性。
本次实践为个人测试环境,服务器操作系统版本为centos7.6。
客户端助手版本为win10。
hostname | IP地址 | 操作系统版本 | 内核版本 | Teleport版本 |
---|---|---|---|---|
jeven | 192.168.3.166 | centos 7.6 | 3.10.0-957.el7.x86_64 | 3.6.4-b3 |
1.本次实践部署环境为个人测试环境;
2.在centos7.6环境下安装showdoc文档工具。
检查本地操作系统版本
[root@jeven ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
检查系统内核版本
[root@jeven ~]# uname -r
3.10.0-957.el7.x86_64
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@jeven yum.repos.d]# yum repolist all |grep enable
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com enabled: 10,072
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com enabled: 515
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com enabled: 4,996
使用使用yum安装httpd
[root@jeven yum.repos.d]# yum -y install httpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-99.el7.centos.1 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-99.el7.centos.1 for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-7.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7_9.1 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-99.el7.centos.1 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================
Installing:
httpd x86_64 2.4.6-99.el7.centos.1 updates 2.7 M
Installing for dependencies:
apr x86_64 1.4.8-7.el7 base 104 k
apr-util x86_64 1.5.2-6.el7_9.1 updates 92 k
httpd-tools x86_64 2.4.6-99.el7.centos.1 updates 94 k
mailcap noarch 2.1.41-2.el7 base 31 k
Transaction Summary
=======================================================================================================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 3.0 M
Installed size: 10 M
Downloading packages:
(1/5): apr-1.4.8-7.el7.x86_64.rpm | 104 kB 00:00:00
(2/5): apr-util-1.5.2-6.el7_9.1.x86_64.rpm | 92 kB 00:00:00
(3/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00
(4/5): httpd-tools-2.4.6-99.el7.centos.1.x86_64.rpm | 94 kB 00:00:00
(5/5): httpd-2.4.6-99.el7.centos.1.x86_64.rpm | 2.7 MB 00:00:06
-------------------------------------------------------------------------------------------------------------------------------------------------------
Total 474 kB/s | 3.0 MB 00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-7.el7.x86_64 1/5
Installing : apr-util-1.5.2-6.el7_9.1.x86_64 2/5
Installing : httpd-tools-2.4.6-99.el7.centos.1.x86_64 3/5
Installing : mailcap-2.1.41-2.el7.noarch 4/5
Installing : httpd-2.4.6-99.el7.centos.1.x86_64 5/5
Verifying : httpd-2.4.6-99.el7.centos.1.x86_64 1/5
Verifying : mailcap-2.1.41-2.el7.noarch 2/5
Verifying : apr-1.4.8-7.el7.x86_64 3/5
Verifying : httpd-tools-2.4.6-99.el7.centos.1.x86_64 4/5
Verifying : apr-util-1.5.2-6.el7_9.1.x86_64 5/5
Installed:
httpd.x86_64 0:2.4.6-99.el7.centos.1
Dependency Installed:
apr.x86_64 0:1.4.8-7.el7 apr-util.x86_64 0:1.5.2-6.el7_9.1 httpd-tools.x86_64 0:2.4.6-99.el7.centos.1 mailcap.noarch 0:2.1.41-2.el7
Complete!
systemctl enable --now httpd
[root@jeven yum.repos.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 Thu 2023-06-22 16:39:57 CST; 35s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 45406 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
Tasks: 6
Memory: 2.9M
CGroup: /system.slice/httpd.service
├─45406 /usr/sbin/httpd -DFOREGROUND
├─45407 /usr/sbin/httpd -DFOREGROUND
├─45408 /usr/sbin/httpd -DFOREGROUND
├─45409 /usr/sbin/httpd -DFOREGROUND
├─45410 /usr/sbin/httpd -DFOREGROUND
└─45411 /usr/sbin/httpd -DFOREGROUND
Jun 22 16:39:51 jeven systemd[1]: Starting The Apache HTTP Server...
Jun 22 16:39:57 jeven systemd[1]: Started The Apache HTTP Server.
systemctl stop firewalld && systemctl disable firewalld
firewall-cmd --zone=public --permanent --add-port=80/tcp
firewall-cmd --reload
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
getenforce
在本地浏览器,访问http://192.168.3.166/,实际请将IP替换为自己服务器的IP地址。
网站内容可以正常打开,表示httpd服务是正常的。
直接使用yum安装php及其相关模块。
yum -y install php php-gd php-mbstring php-pdo
编辑info.php测试文件
[root@jeven ~]# cat /var/www/html/info.php
<?php
phpinfo();
?>
重启hhtpd服务
systemctl restart httpd
在浏览器,http://192.168.3.166/info.php
现以下页面,表示php安装正常。
创建ShowDoc软件包的下载目录
[root@jeven ~]# mkdir -p /data/showdoc
[root@jeven ~]# cd /data/showdoc/
下载ShowDoc软件包
[root@jeven showdoc]# git clone https://github.com/star7th/showdoc.git
Cloning into 'showdoc'...
remote: Enumerating objects: 20220, done.
remote: Counting objects: 100% (1812/1812), done.
remote: Compressing objects: 100% (624/624), done.
remote: Total 20220 (delta 1259), reused 1643 (delta 1139), pack-reused 18408
Receiving objects: 100% (20220/20220), 21.71 MiB | 4.48 MiB/s, done.
Resolving deltas: 100% (11942/11942), done.
将showdoc下的内容移动到网站根目录下
mv -f showdoc/* /var/www/html/
将网站根目录/var/www/html的所属用户改为apache
chown -R apache:apache /var/www/html
重启httpd服务
systemctl restart httpd
访问:http://192.168.3.166/install/index.php,将IP替换为自己服务器的IP地址,
进入showdoc的初始配置页面,选择系统中文语言。
访问地址:http://192.168.3.166/web/#/
进入ShowDoc首页
http://192.168.3.166/web/#/user/login
默认账号密码showdoc/123456
打开首页的API等示例文档,可以看到展现效果,可以自己单独创建项目,管理各种文档,非常方便。
创建一个新项目,填写项目信息。
添加文档。编辑文本内容,这里直接使用默认模板来测试。
选择分享文档,复制文档链接。
打开分享文档链接,查看分享文档内容。
访问地址:http://192.168.3.166/web/#/admin/index
用户管理页面,新增用户,填写用户信息。
在项目管理页面,可以查看所有的项目。
可以对文档中的附件进行管理。
可以对本地站点进行基本设置。