Centos install Parosid

SELinux and Parosid

To run the VisualEditor and Parsoid on a CentOS7-Server, you need to do the following.
The requirement is a working MediaWiki (min. V1.25.x) setup. (Crate a LAMP setup on CentOS 7, RHEL 7, Fedora 22, or Scientific Linux 7)
1) Become root:

CODE: SELECT ALL
su -

Enter the root password
2) install node.js, npm, vim, Git and the SELinux policy python utilities:

CODE: SELECT ALL
yum install nodejs npm vim-enhanced git policycoreutils-python

Confirm with "y" if asked
4) make sure you are at roots home directory:

CODE: SELECT ALL
cd ~

5) Download the latest Parsoid form the Git:

CODE: SELECT ALL
git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid

6) Copy the Paroid to /opt:

CODE: SELECT ALL
cp -rv ~/parsoid /opt/

7) Go to /opt/parsoid/

CODE: SELECT ALL
cd /opt/parsoid/

8)Install Parsoid in node.js:

CODE: SELECT ALL
npm install

9) Create the file /opt/parsoid/api/localsettings.js :

CODE: SELECT ALL
vim /opt/parsoid/api/localsettings.js

10) press the "Insert" key and copy the following settings:

CODE: SELECT ALL
‘use strict‘;
exports.setup = function(parsoidConfig) {
        parsoidConfig.setMwApi(‘yourwiki‘, { uri: ‘http://base-url-of-your-wiki.com/api.php‘ });
};

Change the yourwiki to a identifier that is unique for your Wiki. You‘ll need this key later.
Change base-url-of-your-wiki.com to the base url that the users use in the browser.
Press "ESC" followed by ":wq!" and "Enter" to save and close vim.
11) Go to /opt/

CODE: SELECT ALL
cd ..

12) Set file system rights:

CODE: SELECT ALL
chown -Rv root:root parsoid
...
chmod -Rv u+rw,g+r,o+r parsoid
...

May check with: ls -l
13) Set SELinux labels on filesystem:

CODE: SELECT ALL
chcon -Rv --type=system_u:object_r:usr_t:s0 parsoid

May check with: ls -Z
14) Open port 8000 in the firewall:

CODE: SELECT ALL
firewall-cmd --permanent --zone=public --add-port=8000/tcp
firewall-cmd --reload

May check with: firewall-cmd --list-all | grep " ports"
15)Allow Apache to use port 8000:

CODE: SELECT ALL
semanage port -m -t http_port_t -p tcp 8000

May check with: semanage port -l | grep http_port_t
16) Allow Apace use the network to contact Parsoid:

CODE: SELECT ALL
setsebool httpd_can_network_connect 0

My check with: getsebool httpd_can_network_connect (should be "off")
17) create a systemd-daemon for Parsoid:

CODE: SELECT ALL
vi /etc/systemd/system/parsoid.service

18) press the "Insert" key and copy the following settings:

CODE: SELECT ALL
[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=root
Group=root
WorkingDirectory=/opt/parsoid
# EnvironmentFile=-/etc/parsoid/parsoid.env
ExecStart=/usr/bin/node /opt/parsoid/api/server.js
KillMode=process
Restart=on-success
PrivateTmp=true
StandardOutput=syslog

Press "ESC" followed by ":wq!" and "Enter" to save and close vim.
19) Start the Parsoid-daemon:

CODE: SELECT ALL
systemctl start parsoid.service

If the is no error message, everything should be OK.
20) Test, if Parsoid is working: Go to a users computer and open in a browser http://base-url-of-your-wiki.com:8000/_wikitext/. (Replace base-url-of-your-wiki.com to the base url that the users use in the browser.)
You should now be able to enter some Wiki-code in the form and Parsoid should render in to a correct HTML-page after a click on "Send data".
21) make sure you are at roots home directory:

CODE: SELECT ALL
cd ~

22) Download the VisualEditor:

CODE: SELECT ALL
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/VisualEditor.git

23) Download the UniversalLanguageSelector:

CODE: SELECT ALL
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/UniversalLanguageSelector.git

24) Copy the VisualEditor to the extensions directory of your MediaWiki:

CODE: SELECT ALL
cp -rV VisualEditor /var/www/your-mediawiki-installation/extensions/

Replace Media /var/www/your-mediawiki-installation with the real path.
25) Copy the UniversalLanguageSelector to the extensions directory of your MediaWiki:

CODE: SELECT ALL
cp -rV UniversalLanguageSelector /var/www/your-mediawiki-installation/extensions/

Replace Media /var/www/your-mediawiki-installation with the real path.
26) Edit the Settings of your MediaWiki:

CODE: SELECT ALL
vim /var/www/your-mediawiki-installation/LocalSettings.php

Replace Media /var/www/your-mediawiki-installation with the real path.
27) Go to the end of the file and enter:

CODE: SELECT ALL
# UniversalLanguageSelector
require_once "$IP/extensions/UniversalLanguageSelector/UniversalLanguageSelector.php";
#VisualEditor
require_once "$IP/extensions/VisualEditor/VisualEditor.php";
// Enable by default for everybody
$wgDefaultUserOptions[‘visualeditor-enable‘] = 1;
// Don‘t allow users to disable it
#$wgHiddenPrefs[] = ‘visualeditor-enable‘;
// OPTIONAL: Enable VisualEditor‘s experimental code features
#$wgDefaultUserOptions[‘visualeditor-enable-experimental‘] = 1;
// URL to the Parsoid instance
// MUST NOT end in a slash due to Parsoid bug
// Use port 8142 if you use the Debian package
$wgVisualEditorParsoidURL = ‘http://base-url-of-your-wiki.com:8000‘;
// Interwiki prefix to pass to the Parsoid instance
// Parsoid will be called as $url/$prefix/$pagename
$wgVisualEditorParsoidPrefix = ‘yourwiki‘;
# Namespces for VE
$wgVisualEditorNamespaces = array_merge(
        $wgContentNamespaces,
        array( * )
);
# Timeout for HTTP requests to Parsoid in seconds
$wgVisualEditorParsoidTimeout = 200;

Change the yourwiki to a identifier that is unique for your Wiki. You must use the same identification the in step 9!
Change base-url-of-your-wiki.com to the base url that the users use in the browser.
Press "ESC" followed by ":wq!" and "Enter" to save and close vim.
28) Enable the Parsoid-daemon to start on boot time:

CODE: SELECT ALL
systemctl enable parsoid.service

Should answer with:" ln -s ‘/etc/systemd/system/parsoid.service‘ ‘/etc/systemd/system/multi-user.target.wants/parsoid.service‘"
That‘s it!
It should work on CentOS 7, RHEL 7, Fedora 22, or Scientific Linux 7...

thomei
 

装了几天的wiki VisualEditor 插件没成功,百度谷歌找了很多资料都没搞定,无意中发现了这篇帖子,觉得很不错,虽然还是没成功,但是人家按这方法成功了,可能是我自己的问题。 由于文章来之不易,必须收藏下。

时间: 2024-11-08 17:19:07

Centos install Parosid的相关文章

CentOS install Desktop and Remotely access 远程管理Centos桌面 TigerVNC

Centos 安装完毕,但是通过windows 远程管理桌面: 当然我们可以通过secureCRT工具连接命令行,但是我希望通过windows 连接他们的远程桌面: 首先我们的保证 X windows等桌面环境安装成功: yum groupinstall -y "Desktop"   "Desktop Platform"   "Desktop Platform Development" "Fonts" "Genera

centos install shutter (How to enable Nux Dextop repository on CentOS or RHEL)

http://ask.xmodulo.com/enable-nux-dextop-repository-centos-rhel.html Question: I would like to install a RPM package which is available only in Nux Dextop repository. How can I set up Nux Dextop repository on CentOS or RHEL? Nux Dextop is a third-par

centos install jdk

方法一:手动解压JDK的压缩包,然后设置环境变量 1.在/usr/目录下创建java目录  [[email protected] ~]# mkdir/usr/java [[email protected] ~]# cd /usr/java 2.下载,然后解压 [[email protected] java]# curl -O http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz [[email

centos Install Docker

安装必备软件 yum -y install iptables  iptables-services net-tools vim wget 安装Dockeryum -y install docker 下载centos镜像docker pull centos 查看centos 镜像docker images centos 运行一个Docker容器docker run -i -t centos /bin/bash 搜索Ubuntu镜像docker search Ubuntu 显示正在运行的容器(需要先

centos install redmine (项目管理工具)

安装环境:Centos.mysql.Ruby.Apache.Redmine yum update yum -y groupinstall "Development Tools" yum -y install ntp zlib zlib-devel sqlite-devel httpd mysql-server mysql-devel curl curl-devel httpd-devel apr-devel apr-util-devel mlocate manlibxml2-devel

docker centos install

1. yum update 2. yum install -y yum-utils device-mapper-persistent-data lvm2 3. yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo(阿里仓库) 4 yum list docker-ce 5. yum install docker-ce 6. systemctl start docke

Centos install Python2.7

#get python2.7wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz #install pythontar zxvf Python-2.7.9.tgzcd Python-2.7.9./configuremakemake installcd ..rm -rf Python*

CentOS Install kafka

一.zookeeper集群安装 # 环境 192.168.190.152 192.168.190.153 192.168.190.154 Install jdk # tar zxvf jdk-8u65-linux-x64.tar.gz # mv jdk1.8.0_65 /usr/local/ # vi /etc/profile.d/jdk.sh JAVA_HOME=/usr/local/jdk1.8.0_65 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH

centos install rtl8188ce driver

1.导入公钥,注意大小写. rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org 2.安装ELRepo库. rpm -Uvh http://elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm 3.安装kmod-r8192ce. # yum install kmod-r8192ce 最后,重启系统,网络连接就出现无线网络了