Install wiki on linux

Manual : Running MediaWiki on Debian or Ubuntu

This page documents how to install MediaWiki using the release tarballs. If you want to use system packages, and are not installing on Raspbian see Debian packages .

This page explains how to install MediaWiki on a Debian or Ubuntu GNU/Linux server. The instructions below refer to Debian, but unless otherwise noted also apply to Ubuntu and Raspbian.

Introduction [ edit ]

This installation procedure requires knowledge of issuing commands from a terminal (e.g. installing applications) and using a text editor (e.g. graphical: gedit, kate; text: nano, emacs, vi).

When text editing is required it can be carried out on the graphical desktop by pressing Alt-F2 and typing

Alternatively, editing can be done from a terminal

Of course, kate could be used instead of gedit or vi/emacs instead of nano.

Step-by-step [ edit ]

Ensure Debian is up-to-date [ edit ]

Double check that Debian is up-to-date by running:

sudo apt update sudo apt upgrade
sudo apt update && sudo apt upgrade

Install LAMP stack [ edit ]

Ubuntu Server Edition makes LAMP (Apache, PHP, and MySQL) available for installation during the install process. During the installation step, make sure you choose to install a LAMP server. Alternately, you can install all of these packages from a standard installation using these commands:

sudo apt-get install apache2 mariadb-server php php-mysql libapache2-mod-php php-xml php-mbstring
sudo apt-get install apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-mbstring

Optional useful packages [ edit ]

These packages are not necessary but may be useful, depending on the installation:

Name Package Description
Alternative PHP Cache php-apcu Modern MediaWiki versions will automatically take advantage of this being installed for improved performance.
PHP Unicode normalization php-intl MediaWiki will fallback to a slower PHP implementation if not available.
ImageMagick imagemagick Image thumbnailing.
Inkscape inkscape Alternative means of SVG thumbnailing, than ImageMagick. Sometimes it will render SVGs better if originally created in Inkscape.
PHP GD library php-gd Alternative to ImageMagick for image thumbnailing.
PHP command-line php-cli Ability to run PHP commands from the command line, which is useful for debugging and running maintenance scripts.
PHP cURL php-curl Required by some extensions such as Extension:Math . See Manual:cURL
git source control version git If not present config script will tell you that it is not installed
Basic Calculator php-bcmath In order to make the visualeditor work on 32bit machines, like a raspi
Читайте также:  Linux установка midnight commander

You can install any of the above with sudo apt-get install packagename . If you want to install all of them: sudo apt-get install php-apcu php-intl imagemagick inkscape php-gd php-cli php-curl php-bcmath git If you install php-apcu you will have to reload your apache configuration in order to avoid a warning message when running configuration script: sudo service apache2 reload

Get MediaWiki [ edit ]

This can be done from a browser or by command line

tar -xvzf /tmp/mediawiki-*.tar.gz sudo mkdir /var/lib/mediawiki sudo mv mediawiki-*/* /var/lib/mediawiki

Configuring MySQL [ edit ]

But before proceeding with the initial MediaWiki installation, there are certain steps you need to do first!

On Raspbian, if this is a new installation of mariadb you will also need to run: sudo mysqld_safe —skip-grant-tables —skip-networking &

# sudo mysql -u root -p Enter password: Enter password of mysql root user (if you have not configured password it will be blank, so just press enter) mysql> CREATE USER 'new_mysql_user'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED'; mysql> quit;
# sudo mysql -u root -p mysql> CREATE DATABASE my_wiki; mysql> use my_wiki; Database changed
mysql> GRANT ALL ON my_wiki.* TO 'new_mysql_user'@'localhost'; Query OK, 0 rows affected (0.01 sec) mysql> commit; mysql> quit;

Optional: Configure PHP [ edit ]

These steps are optional and can be done post-installation. MediaWiki will still work without these changes.

Edit your PHP configuration file, php.ini . It is located at /etc/php/7.*/apache2/php.ini , depending on exact version of PHP.

Maximum upload file size [ edit ]

Assuming that various files are going to be uploaded to the Wiki as content, the limit on the maximum size of an upload has to be adjusted. About one-half way down is the File Uploads section. Change:

Memory limit [ edit ]

Some PHP scripts require a lot of memory to run. To increase the maximum amount of memory a script can use, page down to about 21%, and change the following entry, if found, from

Configure MediaWiki [ edit ]

Navigate your browser to http://localhost/mediawiki (for certain installations it may be http://localhost/mediawiki/config or http://wiki.hostname.com/config instead) and follow the procedure given. If this gives a 404 error then working a symbolic link should solve the issue.

sudo ln -s /var/lib/mediawiki /var/www/html/mediawiki

This can solve a lot of problems by specifically identifying the source of any errors.

It may complain that php extensions like mbstring and xml are missing even you have installed them. Please manually activate them by using:

sudo phpenmod mbstring sudo phpenmod xml sudo systemctl restart apache2.service

Fill out all the fields in the configuration form and press the continue button. Use the username and password which you provided as above in the mysql configuration section:

Читайте также:  Amon infrasonic driver linux

mysql> CREATE USER ‘new_mysql_user’@’localhost’ IDENTIFIED BY ‘THISpasswordSHOULDbeCHANGED’;

Under Database Config, you may change the database name and DB username to new values, but you must turn on «Use superuser account», name:

giving the mysql root password you configured earlier.

The configuration process will prompt you to download a LocalSettings.php that must be saved to the parent directory of the new wiki. The configuration page will give the exact directory/filename that must be moved:

sudo mv ~/Downloads/LocalSettings.php /var/lib/mediawiki/

And navigate your browser to http://localhost/mediawiki (or http://server_ip_address/mediawiki or http://server_ip_address/mediawiki/index.php) to see your new wiki.

Done! You now have a working Wiki

Additional wiki configuration [ edit ]

General information [ edit ]

MediaWiki is configured by the LocalSettings.php file, usually found in /var/lib/mediawiki . Manual:LocalSettings.php has detailed information that may be useful. The following are changes that appear to be universally helpful

To edit LocalSettings.php use

gksudo gedit /var/lib/mediawiki/LocalSettings.php
sudo nano /var/lib/mediawiki/LocalSettings.php

File uploads [ edit ]

Changing the logo [ edit ]

MediaWiki extensions [ edit ]

The current tarball for MediaWiki comes with a package of 15 or so of the most popular extensions, but there are literally hundreds more.

Instructions on how to enable extensions can be found at Manual:Extensions .

Pretty URLs [ edit ]

To use /wiki/* instead of /wiki/index.php/* on Debian, follow the recommended short URL guide using ‘/mediawiki’ as the script path instead of ‘/w’ and placing the rewrites in /etc/apache2/conf-enabled/mediawiki.conf.

See also [ edit ]

Источник

MediaWiki

MediaWiki is the engine that is used for Wikipedia. See MediaWiki for more information.

Beware: apt-get installs old versions of mediawiki, which is no longer supported by upstream.

Install pre-requisites

The easiest method is to first install a full LAMP (Linux, Apache2, MySQL, PHP) server:

sudo apt-get install tasksel
sudo tasksel install lamp-server

Make sure you record your MySQL root superuser name and superuser password that you will create at installation. You will need it later.

(Each of the components (Apache2, MySQL5, and PHP) can also be installed individually, if you wish.)

Install MediaWiki

sudo apt-get install mediawiki

Optionally install add-ons:

sudo apt-get install imagemagick mediawiki-math php5-gd

Enable MediaWiki by editing the following file and remove the ‘#’ from the third line so that it reads ‘Alias /mediawiki /var/lib/mediawiki’:

sudo nano /etc/mediawiki/apache.conf
sudo /etc/init.d/apache2 restart

Start your MediaWiki

Follow the setup instructions.

Start Mediawiki from a remote location

This method regards starting your website from a remote location. Since you will be entering passwords, you shouldn’t use an unsecured connection. Either set up a ssl server] (see OpenSSL) and connect with https://yoursite.example.com/mediawiki, or visit from the server itself (using elinks or lynx, two excellent text-based web browsers):

elinks localhost/mediawiki

You could also use ssh to port forward your http traffic from your local machine to the remote server. ssh -C -L 9999:localhost:80 regularuser@www.skippybob.com, edit your /etc/hosts to point the webserver’s name to your localhost, then open a web browser to the config page: http://wiki.skippybob.com:9999/config. More detailed instructions here.

Читайте также:  Linux операционная система чья страна

fill out the forms, noting that the final form is NOT your root or user password, but the password for the root mysql account (blank by default)

Lastly, move the config files as requested to prevent anyone else from changing these settings:

NOTE: Check the output in your web browser: if its instructions differ from below, follow them.

sudo cp /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki/LocalSettings.php sudo chown www-data /etc/mediawiki/LocalSettings.php sudo chmod 600 /etc/mediawiki/LocalSettings.php sudo rm -Rf /var/lib/mediawiki/config

You are done! you should see a wiki page at: http://yoursite.example.com/mediawiki

Customize

You might want to customize the look of your wiki.

To change the icon make a 135×135 pixel logo in PNG format and move it to the right place:

sudo cp my_new_logo.png /var/lib/mediawiki/skins/common/images/my_new_logo.png

Avoid to use the same name as the original logo (wiki.png), it will be overwritten when upgrading Mediawiki.

Insert the path to the image at the end of configuration file in /etc/mediawiki/LocalSettings.php like so:

$wgLogo = "/mediawiki/skins/common/images/my_new_logo.png" ;

Email Support

MediaWiki can be configured to send email messages for various functions. You will need to install some additional packages:

sudo apt-get install php-pear sudo pear install mail sudo pear install Net_SMTP

Also, you’ll need to configure the LocalSettings.php file to use your SMTP server to send out the messages, for example:

$wgEnableEmail = true; $wgEnableUserEmail = true; $wgEmergencyContact = "wikidude@mydomain.com"; $wgPasswordSender = "wikidude@mydomain.com"; $wgNoReplyAddress = "noreply@mydomain.com"; $wgPasswordSender = "password_reminder@mydomain.com"; $wgSMTP = array( 'host' => "ssl://smtp.gmail.com", 'IDhost' => "gmail.com", 'port' => 465, 'auth' => true, 'username' => "user_name@mydomain.com", 'password' => "user_password" );

Extensions

Mediawiki extensions are stored as symbolic links in the /etc/mediawiki-extensions/extensions-available folder. You can enable an extension using

Tab/autocomplete shows a list of extensions.

Similarly use mwdisext to disable an extension.

Install skins in MediaWiki

  • Download a skin tarball (such as example.tar.gz) and extract.
  • Create a directory, e.g. /var/lib/mediawiki/skins/example
  • Move the extracted content into the directory /var/lib/mediawiki/skins/example.
  • In /var/lib/mediawiki/skins put exemple.php and exemple.deps.php.
  • Go to http://localhost/mediawiki/ -> Preference -> Aspects and choose the example skin.

MediaWiki TurnKey appliance

Some users may prefer an unofficial pre-integrated TurnKey MediaWiki Appliance based on Ubuntu LTS.

Other Resources

MediaWiki (последним исправлял пользователь ckimes 2017-09-02 19:52:46)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

Оцените статью
Adblock
detector