Install self-hosted wiki platform

Install Self-Hosted Wiki Platform

This tutorial will guide you through the process of setting up a self-hosted wiki platform. This is suitable for developers and homelab enthusiasts who want to have their own private knowledge base.

Hardware or Software Requirements

Step-by-Step Instructions

    • Login to your server via SSH.

  1. Update the package list and upgrade existing packages:

    sudo apt update
    sudo apt upgrade -y
    
  2. Install necessary dependencies:

    sudo apt install apache2 php libapache2-mod-php php-mysql git -y
    
  3. Clone the MediaWiki repository from GitHub to your server:

    cd /var/www/html
    git clone https://github.com/wikimedia/mediawiki.git
    
  4. Create a MySQL database and user for MediaWiki:

    sudo mysql -u root -p
    CREATE DATABASE mediawiki;
    CREATE USER 'mediawikiuser'@'localhost' IDENTIFIED BY 'yourpassword';
    GRANT ALL PRIVILEGES ON mediawiki.* TO 'mediawikiuser'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;
    
  5. Configure MediaWiki:

    cd /var/www/html/mediawiki
    cp LocalSettings.php.sample LocalSettings.php
    nano LocalSettings.php
    

    In the LocalSettings.php file, configure the database settings and other preferences as needed.

  6. Create a virtual host for your wiki:

    <VirtualHost *:80>
        ServerName yourdomain.com
        DocumentRoot /var/www/html/mediawiki
    
        <Directory /var/www/html/mediawiki>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Require all granted
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
    

    Replace yourdomain.com with your actual domain name. Save and exit the file.

  7. Restart Apache to apply changes:

    sudo systemctl restart apache2
    
    • Visit http://yourdomain.com in your web browser. Follow the on-screen instructions to complete the installation.

Commands Where Useful

Troubleshooting Section

Conclusion

You have successfully installed a self-hosted wiki platform. This setup provides you with a flexible and powerful tool for managing your knowledge base. For further customization, refer to the official MediaWiki documentation.

Comments