wget https://nodejs.org/dist/v6.11.1/node-v6.11.1.tar.gz
tar xvf node-v6.11.1.tar.gz
yum install gcc-c++ -y
cd node-v6.11.1
./configure
make
make install
[root@localhost node-v6.11.1]# node -v
v6.11.1
[root@localhost node-v6.11.1]# npm -v
3.10.10
yum install -y policycoreutils-python
npm install -g cnpm --registry=https://registry.npm.taobao.org
cd /opt
git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid
cd parsoid/
cnpm install
touch /opt/parsoid/parsoid.env
cat /opt/parsoid/parsoid.env
PORT=8000
NODE_PATH=/opt/parsoid/node_modules
touch /usr/lib/systemd/system/parsoid.service
cat /usr/lib/systemd/system/parsoid.service
[Unit]
Description=Mediawiki Parsoid web service on node.js
Documentation=http://www.mediawiki.org/wiki/Parsoid
Wants=local-fs.target network.target
After=local-fs.target network.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
User=nobody
Group=nobody
WorkingDirectory=/opt/parsoid
EnvironmentFile=-/opt/parsoid/parsoid.env
ExecStart=/usr/local/bin/node /opt/parsoid/bin/server.js
KillMode=process
Restart=on-success
PrivateTmp=true
StandardOutput=syslog
systemctl start parsoid.service
systemctl status parsoid.service
● parsoid.service - Mediawiki Parsoid web service on node.js
Loaded: loaded (/usr/lib/systemd/system/parsoid.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2017-08-14 05:23:45 EDT; 6s ago
Docs: http://www.mediawiki.org/wiki/Parsoid
Main PID: 69022 (node)
CGroup: /system.slice/parsoid.service
├─69022 /usr/local/bin/node /opt/parsoid/bin/server.js
└─69032 /usr/local/bin/node /opt/parsoid/node_modules/_service-runner@2.3.0@service-runner/service-runner.js
systemctl enable parsoid.service
cd extensions
git clone -b REL1_29 https://gerrit.wikimedia.org/r/p/mediawiki/extensions/VisualEditor.git
cd VisualEditor
git submodule update --init
wfLoadExtension( 'VisualEditor' );
// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;
// Optional: Set VisualEditor as the default for anonymous users
// otherwise they will have to switch to VE
// $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
// Don't allow users to disable it
$wgHiddenPrefs[] = 'visualeditor-enable';
// OPTIONAL: Enable VisualEditor's experimental code features
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
编辑器使用参考连接:https://www.mediawiki.org/wiki/Help:VisualEditor/User_guide/zh