Difference between revisions of "Building Wiki Servers"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
Tag: Manual revert
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{{!}} class="wikitable" style="float: right; width: 322px;" border="2"
{{!}}+ Proven on:
{{!}}- < --="" debian="" -->
{{!}} style="text-align: center; width: 60px;" {{!}} [[File:Logo Debian.png{{!}}60px{{!}}link=https://www.debian.org/{{!}}center{{!}}middle{{!}}frameless]]
{{!}} style="text-align: center; width: 40px;" {{!}} 12 (bullseye)
{{!}}
<br>
{{!}}- < --="" ubuntu="" -->
{{!}} style="text-align: center; width: 65.7px;" {{!}} [[File:Logo Ubuntu.png{{!}}60px{{!}}link=https://ubuntu.com/{{!}}center{{!}}middle{{!}}frameless]]
{{!}} 20.04.3
{{!}}
<br>
{{!}}}
= Start with a WebServer =
= Start with a WebServer =
*[[WebServer - Basic LAMP Stack Install{{!}}Basic LAMP Stack Install]]
* [[Building Web Servers{{!}}Building Web Servers]]
 
<span style="color: rgb(255, 0, 0);">'''[[Now Do A Backup!{{!}}Now Do A Backup!]]'''</span>


<span style="color: rgb(255, 0, 0);">'''Now Do A Backup!'''</span>
= Download MediaWiki =
= Download MediaWiki =


* Check the '''[[mediawikiwiki:Download{{!}}download page]]''' for latest version. (ATM, the current version turns out to be 1.37.1)
* Check the '''[[mediawikiwiki:Download{{!}}download page]]''' for latest version. (ATM, the current version turns out to be 1.40.1)
** Adjust the following commands appropriately (i.e.: replace '''1.37.1''' with the current version number) if needed.
** Adjust the following commands appropriately (i.e.: replace '''1.40.1''' with the current version number) if needed.
* <code><nowiki>wget https://releases.wikimedia.org/mediawiki/1.37/mediawiki-</nowiki>'''1.37.1'''<nowiki>.tar.gz</nowiki></code>
* <code><nowiki>wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-</nowiki>'''1.40.1'''<nowiki>.tar.gz</nowiki></code>
* Extract it
* <code>tar -xvzf mediawiki-'''1.37.1'''.tar.gz</code>


= Unpack MediaWiki =
= Unpack MediaWiki =
* Extract it
* <code>tar -xvzf mediawiki-'''1.40.1'''.tar.gz</code>
There are a couple of different ways to set up the root of your wiki.
There are a couple of different ways to set up the root of your wiki.


Line 19: Line 37:


* <code>sudo mkdir /var/www/html/wiki</code>
* <code>sudo mkdir /var/www/html/wiki</code>
* <code>sudo tar --directory=/var/www/html/wiki -xvzf mediawiki-'''1.37.1'''.tar.gz</code>
* <code>sudo cp -r mediawiki-1.40.1/* /var/www/html/wiki</code>
* <code>sudo chmod -R ugo+rwX /var/www/html/wiki/images</code>
* <code>sudo chmod -R ugo+rwX /var/www/html/wiki/images</code>
Your wiki will be reached at http://'''www.ServerAddress.tld'''/wiki/


==  or at an independent URL ==
==  or at an independent URL ==


* <code>sudo mkdir /var/www/wiki</code>
* <code>sudo mkdir /var/www/wiki</code>
* <code>sudo tar --directory=/var/www/wiki -xvzf mediawiki-'''1.37.1'''.tar.gz</code>
* <code>sudo cp -r mediawiki-1.40.1/* /var/www/wiki</code>
* <code>sudo chmod -R ugo+rwX /var/www/wiki/images</code>
* <code>sudo chmod -R ugo+rwX /var/www/wiki/images</code>
Your wiki will be reached at http://'''wiki.ServerAddress.tld'''/
(Once you set up [[WebServer - Name-based Virtual Host Support{{!}}Name-based Virtual Host Support]])


= Set Up MediaWiki =
= Set Up MediaWiki =
Line 32: Line 54:
== Create the database ==
== Create the database ==
* <code>sudo mysql -u root -p</code>
* <code>sudo mysql -u root -p</code>
 
  CREATE DATABASE '''MY_WIKI''';
  CREATE DATABASE nerdmage_wiki;
  GRANT ALL PRIVILEGES ON '''MY_WIKI'''.* TO ''''USERNAME''''@'localhost';
  GRANT ALL PRIVILEGES ON '''my_wiki'''.* TO ''''USERNAME''''@'localhost';
  FLUSH PRIVILEGES;
  FLUSH PRIVILEGES;
  EXIT;
  EXIT;
Replace '''MY_WIKI''' with a database name of your choice. If you are installing multiple wikis on a single server, they each need a uniquely named database.
Replace '''USERNAME''' with the username you set up while [[WebServer_-_Basic_LAMP_Stack_Install#Set_up_at_least_one_user_in_mysql{{!}}installing the LAMP Stack]]


== Adjust PHP Settings ==
== Adjust PHP Settings ==
* <code>sudo vi /etc/php/'''7.4'''/apache2/php.ini</code>
* <code>sudo vi /etc/php/'''8.2'''/apache2/php.ini</code>
(this may be in a slightly different location depending on version of php installed...)
(this may be in a slightly different location depending on version of php installed...)


Line 46: Line 70:
increase '''post_max_size''' to 200M
increase '''post_max_size''' to 200M


<span style="color: rgb(255, 0, 0);">'''Now Do A Backup!'''</span>
= Your wiki is installed =
 
<span style="color: rgb(255, 0, 0);">'''[[Now Do A Backup!{{!}}Now Do A Backup!]]'''</span>
 
Browse to http://'''www.ServerAddress.tld'''/wiki/ or http://'''wiki.ServerAddress.tld'''/ (depending on which way you set it up above...)
 
[[File:Wiki-first-view.png{{!}}300px{{!}}center{{!}}frame]]


= <span style="color: rgb(132, 63, 161);" >More coming here...</span> =
= <span style="color: rgb(132, 63, 161);">More coming here...</span> =


= Just some notes. =
= Just some notes. =


* Private Wikis & the Visual Editor
** Don't even try, it fails...
** Go with [https://www.mediawiki.org/wiki/Extension:TinyMCE TinyMCE] instead
* [[mediawikiwiki:help:Categories{{!}}Categories]]
* [[mediawikiwiki:help:Categories{{!}}Categories]]
*User Management
*User Management

Latest revision as of 20:16, 14 December 2023

Proven on:
Logo Debian.png
12 (bullseye)


Logo Ubuntu.png
20.04.3


Start with a WebServer

Now Do A Backup!

Download MediaWiki

  • Check the download page for latest version. (ATM, the current version turns out to be 1.40.1)
    • Adjust the following commands appropriately (i.e.: replace 1.40.1 with the current version number) if needed.
  • wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.1.tar.gz

Unpack MediaWiki

  • Extract it
  • tar -xvzf mediawiki-1.40.1.tar.gz

There are a couple of different ways to set up the root of your wiki.

You can either set it up to be reached

as part of your regular web site

  • sudo mkdir /var/www/html/wiki
  • sudo cp -r mediawiki-1.40.1/* /var/www/html/wiki
  • sudo chmod -R ugo+rwX /var/www/html/wiki/images

Your wiki will be reached at http://www.ServerAddress.tld/wiki/

or at an independent URL

  • sudo mkdir /var/www/wiki
  • sudo cp -r mediawiki-1.40.1/* /var/www/wiki
  • sudo chmod -R ugo+rwX /var/www/wiki/images

Your wiki will be reached at http://wiki.ServerAddress.tld/

(Once you set up Name-based Virtual Host Support)

Set Up MediaWiki

Create the database

  • sudo mysql -u root -p
CREATE DATABASE MY_WIKI;
GRANT ALL PRIVILEGES ON MY_WIKI.* TO 'USERNAME'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Replace MY_WIKI with a database name of your choice. If you are installing multiple wikis on a single server, they each need a uniquely named database.

Replace USERNAME with the username you set up while installing the LAMP Stack

Adjust PHP Settings

  • sudo vi /etc/php/8.2/apache2/php.ini

(this may be in a slightly different location depending on version of php installed...)

increase upload_max_filesize to 200M

increase post_max_size to 200M

Your wiki is installed

Now Do A Backup!

Browse to http://www.ServerAddress.tld/wiki/ or http://wiki.ServerAddress.tld/ (depending on which way you set it up above...)

Wiki-first-view.png

More coming here...

Just some notes.