MediaWiki is the software used by Wikipedia run, its a fantastic way to document share.
I would recommend installing DNSMasq to allow as to use fully qualified domain names. See here.
Setting up Mediawiki is a pretty simply task, does not really require a high level of experience. Lets dig in, install software.
1 2 3 4 |
sudo su - apt-get update apt-get upgrade apt-get install apache2 php5 php5-mysql mysql-server -y |
Once completed we start setting up the housing for MediaWiki, the following will also download the software from MediaWiki’s site and unzip it.
1 2 3 4 5 |
cd /var/www/html wget https://releases.wikimedia.org/mediawiki /1.29/mediawiki-1.29.1.tar.gz tar -xzf mediawiki-1.29.1.tar.gz mv mediawiki-1.29.1 wiki cd wiki |
Then we’ll need to setup the database and user permissions.
1 2 3 4 5 |
mysql -uroot -ppassword create database wiki; CREATE USER 'wikiuser'@'localhost' IDENTIFIED BY 'wikipassword'; GRANT ALL ON wiki.* TO 'wikiuser'@'localhost'; FLUSH PRIVILEGES; |
Now we’ll begin the Mediawiki installation, easy part. Navigate to the following URL and start the point and click install.
1 |
http://192.168.100.1/wiki |
Once connected you’ll see this.
Click on the “Set up the wiki” link, follow the instructions and enter all the information it requires. Take note, youll need the database,username and password we input earlier. Once it has finished it will let you download the LocalSettings.php file to your computer. You’ll need to upload it to the /var/www/html/wiki directory.
Lets create the DNS entries.
1 |
vim /etc/dnsmasq.d/wiki.com |
Insert the following line
1 |
address=/www.wiki.com/192.168.100.1 |
Now restart DNSMasq
1 |
/etc/init.d/dnsmasq restart |
We also need to setup the virtual host in apache
1 |
vim /etc/apache2/sites-enabled/000-default.conf |
Insert the following line
1 2 3 4 5 6 |
<VirtualHost *:80> DocumentRoot /var/www/html/wiki ServerName www.wiki.com ErrorLog /var/log/apache2/wiki-error.log CustomLog /var/log/apache2/wiki.log combined </VirtualHost> |
Restart apache.
1 |
/etc/init.d/apache2 restart |
Make sure your connected to the AP while your setting up, otherwise the setup will use the LAN IP to setup the config file.
Enjoy!