Centos7安装wiki.js

本文涉及的产品
云原生数据库 PolarDB PostgreSQL 版,标准版 2核4GB 50GB
云原生数据库 PolarDB MySQL 版,通用型 2核8GB 50GB
简介: Centos7安装wiki.js

3.*特性前瞻

  • 支持直接github同步
  • 更完善的用户管理系统
  • 页面关联功能增强可以更加容易配置文档之间的关联

wiki.js特点

  • 强大的编辑器
  • 预置了多种网站分析工具,如baidu,google,yandex
  • 支持标签功能

安装node.js和wiki.js

安装依赖

yum groupinstall -y"Development"yum install -y gcc-c++make

安装node14

curl-sL https://rpm.nodesource.com/setup_14.x | sudo-Ebash-yum install -y nodejs

编译安装2.21版本的git

yum install -y gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel curl-devel
cd /tmp
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz && tar zxvf git-2.21.0.tar.gz
rm git-2.21.0.tar.gz
cd git-2.21.0/
./configure makeprefix=/usr/local all
makeprefix=/usr/local install

添加postgrelsql库并安装

yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install postgresql13 postgresql13-server postgresql13-contrib

创建postgresql目录并启动

mkdir-p /data0/pgsql
chown-R postgres:postgres /data0/pgsql
sudo-u postgres /usr/pgsql-13/bin/initdb -D /data0/pgsql
mkdir-p /var/log/pgsql
chown-R postgres:postgres /var/log/pgsql
sudo-u postgres /usr/pgsql-13/bin/pg_ctl -D /data0/pgsql -l /var/log/pgsql/server.log start

下载安装wiki.js

cd /tmp
wget https://github.com/Requarks/wiki/releases/download/2.5.170/wiki-js.tar.gz
mkdir wiki
tar xzf wiki-js.tar.gz -C ./wiki
mv wiki /usr/local/
rm-rf wiki-js.tar.gz
cd /usr/local/wiki
mv config.sample.yml config.yml

修改config

vim config.yml
# bindIP  bindIP: 127.0.0.1
# 配置HTTP端口  port: 3000# 配置数据库  db:
  type: postgres
  host: localhost
  port: 5432  user: wikijs
  pass: wikijsrocks
  db: wiki
# 配置存储目录  dataPath: /data0/wiki

添加wiki服务

cat > /etc/systemd/system/wiki.service << EOF
[Unit]
Description=Wiki.js
After=network.target
[Service]
Type=simple
WorkingDirectory=/usr/local/wiki
ExecStart=/usr/bin/node server
Restart=always
# Consider creating a dedicated user for Wiki.js here:User=root
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload

设置rc-local开机服务

cat > /etc/rc.local << EOF
#!/bin/bash# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES## It is highly advisable to create own systemd services or udev rules# to run scripts during boot instead of using this file.## In contrast to previous versions due to parallel execution during boot# this script will NOT be run after all other services.## Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure# that this script will be executed during boot.touch /var/lock/subsys/local
sudo-u postgres /usr/pgsql-13/bin/pg_ctl -D /data0/pgsql -l /var/log/pgsql/server.log startEOF
chmod+x /etc/rc.local
cat > /etc/systemd/system/rc-local.service << EOF
[Unit]
Description=/etc/rc.d/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.d/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local startTimeoutSec=0RemainAfterExit=yesEOF
systemctl daemon-reload

编译安装nginx1.19.17

安装依赖

yum install -y epel-release
yum install -y perl perl-devel perl-ExtUtils-Embed libxslt libxslt-devel libxml2 libxml2-devel gd gd-devel GeoIP GeoIP-devel
yum install -ywget pcre-devel pcre zlib openssl openssl-devel

下载源码并编译

cd /root
git clone https://github.com/google/ngx_brotli.git
cd ngx_brotli/
git submodule update --init
cd /tmp
wget http://nginx.org/download/nginx-1.19.7.tar.gz
tar zxf nginx-1.19.7.tar.gz
cd nginx-1.19.7
./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-compat--with-file-aio--with-ipv6--with-http_ssl_module--with-http_v2_module--with-http_realip_module--with-stream_ssl_preread_module--with-http_addition_module--with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module--with-http_dav_module--with-http_flv_module--with-http_mp4_module--with-http_gunzip_module--with-http_gzip_static_module--with-http_random_index_module--with-http_secure_link_module--with-http_degradation_module--with-http_slice_module--with-http_stub_status_module--with-http_perl_module=dynamic --with-http_auth_request_module--with-mail=dynamic --with-mail_ssl_module--with-pcre--with-pcre-jit--with-stream=dynamic --with-stream_ssl_module--with-debug--add-module=/root/ngx_brotli
make && make install

添加nginx服务

cat > /usr/lib/systemd/system/nginx.service << EOF
[Unit]
Description=nginx - high performance web server
Documentation=https://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t-c /etc/nginx/nginx.conf
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/bin/kill -s HUP
ExecStop=/bin/kill -s TERM
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload


相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
相关文章
|
5天前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
54 25
|
15天前
|
监控 Linux PHP
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
65 20
|
1月前
|
存储 分布式计算 Hadoop
Centos7.9安装kerberos
Centos7.9安装kerberos
86 25
|
1月前
|
存储 Shell 网络安全
Centos7.9安装openldap
Centos7.9安装openldap
58 16
|
1月前
|
数据可视化 Linux 应用服务中间件
Centos7.9安装phpldapadmin
Centos7.9安装phpldapadmin
62 15
|
1月前
|
网络协议 Java 应用服务中间件
centos7环境下tomcat8的安装与配置
本文介绍了在Linux环境下安装和配置Tomcat 8的详细步骤。首先,通过无网络条件下的文件交互软件(如Xftp 6或MobaXterm)下载并解压Tomcat安装包至指定路径,启动Tomcat服务并测试访问。接着,修改Tomcat端口号以避免冲突,并部署Java Web应用项目至Tomcat服务器。最后,调整Linux防火墙规则,确保外部可以正常访问部署的应用。关键步骤包括关闭或配置防火墙、添加必要的端口规则,确保Tomcat服务稳定运行。
|
3月前
|
Web App开发 JavaScript 前端开发
2024年5月node.js安装(winmac系统)保姆级教程
本篇博客为2024年5月版Node.js安装教程,适用于Windows和Mac系统。作者是一名熟悉JavaScript与Vue的大一学生,分享了Node.js的基本介绍、下载链接及简单安装步骤。安装完成后,通过终端命令`node -v`验证版本即可确认安装成功。欢迎关注作者,获取更多技术文章。
60 2
2024年5月node.js安装(winmac系统)保姆级教程
|
3月前
|
SQL 存储 Linux
从配置源到数据库初始化一步步教你在CentOS 7.9上安装SQL Server 2019
【11月更文挑战第16天】本文介绍了在 CentOS 7.9 上安装 SQL Server 2019 的详细步骤,包括配置系统源、安装 SQL Server 2019 软件包以及数据库初始化,确保 SQL Server 正常运行。
168 4
|
4月前
|
Linux 网络安全 数据安全/隐私保护
Linux系统之Centos7安装cockpit图形管理界面
【10月更文挑战第12天】Linux系统之Centos7安装cockpit图形管理界面
187 1
Linux系统之Centos7安装cockpit图形管理界面
|
3月前
|
SQL 存储 Linux
从配置源到数据库初始化一步步教你在CentOS 7.9上安装SQL Server 2019
【11月更文挑战第8天】本文介绍了在 CentOS 7.9 上安装 SQL Server 2019 的详细步骤,包括系统准备、配置安装源、安装 SQL Server 软件包、运行安装程序、初始化数据库以及配置远程连接。通过这些步骤,您可以顺利地在 CentOS 系统上部署和使用 SQL Server 2019。
178 1

热门文章

最新文章