Difference between revisions of "Building Wiki Servers"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
Line 41: Line 41:
== 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 '''MY_WIKI''';
  GRANT ALL PRIVILEGES ON '''MY_WIKI'''.* TO ''''USERNAME''''@'localhost';
  GRANT ALL PRIVILEGES ON '''MY_WIKI'''.* TO ''''USERNAME''''@'localhost';
  FLUSH PRIVILEGES;
  FLUSH PRIVILEGES;

Revision as of 18:14, 13 January 2022

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.37.1)
    • Adjust the following commands appropriately (i.e.: replace 1.37.1 with the current version number) if needed.
  • wget https://releases.wikimedia.org/mediawiki/1.37/mediawiki-1.37.1.tar.gz

Unpack MediaWiki

  • Extract it
  • tar -xvzf mediawiki-1.37.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.37.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.37.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/7.4/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

Now Do A Backup!

More coming here...

Just some notes.