Install wiki on win server

From MPSWiki
Revision as of 11:59, 4 September 2019 by 192.168.0.3 (talk)
Jump to: navigation, search

install:

  1. python need 2.7.xx 32bit version (python-2.7.12.msi)
  2. php from archive (latest php (64bit threads safe) (php-7.3.2-Win32-VC15-x64.zip))
  3. latest mysql (mysql-installer-community-8.0.11.0.msi)
  4. mediawiki from archive


Setup MySQL:

  1. install with legacy password
  2. remove .NET connector


create: mysql -uroot -ppassword CREATE DATABASE fieldprowiki;

backup: mysqldump.exe -uroot -ppassword fieldprowiki > e:\fieldprowiki.sql

restore: mysql -uroot -ppassword fieldprowiki < e:\fieldprowiki.sql


if 'caching_sha2_password' error - then:

  1. C:\ProgramData\MySQL\MySQL Server 8.0\my.ini - update 'caching_sha2_password' to 'mysql_native_password'

and then update mysql:

  1. login in mysql: mysql -uroot -ppassword
  2. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';


Setup IIS:

  1. add application pool (with 32bit)
  2. add default document: index.php
  3. FastCGI Settings: add application: C:\php\php=cgi.exe


Backup script:

@echo off
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION

set WIKI_FOLDER=E:\WWW\efieldpro\FieldproWiki
set BAKEUP_FOLDER=C:\Backups\wiki

set WIKI_DATABASE=fieldprowiki
set WIKI_DATABASE_USER=root
set WIKI_DATABASE_PASS=prosuite

for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do (
	set DATETIME=%%I
	set WIKI_BACKUP_DATETIME=!DATETIME:~0,8!_!DATETIME:~8,6!
)

@echo Backup wiki folder from !WIKI_FOLDER!, new backup file wiki_!WIKI_BACKUP_DATETIME!.7z will be in !BAKEUP_FOLDER!
"C:\Backups\wiki\7za.exe" a "!BAKEUP_FOLDER!\wiki_!WIKI_BACKUP_DATETIME!.7z" "!WIKI_FOLDER!"

@echo Backup wiki database !WIKI_DATABASE!, new backup file !WIKI_DATABASE!_!WIKI_BACKUP_DATETIME!.sql will be in !BAKEUP_FOLDER!
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqldump.exe" -u!WIKI_DATABASE_USER! -p!WIKI_DATABASE_PASS! !WIKI_DATABASE! > "!BAKEUP_FOLDER!\!WIKI_DATABASE!_!WIKI_BACKUP_DATETIME!.sql"