From SME Server
Jump to: navigation, search
Warning.png Work in Progress:
This page is a Work in Progress. The contents off this page may be in flux, please have a look at this page history the to see list of changes.

this how to is to install wikimedia parsoid server on a SME9


install epel repo

yum install nodejs npm vim-enhanced git policycoreutils-python --enablerepo=epel
cd ~

Download the latest Parsoid form the Git:

git clone

Copy the Paroid to /opt:

cp -rv ~/parsoid /opt/

Go to /opt/parsoid/

cd /opt/parsoid/

Install Parsoid in node.js:

npm install

Create the file local settings :

mkdir /opt/parsoid/etc
cp /opt/parsoid/config.example.yaml /opt/parsoid/etc/config.yaml
vim /opt/parsoid/etc/config.yaml

set the required parameters

uri: ''

and optionals as per example

domain: ''  # optional

configure startup using deamontools

mkdir -p /var/services/parsoid/supervise
mkdir -p /var/services/parsoid/log/supervise
mkdir /var/log/parsoid
chown www:www /var/log/parsoid
touch /var/services/parsoid/down
cat  >/var/services/parsoid/run <<- EOM
exec 2>&1
exec \
   /usr/local/bin/setuidgid www \
   /usr/bin/node /opt/parsoid/parsoid.js \
   -c /opt/parsoid/etc/config.yaml \
   -n 1
# /usr/bin/node /opt/parsoid/parsoid.js --help
#Usage: /opt/parsoid/parsoid.js [command] [options]
#  docker-start  starts the service in a Docker container
#  docker-test   starts the test process in a Docker container
#  build         builds the service's package and deploy repo
#  -n, --num-workers  number of workers to start                     [default: -1]
#  -c, --config       YAML-formatted configuration file
#                                 [string] [default: "./config.yaml"]
#  -f, --force        force the operation to execute    [boolean] [default: false]
#  -d, --deploy-repo  build only the deploy repo        [boolean] [default: false]
#  -r, --review       send the patch to Gerrit after building the repo
#                                                       [boolean] [default: false]
#  --verbose          be verbose                        [boolean] [default: false]
#  -v, --version      print the service's version and exit
#                                                       [boolean] [default: false]
#  -h, --help         Display help                                 [boolean]    
chmod +x /var/services/parsoid/run
cat  >/var/services/parsoid/log/run <<- EOM
exec 					\
   /usr/local/bin/setuidgid www 	\
   /usr/local/bin/multilog t s5000000  \
chmod +x /var/services/parsoid/log/run

then add link

pushd /services
ln -s /var/services/parsoid 
pushd /etc/init.d/supervise/
ln -s ../daemontools parsoid
pushd /etc/rc.d/rc7.d/
ln -s  /etc/rc.d/init.d/e-smith-service S99parsoid

and set service

db configuration set parsoid service status enabled access localhost