User:MeowyCats2/Install CreateWiki and ManageWiki on your wiki: Difference between revisions
Jump to navigation
Jump to search
Cocopuff2018 (talk | contribs) m Protected "User:MeowyCats2/Install CreateWiki and ManageWiki on your wiki" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
Cocopuff2018 (talk | contribs) +small update for empty databases |
||
(8 intermediate revisions by one other user not shown) | |||
Line 15: | Line 15: | ||
<ol> | <ol> | ||
<li>Install packages such as PHP and MySQL, which are required for a normal MediaWiki installation. We will also purchase a domain and connect it to Cloudflare.</li> | <li>Install packages such as PHP and MySQL, which are required for a normal MediaWiki installation. We will also purchase a domain and connect it to Cloudflare.</li> | ||
<ol> | |||
<li>Run <code>add-apt-repository ppa:ondrej/php</code></li> | |||
<li>Run <code>apt install php</code></li> | |||
<li>Run <code>apt install php-fpm</code></li> | |||
<li>Run <code>apt install nginx</code></li> | |||
<li>Run <code>apt install php-mbstring php-xml php-intl</code></li> | |||
<li>Run <code>apt install php-mysql</code></li> | |||
<li>Run <code>apt install mariadb-server</code></li> | |||
<li>Run <code>mysql_secure_installation</code></li> | |||
<li>If you would like to create a seperate MySQL user for authentication, run <code>CREATE USER 'mediawiki'@'localhost' IDENTIFIED BY 'password';</code> and <code>GRANT ALL PRIVILEGES ON *.* TO 'mediawiki'@'localhost' WITH GRANT OPTION;</code></li> | |||
</ol> | |||
<li>Extract MediaWiki to <code>/var/www/mediawiki</code>.</li> | <li>Extract MediaWiki to <code>/var/www/mediawiki</code>.</li> | ||
<li>Enter MySQL and create a database named "testwiki".</li> | <li>Enter MySQL and create a database named "testwiki".</li> | ||
Line 54: | Line 65: | ||
:'''Type:''' <code>A</code> '''Name''': <code>*</code> '''IPv4 address''': Your VPS IP '''Proxy status''': <code>Proxied</code> (if using Cloudflare) | :'''Type:''' <code>A</code> '''Name''': <code>*</code> '''IPv4 address''': Your VPS IP '''Proxy status''': <code>Proxied</code> (if using Cloudflare) | ||
<li>Go to the Cloudflare SSL/TLS settings and set the SSL/TLS encryption mode to '''Flexible'''. (if using Cloudflare, otherwise set up SSL, maybe with Let's Encrypt)</li> | <li>Go to the Cloudflare SSL/TLS settings and set the SSL/TLS encryption mode to '''Flexible'''. (if using Cloudflare, otherwise set up SSL, maybe with Let's Encrypt)</li> | ||
<ol> | |||
<li>If you're not using Cloudflare and would like to use certbot with Let's Encrypt, follow the below steps.</li> | |||
<li>Install certbot with <code>sudo snap install certbot --classic</code></li> | |||
</ol> | |||
<li>At this point, go to test.[yourdomain.tld] and you should see "LocalSettings.php not found. Please set up the wiki first."</li> | <li>At this point, go to test.[yourdomain.tld] and you should see "LocalSettings.php not found. Please set up the wiki first."</li> | ||
<li>Click "set up the wiki", set up the wiki as usual, but install the extensions AbuseFilter, Interwiki, Echo, and WikiEditor. DON'T INSTALL MinervaNeue. Set the database name to "testwiki" created earlier and leave the table prefix blank.</li> | <li>Click "set up the wiki", set up the wiki as usual, but install the extensions AbuseFilter, Interwiki, Echo, and WikiEditor. DON'T INSTALL MinervaNeue. Set the database name to "testwiki" created earlier and leave the table prefix blank.</li> | ||
Line 564: | Line 579: | ||
], | ], | ||
'+wgVirtualDomainsMapping' => [ | |||
'default' => [ | |||
'virtual-botpasswords' => [ | |||
'db' => 'centralauth', | |||
], | |||
'virtual-centralauth' => [ | |||
'db' => 'centralauth', | |||
], | |||
'virtual-globalblocking' => [ | |||
'db' => 'centralauth', | |||
], | |||
'virtual-oathauth' => [ | |||
'db' => 'centralauth', | |||
], | |||
'virtual-importdump' => [ | |||
'db' => 'testwiki', | |||
], | |||
'virtual-createwiki' => [ | |||
'db' => 'wikidb', | |||
], | |||
'virtual-createwiki-central' => [ | |||
'db' => 'testwiki', | |||
], | |||
'virtual-requestssl' => [ | |||
'db' => 'centralauth', | |||
], | |||
], | |||
], | |||
]; | ]; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 607: | Line 650: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<li>Log in to the wiki using the account you used during installation.</li> | <li>Log in to the wiki using the account you used during installation.</li> | ||
<li>Put the below to LocalSettings. Put at bottom.</li> | |||
<syntaxhighlight lang="php"> | |||
$wgHooks['CreateWikiDataFactoryBuilder'][] = 'MirahezeFunctions::onCreateWikiDataFactoryBuilder'; | |||
$wgHooks['CreateWikiGenerateDatabaseLists'][] = 'MirahezeFunctions::onGenerateDatabaseLists'; | |||
$wgHooks['ManageWikiCoreAddFormFields'][] = 'MirahezeFunctions::onManageWikiCoreAddFormFields'; | |||
$wgHooks['ManageWikiCoreFormSubmission'][] = 'MirahezeFunctions::onManageWikiCoreFormSubmission'; | |||
$wgHooks['MediaWikiServices'][] = 'MirahezeFunctions::onMediaWikiServices'; | |||
</syntaxhighlight> | |||
<li>Put <code>$wgGroupPermissions['bureaucrat']['createwiki'] = true;</code> to LocalSettings. Put very bottom.</li> | <li>Put <code>$wgGroupPermissions['bureaucrat']['createwiki'] = true;</code> to LocalSettings. Put very bottom.</li> | ||
<li>Put <code>$wgGroupPermissions['*']['createaccount'] = true;</code> to LocalSettings. Put very bottom.</li> | <li>Put <code>$wgGroupPermissions['*']['createaccount'] = true;</code> to LocalSettings. Put very bottom.</li> | ||
Line 628: | Line 679: | ||
DELETE FROM localnames WHERE ln_wiki='wikidb'; | DELETE FROM localnames WHERE ln_wiki='wikidb'; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<li>Crreatewiki will create empty databases so to fix this you need to do wgCreateWikiSQLfiles -> wgCreateWikiSQLFiles and make job queue is running </li> | |||
<li>ALL DONE!</li> | <li>ALL DONE!</li> | ||
</ol> | </ol> |