Deploying Mediawiki on Debian (it's very easy)

If you need your own Wiki, but don’t know where to start, welcome. I'm new to Linux, this will help my step-by-step in particular. Considered:


  1. installing Debian
  2. LAMP stack
  3. launch on this basis Wiki on the popular Mediawiki engine

Choosing Distributions


  • OS - choose Debian. I do not know why. More specifically, debian-10.2.0-amd64-netinst.iso. The distribution, of course, is always worth taking the last of the stable, look at debian.org .
  • Mediawiki - because this project is well supported to this day. I looked closely at DokuWiki, but the latest distribution dates back to 2018, and the manuals are clearly not designed for beginners.
  • Apache, MariaDB and php73 - as recommended by Mediawiki .

A memo for those who are not very familiar with Linux
  1. Linux and everything that works on it is very case sensitive.
  2. root, – , , su. (, ), exit.
  3. , , , ssh su .
  4. ssh PuTTY. .

Equipment


  • it doesn’t matter at all. It can be a virtual machine, it can be a piece of iron.
    If you have very few resources, check out Installation requirements .

Install Debian OS


– Linux, , , . , «»-«», SSH, . , , .. " Mediawiki" .
.


. Language, Location, Keymap, Network

.



– English



Location – Russian Federation (other – Europe – Russian Federation)





Locales – United States



Keymap to use – American English




, , DHCP-, .


Hostname for this system.


, wiki02. : , wiki mediawiki – . , .


Domain name


DNS-.


Users, Clock, Partitions

. Root password



User for non-administrative activities


  • Full name of the user – , aslan. , , , , , , etc.
  • Username – aslan



— Moscow



  • Partitioning method – Guided – use entire disk
  • Select disk to partition –
  • Partitioning scheme – All files in one partition,
  • Finish partitioning and write changes to disk
  • Write changes to disks – Yes

Package manager, HTTP Proxy, Usage Survey, Software Selection

Configure the package manager


  • Scan another CD or DVD – No
  • Debian archive mirror country – Russian Federation
  • Debian archive mirror – deb.debian.org

HTTP proxy


- ,


Configuring popularity-contest


Participate in the package usage survey – .


Software selection


Choose software to install: SSH . … , .


GRUB, Finish, ,

Install the GRUB


  • Install the GRUB boot loader to the master boot record? – , Yes.
  • Device for boot loader installation – ( Enter device manually)

Finish the installation


  • , / .

  • SSH -root .
    su #   root
    apt-get update && apt-get upgrade


" Debian"


, , , , LAMP (PHP, MariaDB Apache). , .


LAMP Stack


, SSH su. , , mysql Debian “buster” (10.3):


apt-get install apache2 mariadb-server php php-mysql libapache2-mod-php php-xml php-mbstring # sudo,   -y,     .


apt-get install php-apcu php-intl imagemagick inkscape php-gd php-cli php-curl git -y
systemctl restart apache2

MySQL


mysql -u root -p
CREATE USER 'new_mysql_user'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED';
CREATE DATABASE my_wiki;
use my_wiki;
GRANT ALL ON my_wiki.* TO 'new_mysql_user'@'localhost';
quit;
#    ,   THISpasswordSHOULDbeCHANGED       .

PHP


, , :


  • /etc/php/7.3/apache2/php.ini ( nano /etc/php/7.3/apache2/php.ini), , - ( su, )

    • upload_max_fileseze = 2M # 50. , – , , - , .
    • memory_limit = 128M # 128, –

    • Ctrl+O, Ctrl+X nano
    • :wq vi

« LAMP»


, ( Hyper-V) , .


MediaWiki


– .


, :


cd /tmp/
wget https://releases.wikimedia.org/mediawiki/1.34/mediawiki-1.34.0.tar.gz
tar -xvzf /tmp/mediawiki-*.tar.gz
mkdir /var/lib/mediawiki
mv mediawiki-*/* /var/lib/mediawiki

– .


. .


apt-get install mediawiki -y

(1.34 vs 1.31), apt-get update . , , .


« Mediawiki»


- , . , (. ), , .


MediaWiki


http:// /mediawiki . , , . #, wiki02.aslan.local, . , FQDN. , , .



: ru – . , : ru —


,




  • MySQL , . , – , , .
  • - .


  • – , .
  • : , .

    • – «», , . , portal02admin
    • . , .
    • .
  • .



LocalSettings.php


, MediaWiki ( ). , .. , – ‘LocalSettings (3).php’. , «3» . , ( LocalSettings.php, ).


  • .
  • . Windows, pscp. Windows, . , , , /etc/mediawiki/LocalSettings.php, mv .


    • , pscp.exe . Downloads . powershell (Shift+ «» , , powershell, cd)


    • powershell:


      .\pscp.exe '.\LocalSettings (wiki02_20200225).php' aslan@wiki02.aslan.local:/home/aslan/LocalSettings.php #   :
      #.\pscp.exe –   
      # '.\LocalSettings (wiki02_20200225).php' – ,  
      #aslan@wiki02.aslan.local – @__
      #:/home/aslan/ -   ,  .    , ..              Access Denied
      #LocalSettings.php –      


  • « »
    mv /home/aslan/LocalSettings.php /etc/mediawiki/LocalSettings.php#   !

    .



All Articles