Parsoid Configuration

From ◜◝◟◞◜◝◟◞◜◝◟◞◜◝◟◞◜◝◟◞◜◝◟◞◜◝◟◞
Jump to: navigation, search
Installation

Parsoid Installation

Configuration

Configure the api/localsettings.js

cd api 
cp localsettings.js.example localsettings.js

Change the line to the correct settings on this line in localsettings.js

parsoidConfig.setMwApi('myspecialwiki', { uri: 'http://ip.address.or.url/api.php' });

Using this command starts the Parsoid web service from the /parsoid directory.

nodejs api/server.js

It will start, by default in localsettings.js, to listen on port 8000), however we want it to point to port 8142.

export INTERFACE=127.0.0.1
export PORT=8142 
nodejs api/server.js

Start node.js Automatically

sudo ln -s /lib/init/upstart-job /etc/init.d/parsoid
sudo nano /etc/init/parsoid.conf
description "Parsoid HTTP service"

start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]

setuid "www-data"
setgid "www-data"

env VCAP_APP_PORT="8000"
env NODE_PATH="/js/node_modules"

chdir "/path/to/parsoid"
exec nodejs api/server.js

respawn