Crowi的设置方法
安装Crowi1.6在CentOS7上的步骤。
验证环境
- CentOS 7.4 x64 (Minimal Install)
在系统设置之前的状态
# systemctl list-unit-files --type=service | grep enabled
autovt@.service enabled
chronyd.service enabled
crond.service enabled
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
getty@.service enabled
irqbalance.service enabled
lvm2-monitor.service enabled
microcode.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager.service enabled
rsyslog.service enabled
sshd.service enabled
systemd-readahead-collect.service enabled
systemd-readahead-drop.service enabled
systemd-readahead-replay.service enabled
tuned.service enabled
# getenforce
Disabled
安装需要的模块以进行设置
# yum install gcc-c++ make git krb5-devel
# rpm -qa | grep gcc-c++
gcc-c++-4.8.5-16.el7.x86_64
# rpm -qa | grep make
make-3.82-23.el7.x86_64
# rpm -qa | grep git-
git-1.8.3.1-12.el7_4.x86_64
# rpm -qa | grep krb5-devel
krb5-devel-1.15.1-8.el7.x86_64
安装Node.js
# curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
# yum install nodejs
# rpm -qa | grep nodejs
nodejs-6.11.3-1nodesource.x86_64
请参考:https://nodejs.org/ja/download/package-manager/
MongoDB的安装
由于yum安装将会安装旧版本,所以要改向新的仓库。
# vi /etc/yum.repos.d/mongodb.repo
# yum install mongodb-org
# rpm -qa | grep mongodb-org
mongodb-org-tools-3.4.9-1.el7.x86_64
mongodb-org-server-3.4.9-1.el7.x86_64
mongodb-org-mongos-3.4.9-1.el7.x86_64
mongodb-org-shell-3.4.9-1.el7.x86_64
mongodb-org-3.4.9-1.el7.x86_64
# systemctl enable mongod
# systemctl start mongod
# mongo
> use crowi
> quit()
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
请参考以下链接:https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/
安装Crowi
# git clone https://github.com/crowi/crowi.git
# cd crowi
# git tag
v1.0.3
v1.0.4
v1.1.1
v1.1.2
v1.2.0
v1.3.0
v1.3.1
v1.4.0
v1.5.0
v1.5.1
v1.5.2
v1.5.3
v1.6.0
v1.6.1
v1.6.2
# git checkout v1.6.2
# npm install
# npm run build
Crowi的服务转化
# vi /etc/systemd/system/crowi.service
# vi /etc/sysconfig/crowi
# systemctl daemon-reload
[Unit]
Description=Crowi
After=network.target mongod.service
[Service]
WorkingDirectory=/root/crowi
EnvironmentFile=/etc/sysconfig/crowi
ExecStart=/usr/bin/node app.js
[Install]
WantedBy=multi-user.target
PORT=3000
NODE_ENV=production
MONGO_URI="mongodb://localhost/crowi"
PASSWORD_SEED="`openssl rand -base64 128 | head -1`"
FILE_UPLOAD=local
启动Crowi
# systemctl start crowi
# systemctl enable crowi
确认Crowi的启动
打开网络浏览器,并访问以下URL:
http://Crowi服务器的IP地址:3000
请谘询
以下是中国本地化的中文翻译,只提供一种选择:
1. 第一个链接:https://qiita.com/bezeklik/items/48fe054c2df05f03f3d1
请点击此链接查看。
2. 第二个链接:https://qiita.com/nooby/items/9b197c2b666d6b8371e1
你可以点击这个链接来查看。