Difference between revisions of "Install wiki on win server"
Line 34: | Line 34: | ||
# add default document: index.php | # add default document: index.php | ||
# FastCGI Settings: add application: C:\php\php=cgi.exe | # 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" |
Revision as of 11:58, 4 September 2019
install:
- python need 2.7.xx 32bit version (python-2.7.12.msi)
- php from archive (latest php (64bit threads safe) (php-7.3.2-Win32-VC15-x64.zip))
- latest mysql (mysql-installer-community-8.0.11.0.msi)
- mediawiki from archive
Setup MySQL:
- install with legacy password
- 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:
- C:\ProgramData\MySQL\MySQL Server 8.0\my.ini - update 'caching_sha2_password' to 'mysql_native_password'
and then update mysql:
- login in mysql: mysql -uroot -ppassword
- ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Setup IIS:
- add application pool (with 32bit)
- add default document: index.php
- 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"