Difference between revisions of "Dev:System/MediaWiki"
(→Docker MariaDB) |
(→Links) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 148: | Line 148: | ||
- 8080:8080 | - 8080:8080 | ||
</source> | </source> | ||
+ | |||
+ | ;Compose and Start | ||
+ | :The started process will start automatic every time the computer starts. | ||
+ | :<code>sudo docker-compose -f docker-compose.yml up</code> | ||
;Build | ;Build | ||
+ | Funkar inte | ||
:<code>sudo docker-compose -f docker-compose.yml up --no-start</code> | :<code>sudo docker-compose -f docker-compose.yml up --no-start</code> | ||
+ | :<code>sudo docker run mariadb</code> | ||
+ | :<code>sudo docker run adminer</code> | ||
+ | |||
− | |||
− | |||
− | |||
Surf to '''http://localhost:8080'''. | Surf to '''http://localhost:8080'''. | ||
+ | |||
+ | == Links== | ||
+ | https://github.com/nickstenning/dockerfiles/tree/master/mediawiki | ||
+ | |||
+ | https://stackoverflow.com/questions/49267591/how-to-best-add-extensions-when-using-official-docker-image-for-mediawiki |
Revision as of 16:09, 29 November 2019
Backup
- Tofslan 192.168.1.240 (Current Main)
- Vifslan 192.168.1.241
open terminal: ssh rego@192.168.1.240
cd /var/www/html/c3/mw /var/www/html/c3/mw/c3-mw-backup.sh
It should generate
/data/Backup/MediaWiki/Archive/c3-wiki-190421-tofslan/c3-wiki-190421.sql.gz
/data/Backup/MediaWiki/Archive/c3-wiki-190421-tofslan/c3-wiki-190421.files.tgz
/data/Backup/MediaWiki/Archive/c3-wiki-190421-tofslan/c3-wiki-190421.xml.gz
cd /data/Backup/MediaWiki/Archive/
Copy files to hattifnattarna/backup/MediaWiki/Archive
sudo mkdir /mnt/hattifnattarna
sudo mkdir /mnt/hattifnattarna/backup
cd /mnt/hattifnattarna/backup
sudo mount -t cifs -o domain=MUMINDALEN,user=granlund,password=granlund //192.168.1.203/Backup /mnt/hattifnattarna/backup
cd /mnt/hattifnattarna/backup/MediaWiki/Archive
cd /data/Backup/MediaWiki/Archive/
sudo cp -r c3-wiki-190807-tofslan /mnt/hattifnattarna/backup/MediaWiki/Archive
Mac: /Users/regogranlund/Backup/MediaWiki/
Hattifnattarna:
Docker Install
Create work folder
sudo mkdir /opt/mediawiki
sudo chmod 777 /opt/mediawiki
cd /opt/mediawiki
YAML File
Create YAML file.
File Name: docker-compose.yml
Path: /opt/mediawiki/
MariaDB default port: 3306
sudo pico /opt/mediawiki/docker-compose.yml
sudo chmod 777 /opt/mediawiki/docker-compose.yml
# MediaWiki with MariaDB
#
# Access via "http://localhost:8088"
# (or "http://$(docker-machine ip):8088" if using docker-machine)
version: '3'
services:
mediawiki:
image: mediawiki
restart: always
ports:
- 8088:80
links:
- database
volumes:
- /var/www/html/images
# After initial setup, download LocalSettings.php to the same directory as
# this yaml and uncomment the following line and use compose to restart
# the mediawiki service
# - ./LocalSettings.php:/var/www/html/LocalSettings.php
database:
image: mariadb
restart: always
environment:
# @see https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/DefaultSettings.php
MYSQL_DATABASE: my_wiki
MYSQL_USER: wikiuser
MYSQL_PASSWORD: example
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
Build
??? Pröva att inte göra, inget händer
cd /opt/mediawiki
sudo docker-compose -f /opt/mediawiki/docker-compose.yml build
Start
cd /opt/mediawiki
sudo docker-compose up
Test Connect
Test with MySql Workbench
Setup
surf to: http://localhost:8088/
- Language: English
- Database Host: localhost
- Database Name: my_wiki
- DataBase userName: wikiuser
- DataBase password: example
Docker MariaDB
This working.
https://hub.docker.com/_/mariadb/
- Create mariadb Folder
mkdir mariadb
cd mariadb
- Edit docker-compose.yml
sudo pico /home/rego/mariadb/docker-compose.yml
# Use root/example as user/password credentials
version: '3.1'
services:
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: mariadb
adminer:
image: adminer
restart: always
ports:
- 8080:8080
- Compose and Start
- The started process will start automatic every time the computer starts.
sudo docker-compose -f docker-compose.yml up
- Build
Funkar inte
sudo docker-compose -f docker-compose.yml up --no-start
sudo docker run mariadb
sudo docker run adminer
Surf to http://localhost:8080.
Links
https://github.com/nickstenning/dockerfiles/tree/master/mediawiki