Difference between revisions of "Installation"

From Fancyclopedia 3
Jump to navigation Jump to search
m (Text replacement - "http:" to "https:")
 
(16 intermediate revisions by one other user not shown)
Line 3: Line 3:
 
Login to Dreamhost, visit Domains/Manage Domains/Add Hosting to Domain/Subdomain
 
Login to Dreamhost, visit Domains/Manage Domains/Add Hosting to Domain/Subdomain
  
add new subdomain of fancy-test.com called wiki2.fancy-test.com
+
add new subdomain of fancyclopedia.org called wiki.fancyclopedia.org
 
Select remove WWW
 
Select remove WWW
Use user johnbray
+
Use user fancyclopedia
Directory /home/johnbray/wiki2.fancy-test.com
+
Directory /home/fancyclopedia/wiki.fancyclopedia.org
 
Default other options
 
Default other options
  
 
Wait a few hours for DNS propagation, until dns lookup works
 
Wait a few hours for DNS propagation, until dns lookup works
  
Visit More/MySQL databases, add new hostname mysql (under dropdown wiki2.fancy-test.com), create database fancytestwiki2, using hostname mysql.wiki2.fancy-test.com, first user fancytestwiki2 password wiki2!!!
+
Visit More/MySQL databases, add new hostname mysql (under dropdown wiki.fancyclopedia.org, create database fancyclopedia, using hostname mysql.wiki.fancyclopedia.org (mysql.wiki.fancy-test.com), first user fancyclopedia password ******
  
(View database from https://west1-phpmyadmin.dreamhost.com/?hostname=mysql.wiki2.fancy-test.com)
+
(View database from https://west1-phpmyadmin.dreamhost.com/?hostname=mysql.wiki.fancy-test.com)
  
 
==Install wiki==
 
==Install wiki==
Line 21: Line 21:
 
Wait a few hours for DNS propagation, until dns lookup works
 
Wait a few hours for DNS propagation, until dns lookup works
  
login as johnbray@elgin.dreamhost.com
+
login as fancyclopedia@elgin.dreamhost.com
  
  rm -rf wiki2.fancy-test.com
+
  rm -rf wiki.fancyclopedia.org
 
  tar xzf mediawiki-1.33.1.tar.gz
 
  tar xzf mediawiki-1.33.1.tar.gz
  mv mediawiki-1.33.1 wiki2.fancy-test.com
+
  mv mediawiki-1.33.1 wiki.fancyclopedia.org
 +
cd wiki.fancyclopedia.org
 +
vi robots.txt
 +
User-agent: *
 +
Disallow:
  
tar xzf mediawiki-1.33.1.tar.gz
+
Visit https://wiki.fancyclopedia.org/ and click on 'set up wiki'. English language, Continue
mv mediawiki-1.33.1 wiki2.fancy-test.com
 
cd wiki2.fancy-test.com
 
 
 
Visit http://wiki2.fancy-test.com/ and click on 'set up wiki'. English language, Continue
 
 
  database type: Mysql
 
  database type: Mysql
  database host: mysql.wiki2.fancy-test.com
+
  database host: mysql.wiki.fancy-test.com
  database name: fancytestwiki2
+
  database name: fancyclopedia
 
  table prefix: <none>
 
  table prefix: <none>
  user name: fancytestwiki2
+
  user name: fancyclopedia
  password: wiki2!!!
+
  password: ********
 
Continue
 
Continue
 
  Storage engine: InnoDB
 
  Storage engine: InnoDB
Line 51: Line 51:
 
Continue
 
Continue
 
Continue
 
Continue
Save LocalSettings.php, scp it to dreamhost in~johnbray/wiki2.fancy-test.com/LocalSettings.php
+
Save LocalSettings.php, scp it to dreamhost in ~fancyclopedia/wiki.fancyclopedia.org/LocalSettings.php
  
  
Line 67: Line 67:
 
  $wgUsePathInfo = true;
 
  $wgUsePathInfo = true;
  
Change Logo, using a logo designed according to https://www.mediawiki.org/wiki/Manual:$wgLogo, and placed in wiki2.fancy-test.com
+
Change Logo, using a logo designed according to https://www.mediawiki.org/wiki/Manual:$wgLogo, and placed in ~/fancyclopedia.org
 
  $wgLogo = "$wgResourceBasePath/fancyclopedia_logo.jpg";
 
  $wgLogo = "$wgResourceBasePath/fancyclopedia_logo.jpg";
  
Line 101: Line 101:
  
 
wfLoadExtension( 'Iframe' );
 
wfLoadExtension( 'Iframe' );
$wgIframe['server']['fanac'] = [ 'scheme' => 'http', 'domain' => 'fanac.fancy-test.com' ];
+
$wgIframe['server']['fanac'] = [ 'scheme' => 'http', 'domain' => 'fanac.org' ];
 +
$wgIframe['server']['files'] = [ 'scheme' => 'http', 'domain' => 'files.fancyclopedia.org' ];
 +
$wgIframe['server']['local'] = [ 'scheme' => 'http', 'domain' => 'files.fancyclopedia.org' ];
 
$wgIframe['delay'] = -1;
 
$wgIframe['delay'] = -1;
  
Line 151: Line 153:
 
# Missed pages stats
 
# Missed pages stats
 
wfLoadExtension( 'MissedPages' );
 
wfLoadExtension( 'MissedPages' );
 +
 +
#Interactive Timelines
 +
wfLoadExtension("InteractiveTimeline");
  
 
#Allow external images using <img html tag
 
#Allow external images using <img html tag
Line 165: Line 170:
 
#$wgDevelopmentWarnings=true;
 
#$wgDevelopmentWarnings=true;
  
 +
# Allow regular expression functions
 +
require_once "$IP/extensions/RegexFunctions/RegexFunctions.php";
 +
 +
# Allow tests whether a page is in a category
 +
require_once "$IP/extensions/CategoryTests/CategoryTests.php";
 +
 +
#Search and Replace for admins only
 +
wfLoadExtension( 'ReplaceText' );
 
</pre>
 
</pre>
  
Line 170: Line 183:
  
 
  cd extensions
 
  cd extensions
  tar xzf CategoryTagSorter-REL1_31-fc510d6.tar.gz
+
  tar xzf CategoryTagSorter-REL1_33-6a74e5c.tar.gz
  tar xzf DisplayTitle-REL1_31-b216925.tar.gz  
+
  tar xzf DisplayTitle-REL1_33-0705659.tar.gz
  tar xzf DynamicPageList-REL1_32-c9a720e.tar.gz
+
  tar xzf DynamicPageList-REL1_33-c92f6b9.tar.gz
  tar xzf PageInCat-REL1_32-dcdb4ec.tar.gz
+
  tar xzf MissedPages-REL1_33-85a2868.tar.gz
  tar xzf MissedPages-master-5eba5e4.tar.gz
+
  tar xzf PageInCat-REL1_33-978c744.tar.gz
  tar xzf Special404-REL1_33-7ba246d.tar.gz
+
  tar xzf TimelineTable-REL1_33-afbeff4.tar.gz
  tar xzf UnusedRedirects-REL1_31-1e1cb99.tar.gz
+
  tar xzf UnusedRedirects-REL1_33-58b6abf.tar.gz
  tar xzf WikiCategoryTagCloud-REL1_31-8bc4678.tar.gz
+
  tar xzf WikiCategoryTagCloud-REL1_33-6460123.tar.gz
 +
tar xzf RegexFunctions-REL1_34-4c21ab2.tar.gz
 +
tar xzf CategoryTests-REL1_34-f568f59.tar.gz
  
 
  svn co https://github.com/sigbertklinke/Iframe.git/trunk Iframe
 
  svn co https://github.com/sigbertklinke/Iframe.git/trunk Iframe
Line 189: Line 204:
 
  Change public function hooktab to have
 
  Change public function hooktab to have
 
  $sep = 'barbar';
 
  $sep = 'barbar';
 +
Change params setup to
 +
 +
        $params = 'data-expandtext="+" data-collapsetext="-"';
 +
        $collapse = '';
 +
        foreach ($argv as $key => $val) {
 +
            if ($key == 'sep')
 +
                $sep = $val;
 +
            else if ($key == 'head')
 +
                $head = $val;
 +
            else if ($key == 'applycssborderstyle')
 +
                $applycssborderstyle = $val;
 +
            else if ($key == 'collapse')
 +
                $collapse= 'mw-collapsed';
 +
            else
 +
                $params .= ' ' . $key . '="' . $val . '"';
 +
        }
 +
        $params .= ' ' . 'class="wikitable mw-collapsible ' . $collapse . '"';
  
  vi Special404/i18n/en.json
+
 
 +
 
 +
  #Give up on 404 handler, MissedPages more useful
 +
#vi Special404/i18n/en.json
 
  and change  
 
  and change  
 
"special404-body": "The URL you requested was not found. Perhaps because you are using a Wikidot URL that is not valid with mediawiki. Try replacing - with spaces, and putting capitals on second and subsequent words. More advice on [[{{MediaWiki:Mainpage}}|the main page]]"
 
"special404-body": "The URL you requested was not found. Perhaps because you are using a Wikidot URL that is not valid with mediawiki. Try replacing - with spaces, and putting capitals on second and subsequent words. More advice on [[{{MediaWiki:Mainpage}}|the main page]]"
Line 202: Line 237:
 
                         $title = $redirectTarget;
 
                         $title = $redirectTarget;
 
                         */
 
                         */
 +
 +
Fix MissedPages extension with [https://www.mediawiki.org/wiki/Extension_talk:MissedPages this]
 +
 +
cd extensions
 +
git clone https://github.com/TheWatcher/InteractiveTimeline.git
 +
cd InteractiveTimeline
 +
git checkout REL1_32
  
 
==Seed wiki==
 
==Seed wiki==
Line 207: Line 249:
 
Make a backup of the fancyclopedia 0 wiki
 
Make a backup of the fancyclopedia 0 wiki
  
  mysqldump --ignore-table=mysql.event --skip-lock-tables --quote-names -ufancytestwiki0 -p -hmysql.wiki0.fancy-test.com fancytestwiki0 > fancytestwiki0.dump
+
  mysqldump --ignore-table=mysql.event --skip-lock-tables --quote-names -ufancytestwiki0 -p -hmysql.wiki0.fancy-test.com fancytestwiki0a > fancytestwiki0.dump
  
 
Import it into wiki
 
Import it into wiki
  
  mysql -p -ufancytestwiki2 -hmysql.wiki2.fancy-test.com fancytestwiki2 < fancytestwiki0.dump
+
  mysql -p -ufancyclopedia -hmysql.wiki.fancy-test.com fancyclopedia < fancytestwiki0.dump
  
 
==.htaccess==
 
==.htaccess==
Line 234: Line 276:
 
#RewriteRule ^/?.*$ /index.php?title=Special:Error404
 
#RewriteRule ^/?.*$ /index.php?title=Special:Error404
 
</pre>
 
</pre>
 
==Wiki changes==
 
 
 
  
 
[[Category:Admin]]
 
[[Category:Admin]]

Latest revision as of 14:59, 28 November 2022

Set up Dreamhost domains and databases[edit]

Login to Dreamhost, visit Domains/Manage Domains/Add Hosting to Domain/Subdomain

add new subdomain of fancyclopedia.org called wiki.fancyclopedia.org Select remove WWW Use user fancyclopedia Directory /home/fancyclopedia/wiki.fancyclopedia.org Default other options

Wait a few hours for DNS propagation, until dns lookup works

Visit More/MySQL databases, add new hostname mysql (under dropdown wiki.fancyclopedia.org, create database fancyclopedia, using hostname mysql.wiki.fancyclopedia.org (mysql.wiki.fancy-test.com), first user fancyclopedia password ******

(View database from https://west1-phpmyadmin.dreamhost.com/?hostname=mysql.wiki.fancy-test.com)

Install wiki[edit]

Visit https://www.mediawiki.org/wiki/Download and download latest version

Wait a few hours for DNS propagation, until dns lookup works

login as fancyclopedia@elgin.dreamhost.com

rm -rf wiki.fancyclopedia.org
tar xzf mediawiki-1.33.1.tar.gz
mv mediawiki-1.33.1 wiki.fancyclopedia.org
cd wiki.fancyclopedia.org
vi robots.txt
User-agent: *
Disallow:

Visit https://wiki.fancyclopedia.org/ and click on 'set up wiki'. English language, Continue

database type: Mysql
database host: mysql.wiki.fancy-test.com
database name: fancyclopedia
table prefix: <none>
user name: fancyclopedia
password: ********

Continue

Storage engine: InnoDB

Continue

Name of wiki: Fancyclopedia 3
Project Namespace: same
user: mlo
password: <any 10 chars>
Email: mlo@baskerville.org
Share: No
I'm bored

Continue Continue Continue Save LocalSettings.php, scp it to dreamhost in ~fancyclopedia/wiki.fancyclopedia.org/LocalSettings.php


vi LocalSettings.php

add after php line

# JRB debugging
# error_reporting( -1 );
# ini_set( 'display_errors', 1 );

After line $wgScriptPath = ""; add

# JRB URL shortening advice from https://shorturls.redwerks.org
$wgScriptExtension = ".php";
$wgArticlePath = "/$1";
$wgUsePathInfo = true;

Change Logo, using a logo designed according to https://www.mediawiki.org/wiki/Manual:$wgLogo, and placed in ~/fancyclopedia.org

$wgLogo = "$wgResourceBasePath/fancyclopedia_logo.jpg";

add after 'Add more configuration options below.'


####################################################################

# Require that a user be registered before they can edit.
$wgGroupPermissions['*']['edit'] = false;

# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;

# allow users to define their own css and js
$wgAllowUserCss  = true;
$wgAllowUserJs  = true;

# Allow image uploads
$wgEnableUploads = false;

# Allow external images
$wgAllowExternalImages = true;

wfLoadExtension( 'WikiCategoryTagCloud' );

require_once "$IP/extensions/DynamicPageList/DynamicPageList.php";

wfLoadExtension( 'CategoryTagSorter' );

wfLoadExtension( 'ParserFunctions' );

wfLoadExtension( 'Iframe' );
$wgIframe['server']['fanac'] = [ 'scheme' => 'http', 'domain' => 'fanac.org' ];
$wgIframe['server']['files'] = [ 'scheme' => 'http', 'domain' => 'files.fancyclopedia.org' ];
$wgIframe['server']['local'] = [ 'scheme' => 'http', 'domain' => 'files.fancyclopedia.org' ];
$wgIframe['delay'] = -1;

# WYSISYG editor
#Default user options:
$wgDefaultUserOptions['riched_disable']               = false;
$wgDefaultUserOptions['riched_start_disabled']        = false;
$wgDefaultUserOptions['riched_use_toggle']            = true;
$wgDefaultUserOptions['riched_use_popup']             = false;
$wgDefaultUserOptions['riched_toggle_remember_state'] = true;
$wgDefaultUserOptions['riched_link_paste_text']       = true;

//MW>=1.25 and versions of WYSIWYG >= "1.5.6_0 [B551+02.07.2016]" has dependency
//to module of WikiEditor so it must be enabled too (or otherwise file
//extension.json has to be edited manually to remove dependency)
wfLoadExtension( 'WikiEditor' );

require_once "$IP/extensions/SimpleTable/SimpleTable.php";

# Allow any display title for {{DISPLAYTITLE:new title}}
$wgRestrictDisplayTitle = false;

# Citation footnotes
wfLoadExtension( 'Cite' );

# Fix double redirects after page move
$wgFixDoubleRedirects = true;

# List unused redirects
wfLoadExtension( 'UnusedRedirects' );

# Interwiki table editing
require_once "$IP/extensions/Interwiki/Interwiki.php";
$wgGroupPermissions['sysop']['interwiki'] = true;

wfLoadExtension( 'DisplayTitle' );

# Allow for string parser functions
$wgPFEnableStringFunctions = true;

# Allow CategoryFunctions - locks up site so disable
#require_once "$IP/extensions/CategoryFunctions/CategoryFunctions.php";

wfLoadExtension( 'PageInCat' );

# 404 page handler
#require_once "$IP/extensions/Special404/Special404.php";

# Missed pages stats
wfLoadExtension( 'MissedPages' );

#Interactive Timelines
wfLoadExtension("InteractiveTimeline");

#Allow external images using <img html tag
$wgAllowImageTag = true;

# Debugging

#$wgShowSQLErrors = true;
#$wgShowDBErrorBacktrace = true;
#$wgDebugDumpSql = true;
#$wgShowExceptionDetails=true;
#$wgDebugToolbar=true;
#$wgShowDebug =true;
#$wgDevelopmentWarnings=true;

# Allow regular expression functions
require_once "$IP/extensions/RegexFunctions/RegexFunctions.php";

# Allow tests whether a page is in a category
require_once "$IP/extensions/CategoryTests/CategoryTests.php";

#Search and Replace for admins only
wfLoadExtension( 'ReplaceText' );

Extensions[edit]

cd extensions
tar xzf CategoryTagSorter-REL1_33-6a74e5c.tar.gz  
tar xzf DisplayTitle-REL1_33-0705659.tar.gz
tar xzf DynamicPageList-REL1_33-c92f6b9.tar.gz
tar xzf MissedPages-REL1_33-85a2868.tar.gz
tar xzf PageInCat-REL1_33-978c744.tar.gz
tar xzf TimelineTable-REL1_33-afbeff4.tar.gz
tar xzf UnusedRedirects-REL1_33-58b6abf.tar.gz
tar xzf WikiCategoryTagCloud-REL1_33-6460123.tar.gz
tar xzf RegexFunctions-REL1_34-4c21ab2.tar.gz
tar xzf CategoryTests-REL1_34-f568f59.tar.gz
svn co https://github.com/sigbertklinke/Iframe.git/trunk Iframe
mkdir SimpleTable
vi SimpleTable/SimpleTable.php and add content from
https://www.mediawiki.org/wiki/Extension:SimpleTable/1.2a
vi SimpleTable/SimpleTable.php
add to private $separators
'barbar' => '/\|\|`/',
Change public function hooktab to have
$sep = 'barbar';
Change params setup to

       $params = 'data-expandtext="+" data-collapsetext="-"';
       $collapse = ;
       foreach ($argv as $key => $val) {
           if ($key == 'sep')
               $sep = $val;
           else if ($key == 'head')
               $head = $val;
           else if ($key == 'applycssborderstyle')
               $applycssborderstyle = $val;
           else if ($key == 'collapse')
               $collapse= 'mw-collapsed';
           else
               $params .= ' ' . $key . '="' . $val . '"';
       }
       $params .= ' ' . 'class="wikitable mw-collapsible ' . $collapse . '"';


#Give up on 404 handler, MissedPages more useful
#vi Special404/i18n/en.json
and change 

"special404-body": "The URL you requested was not found. Perhaps because you are using a Wikidot URL that is not valid with mediawiki. Try replacing - with spaces, and putting capitals on second and subsequent words. More advice on the main page"

vi DisplayTitle/includes/DisplayTitleHooks.php
and edit private static function getDisplayTitle to have
               if ( !is_null( $redirectTarget ) ) {
                       $redirect = true;
                       /* JRB we don't want this for redirects
                       $title = $redirectTarget;
                       */
Fix MissedPages extension with this
cd extensions
git clone https://github.com/TheWatcher/InteractiveTimeline.git
cd InteractiveTimeline
git checkout REL1_32

Seed wiki[edit]

Make a backup of the fancyclopedia 0 wiki

mysqldump --ignore-table=mysql.event --skip-lock-tables --quote-names -ufancytestwiki0 -p -hmysql.wiki0.fancy-test.com fancytestwiki0a > fancytestwiki0.dump

Import it into wiki

mysql -p -ufancyclopedia -hmysql.wiki.fancy-test.com fancyclopedia < fancytestwiki0.dump

.htaccess[edit]

vi .htaccess
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2 [L,QSA,B]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]

#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^/?.*$ /index.php?title=Special:Error404