Manual:Installing MediaWiki

This page is a translated version of the page Manual:Installing MediaWiki and the translation is 14% complete.
Outdated translations are marked like this.


This page outlines the steps required to manually install MediaWiki. After installation, additional configuration details can be found at Manual:System administration#Configuration.

To install MediaWiki, a basic understanding of web hosting is needed. Experience with Apache, PHP, and MySQL/MariaDB will make the process easier. For any questions regarding MediaWiki installations, ask the Project: Support desk or refer to other places listed at Kommunikation .

The Appendices section below offers alternatives to manual installation, along with specific installation notes for different system configurations.

For a quicker local server setup of MediaWiki, refer to the Local development quickstart .

Check that your system meets the installation requirements.

Make sure to also check the Produktbemærkninger (Release Notes) of the MediaWiki version that you plan to install.

Download MediaWiki-softwaren

Download the MediaWiki tar file from the official download page.

If you are using MediaWiki in a production environment, the release manager has issued a strong recommendation that only versions listed at Version lifecycle and their end-of-life as the current "stable version", "legacy version" or "long-term support version" should be used in a production environment. Older versions may contain critical security vulnerabilities and other major bugs, including the threat of possible data loss and/or corruption. The current stable version is MediaWiki 1.42.3.

Extract the MediaWiki software

Download-filerne er i .tar.gz format og skal udpakkes før brug. It needs to be uncompressed before use. Dette kan gøres lokalt (og så oploades via FTP) eller direkte på serveren.

Dette gøres normalt med software såsom 7-Zip (gratis), WinZip, WinRAR eller IZArc (gratis) på Windows.

På Linux og Mac OS X kan du udpakke filen med kommandoen: tar -xzvf mediawiki-*.tar.gz

Security and file permissions - When uncompressing the archive file as the root or admin user, it may be necessary to change file ownership afterward for security, depending on your system setup. On Linux systems, this can be done using the chown command: chown -R <new_owner_user> <mediawiki_folder> For more information on securing file permissions, refer to Manual:Security#File permissions.

Oploadede filer

Hvis du ikke allerede har uploadet filerne til din webserver, så gør det nu.

Overføre filerne til din webservers web-mappe enten ved at:

  1. direkte kopiering af den udpakkede mappe eller
  1. ved brug af en FTP client såsom FileZilla (Open Source Software, Windows, OSX og Linux) eller Cyberduck (OSX).
  1. by using software already provided by your hosting service, such as the cPanel File Manager.

Sørg for, at "ændre filnavne til små bogstaver"-indstillingen for upload er deaktiveret.

Hvis du har installeret Apache er den korrekte mappe specificeret i din httpd.conf fil (den normale <apache-folder>/htdocs). By default, this is /var/www/ or <apache-folder>/htdocs.

The exact location of the Apache server settings and directories file httpd.conf depends on your operating system. Hvis du bruger Linux eller Unix server kan du kopiere filerne til enhver mappe på serveren og så lave et symbolsk link til mappen fra serverens web-mappe. In Red Hat and Fedora, the file is /etc/httpd/conf/httpd.conf.

Omdøb den oploadede mappe til et hvilket som helst navn, som du vil have i URL'en. For example, if you rename the folder to wiki, the URL will reflect this as example.com/wiki. Hvis webserveren for eks. kører som http://localhost betyder omdøbning til /w/ mappen, at adgang wikien fås på http://localhost/w/index.php.

Do not use the name /wiki/ yet if you want to set up Short URLs after running the initial configuration script.

Opret en database

MediaWiki spørger dig om database- og brugernavn og forsøger at oprette dem, hvis de ikke allerede findes.

Hvis du allerede har en database og kender rod-password til den, kan MediaWiki installationsscriptet oprette en ny database til dig.

Hvis du ikke kender rod-passwordet, for eksempel hvis du er på en hosted server, bliver du nødt til at oprette en ny database nu.

MariaDB/MySQL are the recommended databases. While PostgreSQL and SQLite are supported, they offer limited compatibility and should only be used only if necessary. If you're unsure which database to choose, use MariaDB.

Once the database setup is complete, proceed to the Run the installation script below.

SQLite

No additional setup is required for SQLite if the pdo-sqlite module for PHP is installed on the system.

På installationssiden er du nød til at vælge et database-navn (hvad som helst) og SQLite database-mappen. Til database-mappe vil installations-programmet forsøge at anvende en undermappe uden for dokumentroden og om nødvendig oprette den. Hvis mappen ikke er sikker (for eks. web-læsbar), skift navnet manuelt for at undgå den bliver tilgængelig for alle på internettet.

MariaDB/MySQL

To create the database and user for MariaDB/MySQL, you can use one of the following methods:

  • A control panel provided by your hosting service, such as phpMyAdmin.
  • SSH access to your host, where you can enter the commands below into a MySQL prompt. Se den tilhørende dokumentation. Alternativt kan du kontakte din vært udbyder, for at få dem til at oprette en konto til dig.

The following commands will create a database named my_wiki, a user named wikiuser, and assign permissions for the user on that database.

CREATE DATABASE my_wiki;
CREATE USER 'wikiuser'@'localhost' IDENTIFIED BY 'database_password';
GRANT ALL PRIVILEGES ON my_wiki.* TO 'wikiuser'@'localhost' WITH GRANT OPTION;

Hvis din database ikke kører på samme server som din webserver, skal du give den rette web-server værtnavn - eksempelvis mediawiki.example.com - som følger:

GRANT ALL PRIVILEGES ON my_wiki.* TO 'wikiuser'@'mediawiki.example.com' IDENTIFIED BY 'database_password';
  Advarsel: MySQL/MariaDB logs all queries in a history file. It will include the database password for the user account. If this concerns you, delete and disable the .mysql_history file after running these queries by following the MySQL documentation.

PostgreSQL

Hvis du bruger Postgres, skal du enten have en database og bruger oprettet til dig, eller blot levere navnet på en Postgres bruger med 'superbruger'-privilegier til konfigurations-skemaet. Dette er ofte database-brugeren med navnet postgres.

The following commands on a Linux command-line, as the postgres user, create a database user named wikiuser, and a database named my_wiki owned by the user named wikiuser.

 createuser -S -D -R -P -E wikiuser (then enter the database password)
 createdb -O wikiuser my_wiki

eller som superbruger (standandnavn: postgres) udfør følgende forespørgsler i database-prompten:

CREATE USER wikiuser WITH NOCREATEDB NOCREATEROLE NOSUPERUSER ENCRYPTED PASSWORD 'database_password';
CREATE DATABASE my_wiki WITH OWNER wikiuser;

Run the installation script

Når alle ovenstående trin er fuldført, kan du fuldføre installationen gennem en webbrowser ved at gå til index.php URI i din browser - læs instruktionen nævnt i Manual:Config script .

Further configuration

Opdater!

Efter installationen skal du sørge for at holde dig ajour med opdateringer, for at holde din server sikker!

https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/

Appendices

Alternatives to manual installation

Manual installation is often the preferred method because it gives the user more control and insight into how their wiki is installed, making troubleshooting and maintenance easier. Automated processes, packages, bundles, and services all come with their own idiosyncrasies.

Instead of manually installing MediaWiki, alternative options might be easier:

Ved oprettelse af rod-kontoen, brug en adgangskode, som du er i stand til at huske.

System-specific instructions

The pages listed on Manual:OS specific help give more detailed installation instructions aimed at specific systems.

However, by and large these per-system docs are less maintained and might not always be up to date. First consult Installing MediaWiki (this page) before looking at per-system installation documentation.

Running multiple wikis

Importing an existing wiki database

Se også