0347.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Self-hosted Wikipedia Style Wiki with MediaWiki on Debian</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Debian,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Browser Based,Web Based,Web Based Tools,FOSS,Linux,Open Source,Open Source Software,PHP Based Wiki,WikiMedia,Self-Hosted Wikipedia,PHP,MariaDB,Apache HTTPD,MySQL,LAMP,Web Server,How To Install WikiMedia On Debian,How To Self-Host Wikipedia,How To Run WikiMedia On Linux,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Self-hosted Wikipedia Style Wiki with MediaWiki on Debian">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="08/24/2023 08:19:52 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Self-hosted Wikipedia Style Wiki with MediaWiki on Debian</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <ol>
  26. <li>Log into the Debian device</li>
  27. <li>Run the following commands in a terminal:
  28. <div class="codeBlock"># update repositories and install any available software updates<br />
  29. sudo apt update<br />
  30. sudo apt upgrade -y<br />
  31. # install Apache HTTPD and MySQL<br />
  32. sudo apt-get install apache2 mariadb-server mariadb-client curl<br />
  33. # install PHP components<br />
  34. sudo apt install php php-common php-mysql php-cli php-json php-opcache php-gd php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip<br />
  35. # configure the MySQL database<br />
  36. sudo su<br />
  37. mysql_secure_installation</div>
  38. </li>
  39. <li>Press Enter to login as root</li>
  40. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  41. <li>Type Y and press Enter to remove anonymous users</li>
  42. <li>Type Y and press Enter to disallow root login remotely</li>
  43. <li>Type Y and press Enter to remove the test database</li>
  44. <li>Type Y and press Enter to reload privilege tables</li>
  45. <li>Run the following command to login into MySQL:
  46. <div class="codeBlock">mysql -u root -p</div>
  47. </li>
  48. <li>Authenticate with the root password set earlier</li>
  49. <li>Run the following commands to create the MediaWiki database and database user
  50. <div class="codeBlock">CREATE DATABASE wikidb;<br />
  51. GRANT ALL ON wikidb.* TO &#39;wikiuser&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;WikiW1k1Wh@t!!&#39;;<br />
  52. FLUSH PRIVILEGES;<br />
  53. EXIT;<br />
  54. exit</div>
  55. </li>
  56. <li>Continue with the following commands to download and extract MediaWiki in the Apache webroot
  57. <div class="codeBlock"># download latest MediaWiki version<br />
  58. sudo wget -O mediawiki.tar.gz https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.1.tar.gz<br />
  59. # extract mediawiki.tar.gz<br />
  60. sudo tar xzvf mediawiki.tar.gz --directory /var/www/html<br />
  61. # rename mediawiki folder<br />
  62. sudo mv /var/www/html/mediawiki* /var/www/html/wiki<br />
  63. # set the owner of the new wiki directory to www-data<br />
  64. sudo chown -R www-data:www-data /var/www/html/wiki<br />
  65. # restart apache2 service<br />
  66. sudo systemctl restart apache2</div>
  67. </li>
  68. <li>Open a web browser and navigate to http://DNSorIP/wiki</li>
  69. <li>Click the set up the wiki first link</li>
  70. <li>Select a language &gt; Click Continue</li>
  71. <li>Scroll to the bottom of the page and click Continue</li>
  72. <li>Enter the database host, name, username and password &gt; Click Continue
  73. <p>Host: localhost<br />
  74. Name: wikidb<br />
  75. Username: wikiuser<br />
  76. Password:&nbsp;WikiW1k1Wh@t!!</p>
  77. </li>
  78. <li>Leave&nbsp;Use the same account as for installation checked and click Continue</li>
  79. <li>Give the Wiki a name and create an administrator username&nbsp;and password</li>
  80. <li>Uncheck the Share data about this installation with MediaWiki developers&nbsp;box</li>
  81. <li>Check the&nbsp;I&#39;m bored already, just install the wiki box</li>
  82. <li>Click Continue and the Continue again to begin the installation</li>
  83. <li>After the installation completes click Continue</li>
  84. <li>Download the generated LocalSettings.php to the Downloads&nbsp;directory</li>
  85. <li>Run the following command in terminal to place the LocalSettings.php in the correct location
  86. <div class="codeBlock">sudo mv ~/Downloads/LocalSettings.php /var/www/html/wiki</div>
  87. </li>
  88. <li>Back in the browser&nbsp;click the enter your wiki link</li>
  89. <li>Click the Log In link at the top right</li>
  90. <li>Log in with the administrator account created during the installation&nbsp;</li>
  91. <li>Welcome to WikiMedia</li>
  92. </ol> </div>
  93. </div>
  94. </body>
  95. </html>