Manuale:Installazione MediaWiki

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

Questa pagina include tutti i passaggi per l'installazione manuale e la configurazione di MediaWiki.

L'installazione di MediaWiki richiede una familiarità di base dell'utilizzo di un host web. È più facile se hai qualche esperienza con Apache (software per server web), PHP e MySQL/MariaDB (database). Additional help is available at Project: Support desk.

La sezione seguente Appendices offre alternative più semplici all'installazione manuale. La sezione Appendici qui di seguito fornisce anche note di installazione per configurazioni di sistema specifiche.

Se si utilizza già MediaWiki, vedere la Guida all'aggiornamento.

Verificare i requisiti di installazione

Verificare che il sistema soddisfi i requisiti di installazione.

Assicuratevi di controllare anche i Note di rilascio della versione di MediaWiki che intendete installare.

Download del software MediaWiki

Scaricare il file tar MediaWiki dalla pagina ufficiale di download.

Generalmente, se si utilizza un ambiente di produzione, si vuole eseguire l'ultima versione stabile, che è MediaWiki 1.41.0.

Estrarre il software MediaWiki

I file scaricati sono nel formato .zip o .tar.gz. È necessario decomprimere questo file di archivio prima di utilizzarlo. È possibile decomprimere il file localmente (e poi caricarlo via FTP sul server) o direttamente sul server.

In Windows puoi farlo con programmi come 7-Zip (libero), WinZip, WinRAR o IZArc (libero).

Su Linux e Mac OS X, puoi decomprimere il file utilizzando questo comando: tar -xzvf mediawiki-*.tar.gz

Se si decomprime il file di archivio come utente root/admin, è possibile che in seguito si debba cambiare la proprietà del file, a seconda della propria configurazione. Nei sistemi Linux, il comando si basa sull'uso di chown come di seguito: chown -R <new_owner_user> <mediawiki_folder> More info: Manual:Security#File_permissions


Caricare i file sul server

Se non avete ancora caricato i file sul vostro server web (o copiato, se il software del server web gira localmente sul vostro localhost), fatelo ora.

Caricare i file nella directory web del server web tramite:

  1. Copiando direttamente la cartella decompressa oppure
  2. Mediante un client FTP come FileZilla (Windows, OSX e Linux) o Cyberduck (Windows e OSX).
  3. utilizzando il software già fornito dal tuo servizio di hosting, come cPanel File Manager

Se il tuo strumento per il caricamento ha un'opzione "modifica i nomi file in minuscolo", lo devi disabilitare.

Se stai utilizzando il web server Apache HTTPD, la directory corretta è specificata nel tuo file httpd.conf nella direttiva DocumentRoot. Per impostazione predefinita, questo è /var/www/ oppure <apache-folder>/htdocs.

La posizione esatta del file delle impostazioni e delle directory del server Apache httpd.conf dipende dal sistema operativo in uso. In Debian e Ubuntu, il file per le impostazioni e le directory del server Apache è /etc/apache2/apache2.conf. Su Red Hat e Fedora, il file è /etc/httpd/conf/httpd.conf.

Rinominare la cartella caricata con il nome che si desidera avere nell'URL. Se il vostro server web funziona come http://localhost, ad esempio, rinominare la directory in /w/ significherebbe accedere al vostro wiki da http://localhost/w/index.php.

Do not use /wiki/ if you want to set it up as a Short URL after running the installation script.

Impostare il database

L'installation script di MediaWiki chiederà il nome del database e il nome utente del database, in modo che MediaWiki possa memorizzare il contenuto del wiki.

If you already have a database server and know the password for the "root" (admin) user, skip to the #Run the installation script section below.

If you don't know the password for the root user, for example if you are on a hosted server, you will have to create a new database before you run the MediaWiki installation script in the next section.

MariaDB/MySQL are the recommended databases. PostgreSQL and SQLite have limited support and should not be used unless there is a reason to. If you're unsure which database to choose, use MariaDB.

After finishing the database setup, continue with #Run the installation script below.

SQLite

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

On the SQLite installation page, choose a database name (which can be anything) and the SQLite database directory. For the database directory, the installer will attempt to use a subdirectory outside of the document root and create it if needed. If this directory is not safe (for example, web-readable), change it manually to avoid making it accessible to everyone on the web.

MariaDB/MySQL

Create the MariaDB/MySQL database and database user. There are several ways:

  • Use a control panel software offered by your Hosting service (example: PhpMyAdmin)
  • Use ssh to log into your host and type the commands below into a MySQL prompt. See the corresponding documentation of your hosting provider. Alternatively, contact your hosting provider to have them create an account for you.

The following commands create a database named my_wiki, a user named wikiuser, and set 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;

Only if your database is not running on the same server as your web server, you need to give the appropriate web server hostname (mediawiki.example.com in the example below):

GRANT ALL PRIVILEGES ON my_wiki.* TO 'wikiuser'@'mediawiki.example.com' IDENTIFIED BY 'database_password';
Attenzione Attenzione: 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

If you are using PostgreSQL, you will need to either have a database and user created for you, or supply the name of a PostgreSQL user with "superuser" privileges to the configuration form. Often, this is the database user named 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

or as superuser (default postgres) execute the following commands at the database prompt:

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

Run the installation script

Next, complete the installation of MediaWiki by going to the URL of your MediaWiki installation in your web browser: Follow the instructions in Manual:Script di configurazione .

Further configuration

Keep up to date!

Once installed, make sure you stay up to date with releases, and keep your server secure!

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:

Hosting services which provide automatical installation of applications such as MediaWiki may offer outdated versions or have other issues. If you encounter problems, it does not mean that you cannot install MediaWiki. It means that you should install MediaWiki manually.

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 Manuale:Installazione MediaWiki (this page) before looking at per-system installation documentation.

Running multiple wikis

Importing an existing wiki database

Vedi anche