Skip to content

Instantly share code, notes, and snippets.

@kaitoii11
Last active September 15, 2017 14:26
Show Gist options
  • Save kaitoii11/96cbe5d90aae211adef0e04f82e4f7cc to your computer and use it in GitHub Desktop.
Save kaitoii11/96cbe5d90aae211adef0e04f82e4f7cc to your computer and use it in GitHub Desktop.
Install [Crowi](https://github.com/crowi/crowi) on CentOS with Elasticsearch and MongoDB

Install Crowi on CentOS with Elasticsearch and MongoDB

Environment

$ cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)

Intall Node.js to CentOS7

$ sudo yum install -y epel-release
$ sudo yum group install "Development Tools"
$ curl --fail -sSL -o setup-nodejs https://rpm.nodesource.com/setup_6.x
$ sudo bash setup-nodejs

*https://www.phusionpassenger.com/library/walkthroughs/deploy/nodejs/ownserver/nginx/oss/install_language_runtime.html

Install MongoDB to CentOS7

$ sudo vim /etc/yumd.repos.d/mongodb.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x 86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
$ sudo yum install -y mongodb-org
$ sudo systemctl start mongod
$ sudo systemctl enable mongod

*https://www.hugeserver.com/kb/install-mongodb-centos-6-7/

Setup MongoDB

$ mongo
> use crowi 

Install Elastic Search

$ sudo yum install -y java-1.8.0-openjdk
$ sudo vim /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=https://artifacts.elastic.co/packages/5.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

$ sudo yum install -y elasticsearch
$ sudo systemctl start elasticsearch
$ sudo systemctl enable elasticsearch
$ curl http://127.0.0.1:9200
{
  "name" : "VSXONLm",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "Z8UM2VxsQPiIO_tde9-xHg",
  "version" : {
  "number" : "5.6.0",
  "build_hash" : "781a835",
  "build_date" : "2017-09-07T03:09:58.087Z",
  "build_snapshot" : false,
  "lucene_version" : "6.6.0"
  },
"tagline" : "You Know, for Search"
}
$ sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-kuromoji

* https://www.server-world.info/en/note?os=CentOS_7&p=elasticstack&f=1

Start crowi

$ git clone https://github.com/crowi/crowi.git
$ cd crowi
$ git checkout v1.6.2
$ PASSWORD_SEED=[seed] MONGO_URI=mongodb://localhost/crowi npm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment