Skip to content

Adding a MediaWiki to BananaPi

In previous post I covered how to stand up CentOS 7 on BananaPi:
https://blog.scottnolan.org/2016/03/16/bananapi-server-running-centos-7-linux/

This is how to add Apache, PHP, MariaDB and MediaWiki to a BananaPi.

Install a bunch of software:
yum -y install httpd php php-mysql php-gd php-xml mariadb-server mariadb

First, set up the database:
systemctl start mariadb
mysql_secure_installation

disable anonymous users
enforce only local root login
remove test database
reload priv tables

mysql -u root -p
CREATE USER 'wiki'@'localhost' IDENTIFIED BY 'CHANGE_MARIADB_PASSWORD';
CREATE DATABASE wikidatabase;
GRANT ALL PRIVILEGES ON wikidatabase.* TO 'wiki'@'localhost';
FLUSH PRIVILEGES;
SHOW DATABASES;
SHOW GRANTS FOR 'wiki'@'localhost';
exit
systemctl enable mariadb

I like to store the passwords in a password vault like KeePassX, 1Password, or LastPass.

Set up apache:
systemctl enable httpd
vi /etc/httpd/conf/httpd.conf

Change DocumentRoot “/var/www/html”
to DocumentRoot “/var/www”

Change change ” DirectoryIndex index.html”
to ” DirectoryIndex index.html index.html.var index.php”

echo "It Works" >> /var/www/index.html
systemctl start httpd.service

Configure firewall to allow WebService
yum -y install system-config-firewall-tui
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

Test by pointing a browser at the IP_OF_BANANAPI

Now install MediaWiki:

cd /root
wget http://releases.wikimedia.org/mediawiki/1.26/mediawiki-1.26.2.tar.gz
curl -O http://releases.wikimedia.org/mediawiki/1.26/mediawiki-1.26.2.tar.gz.sig
gpg --verify mediawiki-1.26.2.tar.gz.sig mediawiki-1.26.2.tar.gz
cd /var/www
tar -zxf /root/mediawiki-1.26.2.tar.gz
ln -s mediawiki-1.26.2/ mediawiki
chown -R apache:apache /var/www/mediawiki
systemctl restart httpd.service

Finish setting up your MediaWiki Server by pointing a web browser at http://IP_OF_BANANAPI/mediawiki and finish setting up the Wiki.

Enjoy your own Wiki server.

Post a Comment

Your email is never published nor shared. Required fields are marked *