Difference between revisions of "Install wiki on win server"

From MPSWiki
Jump to: navigation, search
(Prepare)
(Prepare)
Line 1: Line 1:
 
=Prepare=
 
=Prepare=
 
#Install [https://drive.google.com/u/0/uc?id=1tHvZMHZxkApbz0WQP1ALtZS_IxHXn_u0&export=download Python]
 
#Install [https://drive.google.com/u/0/uc?id=1tHvZMHZxkApbz0WQP1ALtZS_IxHXn_u0&export=download Python]
#[https://drive.google.com/u/0/uc?id=12bQS-caoryip0wIn78IMoAV4AiNo4O-6&export=download Download PHP arvhive]
+
#[https://drive.google.com/u/0/uc?export=download&confirm=Zt0E&id=12bQS-caoryip0wIn78IMoAV4AiNo4O-6 Download PHP arvhive]
 
Download  php from archive (latest php (64bit threads safe) (php-7.3.2-Win32-VC15-x64.zip))
 
Download  php from archive (latest php (64bit threads safe) (php-7.3.2-Win32-VC15-x64.zip))
 
##Extract all files from archive to C:\PHP\
 
##Extract all files from archive to C:\PHP\

Revision as of 09:00, 20 December 2020

Prepare

  1. Install Python
  2. Download PHP arvhive

Download php from archive (latest php (64bit threads safe) (php-7.3.2-Win32-VC15-x64.zip))

    1. Extract all files from archive to C:\PHP\
    2. Php-mapping.png
  1. latest mysql (mysql-installer-community-8.0.11.0.msi)
  2. 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"