User:MeowyCats2/Install CreateWiki and ManageWiki on your wiki: Difference between revisions
Jump to navigation
Jump to search
MeowyCats2 (talk | contribs) m MeowyCats2 moved page User:MeowyCats2/User:Waki285/Install CreateWiki and ManageWiki on your wiki to User:MeowyCats2/Install CreateWiki and ManageWiki on your wiki without leaving a redirect: Fix title |
MeowyCats2 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{note}} This is less of a "tutorial" and more of a "memo" on the means by which I have been successful. Disclaimer: I | {{note}} This memo is an slightly modified version of the memo originally made by Waki285 from Miraheze Meta at [[mh:meta:User:Waki285/Install CreateWiki and ManageWiki on your wiki]] to make it work with newer CreateWiki versions.<br> | ||
{{note}} This is less of a "tutorial" and more of a "memo" on the means by which I have been successful. Disclaimer: I will not be liable for any damages caused by this memo.<br> | |||
{{note}} This was done for production, but could also be used for development as an extension development. | {{note}} This was done for production, but could also be used for development as an extension development. | ||
== Prerequisites == | == Prerequisites == | ||
This is the environment in which I have succeeded. I am not sure if I would be successful in any other environment than this. | This is the environment in which I have succeeded. I am not sure if I would be successful in any other environment than this. | ||
* VPS with | * VPS with free IP port open and sudo privileges (you may have to sudo the commands if you're not root) | ||
* Ubuntu Server 22.02 | * Ubuntu Server 22.02 | ||
* Nginx | * Nginx | ||
* MySQL | * MySQL or MariaDB | ||
* Cloudflare ( | * Cloudflare (optional) | ||
* Domain with ability to add A wildcard record | |||
== Procedure == | == Procedure == | ||
<ol> | <ol> | ||
<li>Install packages such as | <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>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 51: | Line 51: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<li>Remember to open port 80 if you are using a firewall.</li> | <li>Remember to open port 80 if you are using a firewall.</li> | ||
<li>Go to Cloudflare and add the following to your DNS.</li> | <li>Go to Cloudflare if you're using it, or otherwise your domain registry, and add the following to your DNS.</li> | ||
:'''Type:''' <code>A</code> '''Name''': <code>*</code> '''IPv4 address''': Your VPS IP '''Proxy status''': <code>Proxied</code> | :'''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'''.</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> | ||
<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 622: | Line 622: | ||
$wgGroupPermissions['bureaucrat']['createwiki'] = true; | $wgGroupPermissions['bureaucrat']['createwiki'] = true; | ||
$wgGroupPermissions['*']['createaccount'] = true; | $wgGroupPermissions['*']['createaccount'] = true; | ||
</syntaxhighlight> | |||
<li>Run the below in MySQL as the wiki may not be fully deleted.</li> | |||
<syntaxhighlight lang="sql"> | |||
DELETE FROM localuser WHERE lu_wiki='wikidb'; | |||
DELETE FROM localnames WHERE ln_wiki='wikidb'; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
<li>ALL DONE!</li> | <li>ALL DONE!</li> | ||
Line 630: | Line 635: | ||
=== Uncaught InvalidArgumentException: Database must be null or a non-empty string. === | === Uncaught InvalidArgumentException: Database must be null or a non-empty string. === | ||
Sometimes, especially after purging the cache, the subdomain is lost at some point while accessing the wiki. Please re-add the subdomain. | Sometimes, especially after purging the cache, the subdomain is lost at some point while accessing the wiki. Please re-add the subdomain. | ||
=== Permission denied === | |||
Sometimes after performing maintenance scripts, you may encounter this error, which may be hidden under a blank screen. To fix this, try giving cw_cache 777 permission or chown it to www-data again. If it appears the relevant file is outside cw_cache, you may have to chmod or chown another folder, which may be /var/www/mediawiki. | |||
=== Wikis not creating fully === | |||
Create opcache-blacklist.txt in your PHP config folder with the contents as <code> /var/www/mediawiki</code> and add <code>opcache.blacklist_filename=(your PHP folder)/opcache-blacklist.txt</code> to your php.ini. |