How to install MediaWiki on OpenSUSE Latest
This tutorial will guide you on how to install MediaWiki on OpenSUSE Latest.
Requirements
- OpenSUSE Latest already installed and running.
- Access to the command line interface.
Installation
Update the package repository on your system:
sudo zypper refreshInstall 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 unzipOnce all the packages are installed successfully, create a database for MediaWiki:
mysql -u root -pEnter 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
yourpasswordwith a strong password.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 mediawikiRename the
LocalSettings.phpfile:cd /var/www/html/mediawiki/ sudo mv LocalSettings.php LocalSettings.php.bkSet the ownership and permissions:
sudo chown -R wwwrun:www /var/www/html/mediawiki sudo chmod -R 755 /var/www/html/mediawikiConfigure Apache for MediaWiki. Create a new configuration file:
sudo vi /etc/apache2/conf.d/mediawiki.confAnd add the following configuration:
<Directory "/var/www/html/mediawiki"> AllowOverride All Require all granted </Directory>Enable the Apache rewrite module:
sudo a2enmod rewriteRestart Apache and MySQL:
sudo systemctl restart apache2 sudo systemctl restart mysqlAccess 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.
When the installation is complete, remove the
setupdirectory:sudo rm -rf /var/www/html/mediawiki/mw-config/Access the MediaWiki homepage via your web browser: http://your_server_ip/mediawiki/
That's it! You've successfully installed MediaWiki on OpenSUSE Latest.