don't dream your life, live your dreams !
Contents
#!/bin/bash ################################################## # PARAMETERS ################################################## database_name=mediawiki database_username=mediawiki database_password=mediawiki ################################################## # INSTALL MEDIAWIKI ################################################## echo "install prerequistes" dnf -y install php-mbstring php-xml php-intl php-gd texlive php-mysqli php-xcache echo "create database $database_name, user/password $database_username/$database_password": mysql --user=root --password=root -e "CREATE USER '$database_username'@'localhost' IDENTIFIED BY '$database_password';" mysql --user=root --password=root -e "CREATE DATABASE IF NOT EXISTS $database_name;" mysql --user=root --password=root -e "use $database_name; GRANT ALL PRIVILEGES ON $database_name.* TO '$database_username'@'localhost' WITH GRANT OPTION;" echo "download mediawiki" cd /tmp wget http://releases.wikimedia.org/mediawiki/1.26/mediawiki-1.26.4.tar.gz tar xvfz mediawiki-1.26.4.tar.gz mv mediawiki-1.26.4 /var/www/html/mediawiki echo "restart httpd" systemctl restart httpd.service myip=`hostname -I` echo "Now meet you here: http://$myip/mediawiki/"
The visualeditor extension can be found here : https://www.mediawiki.org/wiki/Extension:VisualEditor
# install required packages: yum -y install nodejs npm git # get parsoid: cd /opt npm install parsoid cat > /opt/node_modules/parsoid/localsettings.js << "EOF" 'use strict'; exports.setup = function(parsoidConfig) { parsoidConfig.setMwApi({ uri: 'http://srv-intranet/mediawiki/api.php', domain: 'localhost', prefix: 'localhost' }); }; EOF # open port 8000: firewall-cmd --permanent --zone=public --add-port=8000/tcp firewall-cmd --reload # add parsoid service: cat > /etc/systemd/system/parsoid.service << "EOF" [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/node_modules/parsoid ExecStart=/opt/node_modules/parsoid/bin/server.js KillMode=process Restart=on-success PrivateTmp=true StandardOutput=syslog EOF systemctl enable parsoid.service systemctl start parsoid.service |
Test
Test, if Parsoid is working: Go to a users computer and open in a browser http://srv-intranet:8000/_wikitext/.
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”.
https://www.centos.org/forums/viewtopic.php?f=47&t=53223&p=225372#p225372
In your LocalSettings.php add this :
require_once "$IP/extensions/VisualEditor/VisualEditor.php"; // 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; // Linking with Parsoid $wgVirtualRestConfig['modules']['parsoid'] = array( // URL to the Parsoid instance 'url' => 'http://srv-intranet:8000', // Parsoid "domain", see below (optional, must be se same as /opt/node_modules/parsoid/localsettings.js) 'domain' => 'localhost', // Parsoid "prefix", see below (optional, must be se same as /opt/node_modules/parsoid/localsettings.js) 'prefix' => 'localhost' ); |
In LocalSettings.php:
wfLoadExtension( 'SyntaxHighlight_GeSHi' ); |
And install python-pygments :
yum install python-pygments |
cd /var/www/html/mediawiki/extensions git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/UniversalLanguageSelector.git |
require_once "$IP/extensions/UniversalLanguageSelector/UniversalLanguageSelector.php"; |
Copyright © 2024 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.
admin