How to install MediaWiki on OpenSUSE Latest

This tutorial will guide you on how to install MediaWiki on OpenSUSE Latest.

Requirements

Installation

  1. Update the package repository on your system:

    sudo zypper refresh
    
  2. Install the required packages for running MediaWiki:

    sudo zypper install apache2 mysql-community-server php7 php7-mysqlnd php7-apache2 php7-gd php7-xml php7-mbstring php7-json ImageMagick unzip
    
  3. Once all the packages are installed successfully, create a database for MediaWiki:

    mysql -u root -p
    

    Enter the MySQL root password. Then create a new database:

    CREATE DATABASE mediawikidb;
    GRANT ALL PRIVILEGES ON mediawikidb.* TO 'mediawikiuser'@'localhost' IDENTIFIED BY 'yourpassword';
    FLUSH PRIVILEGES;
    

    Replace yourpassword with a strong password.

  4. Download and extract MediaWiki:

    cd /var/www/html/
    sudo wget https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.0.tar.gz
    sudo tar -zxvf mediawiki-1.35.0.tar.gz
    sudo mv mediawiki-1.35.0 mediawiki
    
  5. Rename the LocalSettings.php file:

    cd /var/www/html/mediawiki/
    sudo mv LocalSettings.php LocalSettings.php.bk
    
  6. Set the ownership and permissions:

    sudo chown -R wwwrun:www /var/www/html/mediawiki
    sudo chmod -R 755 /var/www/html/mediawiki
    
  7. Configure Apache for MediaWiki. Create a new configuration file:

    sudo vi /etc/apache2/conf.d/mediawiki.conf
    

    And add the following configuration:

    <Directory "/var/www/html/mediawiki">
        AllowOverride All
        Require all granted
    </Directory>
    
  8. Enable the Apache rewrite module:

    sudo a2enmod rewrite
    
  9. Restart Apache and MySQL:

    sudo systemctl restart apache2
    sudo systemctl restart mysql
    
  10. Access the MediaWiki web installer via your web browser: http://your_server_ip/mediawiki/

Follow the installation steps, and provide the database name (mediawikidb), the database user (mediawikiuser), and the database password (yourpassword). Use the default settings for the rest of the installation.

  1. When the installation is complete, remove the setup directory:

    sudo rm -rf /var/www/html/mediawiki/mw-config/
    
  2. Access the MediaWiki homepage via your web browser: http://your_server_ip/mediawiki/

That's it! You've successfully installed MediaWiki on OpenSUSE Latest.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!