Difference between revisions of "Ubuntu"

10,043 bytes added ,  5 months ago
no edit summary
 
(10 intermediate revisions by the same user not shown)
Line 562: Line 562:


<small>[1]-  Killed                  sudo mysqld_safe --skip-grant-tables --skip-networking</small></blockquote>'''Termina il processo MySQL in modalità sicura:'''
<small>[1]-  Killed                  sudo mysqld_safe --skip-grant-tables --skip-networking</small></blockquote>'''Termina il processo MySQL in modalità sicura:'''




Line 586: Line 600:
  <small>paralle+  178472  0.0  0.1   9212  2432 pts/0    S+   11:13   0:00 grep --color=auto mysql</small></blockquote>
  <small>paralle+  178472  0.0  0.1   9212  2432 pts/0    S+   11:13   0:00 grep --color=auto mysql</small></blockquote>


==== '''Riavvia MySQL in modalità normale''' ====
===='''Riavvia MySQL in modalità normale'''====
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 




Line 596: Line 625:
Dopo aver terminato i processi problematici, riavvia il servizio MySQL in modalità standard:<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo systemctl restart mysql'''</small></blockquote>
Dopo aver terminato i processi problematici, riavvia il servizio MySQL in modalità standard:<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo systemctl restart mysql'''</small></blockquote>


== 3. Problemi con la configurazione del file MySQL ==
==3. Problemi con la configurazione del file MySQL==
'''Errore comune:''' Parametro <code>bind-address</code> mal configurato.
'''Errore comune:''' Parametro <code>bind-address</code> mal configurato.


'''Verifica il contenuto del file di configurazione:''' {{Tooltip|2={{Tooltip|Configurazione di MySQL|Il file <code>/etc/mysql/my.cnf</code> imposta l'indirizzo <code>bind-address = 0.0.0.0</code> per consentire connessioni da qualsiasi IP e include configurazioni aggiuntive da <code>/etc/mysql/conf.d/</code> e <code>/etc/mysql/mysql.conf.d/</code>. Consultare la documentazione ufficiale per dettagli: <code>http://dev.mysql.com/doc/mysql/en/server-system-variables.html</code>.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ cat /etc/mysql/my.cnf'''</small>
'''Verifica il contenuto del file di configurazione:''' {{Tooltip|2={{Tooltip|Configurazione di MySQL|Il file <code>/etc/mysql/my.cnf</code> imposta l'indirizzo <code>bind-address = 0.0.0.0</code> per consentire connessioni da qualsiasi IP e include configurazioni aggiuntive da <code>/etc/mysql/conf.d/</code> e <code>/etc/mysql/mysql.conf.d/</code>. Consultare la documentazione ufficiale per dettagli: <code>http://dev.mysql.com/doc/mysql/en/server-system-variables.html</code>.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ cat /etc/mysql/my.cnf'''</small>
Line 645: Line 679:
<small>mysql.cnf  mysqldump.cnf</small></blockquote>
<small>mysql.cnf  mysqldump.cnf</small></blockquote>


== 4. Problemi con PHP ==
==4. Problemi con PHP==
'''Errore comune:''' Moduli mancanti o versioni non compatibili.
'''Errore comune:''' Moduli mancanti o versioni non compatibili.


'''Controlla la versione di PHP installata:'''{{Tooltip|2={{Tooltip|Informazioni sulla versione di PHP|Il comando <code>php -v</code> mostra che PHP versione <code>8.1.2-1ubuntu2.20</code> con supporto CLI è installato. Utilizza <code>Zend Engine v4.1.2</code> e ha il modulo <code>Zend OPcache</code> abilitato per ottimizzare le prestazioni.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ php -v'''</small>
'''Controlla la versione di PHP installata:'''{{Tooltip|2={{Tooltip|Informazioni sulla versione di PHP|Il comando <code>php -v</code> mostra che PHP versione <code>8.1.2-1ubuntu2.20</code> con supporto CLI è installato. Utilizza <code>Zend Engine v4.1.2</code> e ha il modulo <code>Zend OPcache</code> abilitato per ottimizzare le prestazioni.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ php -v'''</small>
Line 768: Line 807:
<small>0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.</small></blockquote>
<small>0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.</small></blockquote>


== 5. Problemi con Apache ==
==5. Problemi con Apache==


'''Errore comune:''' Apache non attivo o moduli disabilitati.
'''Errore comune:''' Apache non attivo o moduli disabilitati.


'''Controlla lo stato del servizio Apache:'''{{Tooltip|2={{Tooltip|Stato del servizio Apache|Il comando <code>sudo systemctl status apache2</code> conferma che Apache è attivo (<code>active (running)</code>) da 17 ore. Il processo principale ha il PID <code>149151</code>, utilizza 6 task e 13 MB di memoria. È stato avviato correttamente il 4 gennaio e ricaricato il 5 gennaio.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo systemctl status apache2'''</small>
'''Controlla lo stato del servizio Apache:'''{{Tooltip|2={{Tooltip|Stato del servizio Apache|Il comando <code>sudo systemctl status apache2</code> conferma che Apache è attivo (<code>active (running)</code>) da 17 ore. Il processo principale ha il PID <code>149151</code>, utilizza 6 task e 13 MB di memoria. È stato avviato correttamente il 4 gennaio e ricaricato il 5 gennaio.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo systemctl status apache2'''</small>
Line 822: Line 866:
<small>Module rewrite already enabled</small></blockquote>
<small>Module rewrite already enabled</small></blockquote>


== '''6. Problemi con MediaWiki''' ==
=='''6. Problemi con MediaWiki'''==
'''Errore comune:''' Mancanza del file <code>LocalSettings.php</code>.
'''Errore comune:''' Mancanza del file <code>LocalSettings.php</code>.


'''Controlla la directory di MediaWiki:'''{{Tooltip|2={{Tooltip|Contenuto della directory di MediaWiki|La directory <code>/var/www/html/mediawiki/</code> contiene file e directory essenziali per MediaWiki: 1) File principali come <code>index.php</code>, <code>api.php</code>, e <code>rest.php</code>. 2) Directory per estensioni, immagini, e risorse (<code>extensions</code>, <code>images</code>, <code>skins</code>). 3) File di documentazione come <code>README.md</code> e <code>INSTALL</code>. Il file <code>LocalSettings.php</code>, necessario per la configurazione, sembra mancare.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ ls /var/www/html/mediawiki/'''</small>
'''Controlla la directory di MediaWiki:'''{{Tooltip|2={{Tooltip|Contenuto della directory di MediaWiki|La directory <code>/var/www/html/mediawiki/</code> contiene file e directory essenziali per MediaWiki: 1) File principali come <code>index.php</code>, <code>api.php</code>, e <code>rest.php</code>. 2) Directory per estensioni, immagini, e risorse (<code>extensions</code>, <code>images</code>, <code>skins</code>). 3) File di documentazione come <code>README.md</code> e <code>INSTALL</code>. Il file <code>LocalSettings.php</code>, necessario per la configurazione, sembra mancare.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ ls /var/www/html/mediawiki/'''</small>
Line 843: Line 892:
http://localhost/mediawiki
http://localhost/mediawiki


== 7. Problemi di sincronizzazione con Masticationpedia ==
==7. Problemi di sincronizzazione con Masticationpedia==
'''Errore comune:''' Errori API o configurazioni mancanti
'''Errore comune:''' Errori API o configurazioni mancanti


'''Verifica i log di Apache per errori correlati:'''{{Tooltip|2={{Tooltip|Log in tempo reale di Apache|Il comando <code>sudo tail -f /var/log/apache2/error.log</code> mostra eventi importanti: 1) Apache (<code>2.4.52</code>) è configurato e operativo (<code>PID 149151</code>). 2) Apache è stato arrestato con il segnale <code>SIGWINCH</code> e riavviato correttamente con un nuovo PID (<code>184298</code>). Questi eventi indicano una gestione ordinata del servizio.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo tail -f /var/log/apache2/error.log'''</small>
'''Verifica i log di Apache per errori correlati:'''{{Tooltip|2={{Tooltip|Log in tempo reale di Apache|Il comando <code>sudo tail -f /var/log/apache2/error.log</code> mostra eventi importanti: 1) Apache (<code>2.4.52</code>) è configurato e operativo (<code>PID 149151</code>). 2) Apache è stato arrestato con il segnale <code>SIGWINCH</code> e riavviato correttamente con un nuovo PID (<code>184298</code>). Questi eventi indicano una gestione ordinata del servizio.}}}}<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo tail -f /var/log/apache2/error.log'''</small>
Line 858: Line 912:
<small>[Sun Jan 05 11:48:56.032352 2025] [core:notice] '''[pid 184298]''' AH00094: Command line: '/usr/sbin/apache2'</small></blockquote>
<small>[Sun Jan 05 11:48:56.032352 2025] [core:notice] '''[pid 184298]''' AH00094: Command line: '/usr/sbin/apache2'</small></blockquote>


= Installazione e configurazione MadiaWiki =
=Installazione e configurazione MadiaWiki=
 
==Scarica la versione 1.43:==
 
 
 
 
Usa il comando <code>wget</code> per scaricare la versione indicata:


== Scarica la versione 1.43: ==
<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ wget <nowiki>https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.0.tar.gz</nowiki>'''</small>
Usa il comando <code>wget</code> per scaricare la versione indicata:<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ wget <nowiki>https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.0.tar.gz</nowiki>'''</small>


<small>--2025-01-05 15:51:19--  <nowiki>https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.0.tar.gz</nowiki></small>
<small>--2025-01-05 15:51:19--  <nowiki>https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.0.tar.gz</nowiki></small>
Line 877: Line 937:
<small>mediawiki-1.43.0.tar.gz                      100%[==============================================================================================>]  87.69M  5.41MB/s    in 18s     </small>
<small>mediawiki-1.43.0.tar.gz                      100%[==============================================================================================>]  87.69M  5.41MB/s    in 18s     </small>


<small>2025-01-05 15:51:37 (4.89 MB/s) - ‘mediawiki-1.43.0.tar.gz’ saved [91947888/91947888]</small></blockquote>'''Estrai l'archivio scaricato''': Questo creerà una directory chiamata <code>'''mediawiki-1.43.0'''</code>.
<small>2025-01-05 15:51:37 (4.89 MB/s) - ‘mediawiki-1.43.0.tar.gz’ saved [91947888/91947888]</small></blockquote>
 
'''Estrai l'archivio scaricato''': Questo creerà una directory chiamata <code>'''mediawiki-1.43.0'''</code>.
 
 
 


llels@ubuntu-linux-22-04-02-desktop:'''~$ tar -xvzf mediawiki-1.43.0.tar.gz'''
llels@ubuntu-linux-22-04-02-desktop:'''~$ tar -xvzf mediawiki-1.43.0.tar.gz'''


Sostituisci la directory esistente:<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo mv /var/www/html/mediawiki /var/www/html/mediawiki_old'''</small>
 
 
 
 
 
 
Sostituisci la directory esistente:
 
<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo mv /var/www/html/mediawiki /var/www/html/mediawiki_old'''</small>


<small>sudo mv mediawiki-1.43.0 /var/www/html/mediawiki</small>
<small>sudo mv mediawiki-1.43.0 /var/www/html/mediawiki</small>


<small>[sudo] password for parallels:</small> </blockquote>'''Verifica i permessi''': Assicurati che Apache possa accedere ai file:
<small>[sudo] password for parallels:</small> </blockquote>
 
'''Verifica i permessi''': Assicurati che Apache possa accedere ai file:


== 2. Configurazione del database ==
'''Verifica la connessione al database''': MediaWiki 1.43 dovrebbe essere compatibile con il database esistente. Accedi al database per verificare:<blockquote><small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ mysql -u root -p'''</small>


<small>Enter password:</small> {{Rosso inizio}}Errore {{Rosso Fine}}
ffffffff


<small>ERROR 1698 (28000): Access denied for user 'root'@'localhost'</small></blockquote>Desccrizione errore e risoluzione {{Tooltip|2={{Tooltip|Errore "Access denied for user 'root'@'localhost"|L'errore si verifica quando MySQL nega l'accesso all'utente <code>root</code>. Cause comuni includono: 1) Autenticazione tramite <code>auth_socket</code>, 2) Password errata, 3) Privilegi insufficienti. Soluzione: Accedi con <code>sudo mysql</code>, cambia il metodo di autenticazione con <code>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'nuova_password';</code>, oppure resetta la password avviando MySQL in modalità sicura (<code>mysqld_safe --skip-grant-tables</code>). Verifica sempre i privilegi e riavvia il servizio MySQL.}}}}


==2. Configurazione del database==


<p>'''Verifica la connessione al database''': MediaWiki 1.43 dovrebbe essere compatibile con il database esistente. Accedi al database per verificare:
<small>parallels@ubuntu-linux-22-04-02-desktop:'''~$ mysql -u root -p'''</small>
<small>Enter password:</small> {{Rosso inizio}}Errore {{Rosso Fine}}</p>


fffff


<small>ERROR 1698 (28000): Access denied for user 'root'@'localhost'</small>Desccrizione errore e risoluzione {{Tooltip|Errore "Access denied for user 'root'@'localhost"|L'errore si verifica quando MySQL nega l'accesso all'utente <code>root</code>. Cause comuni includono: 1) Autenticazione tramite <code>auth_socket</code>, 2) Password errata, 3) Privilegi insufficienti. Soluzione: Accedi con <code>sudo mysql</code>, cambia il metodo di autenticazione con <code>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'nuova_password';</code>, oppure resetta la password avviando MySQL in modalità sicura (<code>mysqld_safe --skip-grant-tables</code>). Verifica sempre i privilegi e riavvia il servizio MySQL.}}






Passaggi fondamentali:
Passaggi fondamentali:
parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo mv /var/www/html/mediawiki /var/www/html/mediawiki_old'''  sudo mv mediawiki-1.43.0 /var/www/html/mediawiki  [sudo] password for parallels:                                                                                                        ----
#parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo chown -R www-data:www-data /var/www/html/mediawiki'''  sudo chmod -R 755 /var/www/html/mediawiki  ----
#parallels@ubuntu-linux-22-04-02-desktop:'''~$ mysql -u root -p'''  Enter password:  '''ERROR 1698 (28000)''': Access denied for user 'root'@'localhost' ----
#parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo mysql'''  Welcome to the MySQL monitor.  Commands end with ; or \g.  Your MySQL connection id is 9  Server version: 8.0.40-0ubuntu0.22.04.1 (Ubuntu)  Copyright (c) 2000, 2024, Oracle and/or its affiliates.  Oracle is a registered trademark of Oracle Corporation and/or its  affiliates. Other names may be trademarks of their respective  owners.  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. ----
#parallels@ubuntu-linux-22-04-02-desktop:'''~$ sudo mysql'''  Welcome to the MySQL monitor.  Commands end with ; or \g.  Your MySQL connection id is 10  Server version: 8.0.40-0ubuntu0.22.04.1 (Ubuntu)  Copyright (c) 2000, 2024, Oracle and/or its affiliates.  Oracle is a registered trademark of Oracle Corporation and/or its  affiliates. Other names may be trademarks of their respective  owners.  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Rosa!01011925';  Query OK, 0 rows affected (0.27 sec)  mysql> FLUSH PRIVILEGES;  Query OK, 0 rows affected (0.04 sec)  mysql> EXIT; ----
#parallels@ubuntu-linux-22-04-02-desktop:'''~$ mysql -u root -p'''  Enter password:  Welcome to the MySQL monitor.  Commands end with ; or \g.  Your MySQL connection id is 11  Server version: 8.0.40-0ubuntu0.22.04.1 (Ubuntu)  Copyright (c) 2000, 2024, Oracle and/or its affiliates.  Oracle is a registered trademark of Oracle Corporation and/or its  affiliates. Other names may be trademarks of their respective  owners.  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  mysql> Exit
#parallels@ubuntu-linux-22-04-02-desktop:'''~$ cd /var/www/html/mediawiki''' ----
#parallels@ubuntu-linux-22-04-02-desktop:'''/var/www/html/mediawiki$ ls -l'''    ----
<small>
<blockquote>
*total 2184
*-rwxr-xr-x  1 www-data www-data    1511 Dec  5 16:41 api.php
*-rwxr-xr-x  1 www-data www-data  352410 Dec  5 16:42 autoload.php
*drwxr-xr-x  2 www-data www-data    4096 Jan  5 15:58 cache
*-rwxr-xr-x  1 www-data www-data     168 Dec  5 16:41 CODE_OF_CONDUCT.md
*-rwxr-xr-x  1 www-data www-data    8358 Dec  5 16:42 composer.json
* -rwxr-xr-x  1 www-data www-data     125 Dec  5 16:41 composer.local.json-sample
*-rwxr-xr-x  1 www-data www-data   19421 Dec  5 16:41 COPYING
*-rwxr-xr-x  1 www-data www-data   15957 Dec  5 16:42 CREDITS
*-rwxr-xr-x  1 www-data www-data    1762 Dec 20 19:45 docker-compose.yml  drwxr-xr-x  5 www-data www-data    4096 Jan  5 15:58 docs
*drwxr-xr-x 35 www-data www-data    4096 Jan  5 15:58 extensions
* -rwxr-xr-x  1 www-data www-data      95 Dec  5 16:41 FAQ  -rwxr-xr
*-x  1 www-data www-data 1639880 Dec  5 16:42 HISTORY
* drwxr-xr-x  2 www-data www-data    4096 Jan  5 15:58 images
*-rwxr-xr-x  1 www-data www-data    2221 Dec  5 16:41 img_auth.php
*drwxr-xr-x 96 www-data www-data    4096 Jan  5 15:58 includes
*-rwxr-xr-x  1 www-data www-data    2213 Dec  5 16:41 index.php
*-rwxr-xr-x  1 www-data www-data    3685 Dec  5 16:42 INSTALL
* -rwxr-xr-x  1 www-data www-data    1302 Dec  5 16:41 jsdoc.json
* drwxr-xr-x  5 www-data www-data    4096 Jan  5 15:58 languages
*-rwxr-xr-x  1 www-data www-data    1464 Dec  5 16:41 load.php
* drwxr-xr-x 11 www-data www-data   12288 Jan  5 15:58 maintenance
* drwxr-xr-x  4 www-data www-data    4096 Jan  5 15:58 mw-config
* -rwxr-xr-x  1 www-data www-data    1761 Dec  5 16:41 opensearch_desc.php
*-rwxr-xr-x  1 www-data www-data    1643 Dec  5 16:41 README.md
*-rwxr-xr-x  1 www-data www-data   54673 Dec 20 19:45 RELEASE-NOTES-1.43
*drwxr-xr-x  5 www-data www-data    4096 Jan  5 15:58 resources
*-rwxr-xr-x  1 www-data www-data    1239 Dec  5 16:41 rest.php
* -rwxr-xr-x  1 www-data www-data     199 Dec  5 16:41 SECURITY
*drwxr-xr-x  6 www-data www-data    4096 Jan  5 15:58 skins
* drwxr-xr-x 11 www-data www-data    4096 Jan  5 15:58 tests
* -rwxr-xr-x  1 www-data www-data    1659 Dec  5 16:41 thumb_handler.php
*-rwxr-xr-x  1 www-data www-data    1357 Dec  5 16:41 thumb.php
*-rwxr-xr-x  1 www-data www-data    4394 Dec  5 16:41 UPGRADE
*drwxr-xr-x 21 www-data www-data    4096 Jan  5 15:58 vendor ----
<br />
<br />
   </small>
A questo punto hai già scaricato e configurato i file di MediaWiki nella directory <code>/var/www/html/mediawiki</code>. Ora, il prossimo passaggio è completare l'installazione e configurazione di MediaWiki tramite il browser
== 1. Verifica che Apache e MySQL siano in esecuzione'''e''' ==
Assicurati che il server Apache e il database MySQL siano attivi
lels@ubuntu-linux-22-04-02-desktop:/var/www/html/mediawiki$ sudo systemctl status apache2
sudo systemctl status mysql
[sudo] password for parallels:
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2025-01-05 11:48:55 CET; 5h 37min ago
       Docs: <nowiki>https://httpd.apache.org/docs/2.4/</nowiki>
    Process: 184294 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 184298 (apache2)
      Tasks: 6 (limit: 2258)
     Memory: 12.1M
        CPU: 837ms
     CGroup: /system.slice/apache2.service
             ├─184298 /usr/sbin/apache2 -k start
             ├─184299 /usr/sbin/apache2 -k start
             ├─184300 /usr/sbin/apache2 -k start
             ├─184301 /usr/sbin/apache2 -k start
             ├─184302 /usr/sbin/apache2 -k start
             └─184303 /usr/sbin/apache2 -k start
Jan 05 11:48:55 ubuntu-linux-22-04-02-desktop systemd[1]: Starting The Apache HTTP Server...
Jan 05 11:48:55 ubuntu-linux-22-04-02-desktop systemd[1]: Started The Apache HTTP Server.
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2025-01-05 11:15:31 CET; 6h ago
    Process: 178773 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
   Main PID: 178781 (mysqld)
     Status: "Server is operational"
      Tasks: 38 (limit: 2258)
     Memory: 366.2M
        CPU: 1min 49.336s
     CGroup: /system.slice/mysql.service
             └─178781 /usr/sbin/mysqld
Jan 05 11:15:30 ubuntu-linux-22-04-02-desktop systemd[1]: Starting MySQL Community Server...
Jan 05 11:15:31 ubuntu-linux-22-04-02-desktop systemd[1]: Started MySQL Community Server.
=== '''2. Apri il browser e accedi all'installazione''' ===
Vai al browser e digita l'indirizzo:
<nowiki>:</nowiki>
==Installazione e Configurazione del 'Localsetting.php'==
==Cosa Fare Ora==
Se devi modificare il file di configurazione di MediaWiki, il percorso corretto è:
<code>/var/www/html/mediawiki/LocalSettings.php</code>
Puoi aprirlo per modificarlo con un editor di testo, ad esempio:
===Usando nano===
<code>sudo nano /var/www/html/mediawiki/LocalSettings.php</code>
===Usando vim===
<code>sudo vim /var/www/html/mediawiki/LocalSettings.php</code>
===Per verificare rapidamente il contenuto===
<code>cat /var/www/html/mediawiki/LocalSettings.php</code>
==Nota==
*Assicurati di avere i permessi necessari per modificare il file. Se non sei sicuro, utilizza <code>sudo</code> come mostrato sopra.
*Prima di apportare modifiche, è consigliabile eseguire un backup del file:
<code>sudo cp /var/www/html/mediawiki/LocalSettings.php /var/www/html/mediawiki/LocalSettings.php.bak</code>
Se hai bisogno di aiuto per modificare o configurare il file, fammi sapere!




== Per iniziare a settare il Mediawiki ==
Per entrare nella directory del MediaWiki in Ubuntu: parallels@ubuntu-linux-22-04-02-desktop:'''~$ cd /var/www/html/mediawiki'''


parallels@ubuntu-linux-22-04-02-desktop:'''~$ mysql -u root -p'''
Per modifica necessita di un editor: parallels@ubuntu-linux-22-04-02-desktop:'''/var/www/html/mediawiki$ sudo nano /var/www/html/mediawiki/LocalSettings.php'''


Enter password:  
[sudo] password for parallels: Rosa01011925


ERROR 1698 (28000): Access denied for user 'root'@'localhost'


parallels@ubuntu-linux-22-04-02-desktop:~$ sudo mysql
<?php


Welcome to the MySQL monitor.  Commands end with ; or \g.
<nowiki>#</nowiki> This file was automatically generated by the MediaWiki 1.43.0 installer.


Your MySQL connection id is 9
<nowiki>#</nowiki> Manual changes should be tracked in case you need to recreate them.


Server version: 8.0.40-0ubuntu0.22.04.1 (Ubuntu)
<nowiki>#</nowiki> =============================================================================


Copyright (c) 2000, 2024, Oracle and/or its affiliates.
<nowiki>#</nowiki> **PROTEZIONE CONTRO ACCESSI NON AUTORIZZATI**


Oracle is a registered trademark of Oracle Corporation and/or its
<nowiki>#</nowiki> =============================================================================


affiliates. Other names may be trademarks of their respective
if ( !defined( 'MEDIAWIKI' ) ) {


owners.
    exit;


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
}


mysql>  
<nowiki>#</nowiki> =============================================================================


mysql>  
<nowiki>#</nowiki> **CONFIGURAZIONE DEL SITO**


mysql> q
<nowiki>#</nowiki> =============================================================================


    -> ^C
$wgSitename = "Masticationpedia";


mysql>  
<nowiki>#</nowiki> URL base del sito e directory degli script


mysql> q
$wgScriptPath = "";


    -> parallels@ubuntu-linux-22-04-02-desktop:
$wgServer = "<nowiki>http://10.211.55.3</nowiki>";


    ->
$wgResourceBasePath = $wgScriptPath;


    ->  
<nowiki>#</nowiki> Configurazione del logo


    ->
$wgLogos = [


    ->
    '1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",


    ->
    'icon' => "$wgResourceBasePath/resources/assets/change-your-logo-icon.svg",


    ->
];


    -> q
<nowiki>#</nowiki> =============================================================================


    -> ^C
<nowiki>#</nowiki> **CONFIGURAZIONE EMAIL**


mysql>  
<nowiki>#</nowiki> =============================================================================


mysql> ^C
$wgEnableEmail = true;


mysql>
$wgEnableUserEmail = true; # UPO (User Preference Option)


mysql> Exit
$wgEmergencyContact = "";  # Email di emergenza


Bye
$wgPasswordSender = "";    # Mittente delle email di sistema


parallels@ubuntu-linux-22-04-02-desktop:~$ sudo mysql
<nowiki>#</nowiki> Notifiche email


Welcome to the MySQL monitor.  Commands end with ; or \g.
$wgEnotifUserTalk = false; # Notifiche sulle discussioni utente


Your MySQL connection id is 10
$wgEnotifWatchlist = false; # Notifiche sulla watchlist


Server version: 8.0.40-0ubuntu0.22.04.1 (Ubuntu)
$wgEmailAuthentication = true; # Richiesta autenticazione per email


Copyright (c) 2000, 2024, Oracle and/or its affiliates.
<nowiki>#</nowiki> =============================================================================


Oracle is a registered trademark of Oracle Corporation and/or its
<nowiki>#</nowiki> **CONFIGURAZIONE DATABASE**


affiliates. Other names may be trademarks of their respective
<nowiki>#</nowiki> =============================================================================


owners.
$wgDBtype = "mysql";          # Tipo di database


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
$wgDBserver = "localhost";    # Server database


mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Rosa!01011925';
$wgDBname = "mediawiki_db";   # Nome del database


Query OK, 0 rows affected (0.27 sec)
$wgDBuser = "root";           # Utente del database


mysql> FLUSH PRIVILEGES;
$wgDBpassword = "Rosa!01011925"; # Password del database


Query OK, 0 rows affected (0.04 sec)
<nowiki>#</nowiki> Opzioni specifiche per MySQL


mysql> EXIT;
$wgDBprefix = "Wiki";         # Prefisso per le tabelle


Bye
$wgDBssl = false;             # SSL disabilitato per il database


parallels@ubuntu-linux-22-04-02-desktop:~$ mysql -u root -p
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary"; # Opzioni per le tabelle


Enter password:
<nowiki>#</nowiki> Tabelle condivise


Welcome to the MySQL monitor.  Commands end with ; or \g.
$wgSharedTables[] = "actor";


Your MySQL connection id is 11
<nowiki>#</nowiki> =============================================================================


Server version: 8.0.40-0ubuntu0.22.04.1 (Ubuntu)
<nowiki>#</nowiki> **PRESTAZIONI E CACHE**


Copyright (c) 2000, 2024, Oracle and/or its affiliates.
<nowiki>#</nowiki> =============================================================================


Oracle is a registered trademark of Oracle Corporation and/or its
$wgMainCacheType = CACHE_NONE; # Nessuna cache abilitata


affiliates. Other names may be trademarks of their respective
$wgMemCachedServers = [];      # Nessun server di memorizzazione configurato


owners.
<nowiki>#</nowiki> =============================================================================


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
<nowiki>#</nowiki> **CONFIGURAZIONE DEI FILE E RISORSE**


mysql> Exit
<nowiki>#</nowiki> =============================================================================


Bye
$wgEnableUploads = false;     # Caricamenti disabilitati


parallels@ubuntu-linux-22-04-02-desktop:~$ cd /var/www/html/mediawiki
<nowiki>#</nowiki>$wgUseImageMagick = true;    # Abilitare ImageMagick (commentato)


parallels@ubuntu-linux-22-04-02-desktop:/var/www/html/mediawiki$ ls -l
<nowiki>#</nowiki>$wgImageMagickConvertCommand = "/usr/bin/convert"; # Percorso di ImageMagick


total 2184
<nowiki>#</nowiki> InstantCommons


-rwxr-xr-x  1 www-data www-data    1511 Dec  5 16:41 api.php
$wgUseInstantCommons = false; # Disabilita utilizzo immagini da Commons


-rwxr-xr-x  1 www-data www-data  352410 Dec  5 16:42 autoload.php
<nowiki>#</nowiki> =============================================================================


drwxr-xr-x  2 www-data www-data    4096 Jan  5 15:58 cache
<nowiki>#</nowiki> **LINGUA E FUSO ORARIO**


-rwxr-xr-x  1 www-data www-data     168 Dec  5 16:41 CODE_OF_CONDUCT.md
<nowiki>#</nowiki> =============================================================================


-rwxr-xr-x  1 www-data www-data    8358 Dec  5 16:42 composer.json
$wgLanguageCode = "it";       # Lingua del sito


-rwxr-xr-x  1 www-data www-data     125 Dec  5 16:41 composer.local.json-sample
$wgLocaltimezone = "Europe/Berlin"; # Fuso orario


-rwxr-xr-x  1 www-data www-data   19421 Dec  5 16:41 COPYING
<nowiki>#</nowiki> =============================================================================


-rwxr-xr-x  1 www-data www-data   15957 Dec  5 16:42 CREDITS
<nowiki>#</nowiki> **SICUREZZA E CHIAVI DI CONFIGURAZIONE**


-rwxr-xr-x  1 www-data www-data    1762 Dec 20 19:45 docker-compose.yml
<nowiki>#</nowiki> =============================================================================


drwxr-xr-x  5 www-data www-data    4096 Jan  5 15:58 docs
$wgSecretKey = "2157bf3f06ccf1cd0be352687f133e3fe15a7ba6a5f951bcce3ed74d18964259"; # Chiave segreta


drwxr-xr-x 35 www-data www-data    4096 Jan  5 15:58 extensions
$wgAuthenticationTokenVersion = "1";  # Versione del token di autenticazione


-rwxr-xr-x  1 www-data www-data      95 Dec  5 16:41 FAQ
<nowiki>#</nowiki> =============================================================================


-rwxr-xr-x  1 www-data www-data 1639880 Dec  5 16:42 HISTORY
<nowiki>#</nowiki> **LICENZE E DIRITTI**


drwxr-xr-x  2 www-data www-data    4096 Jan  5 15:58 images
<nowiki>#</nowiki> =============================================================================


-rwxr-xr-x  1 www-data www-data    2221 Dec  5 16:41 img_auth.php
$wgRightsPage = "";           # Pagina Wiki con informazioni sulla licenza


drwxr-xr-x 96 www-data www-data    4096 Jan  5 15:58 includes
$wgRightsUrl = "";            # URL della licenza


-rwxr-xr-x  1 www-data www-data    2213 Dec  5 16:41 index.php
$wgRightsText = "";           # Testo sulla licenza


-rwxr-xr-x  1 www-data www-data    3685 Dec  5 16:42 INSTALL
$wgRightsIcon = "";           # Icona della licenza


-rwxr-xr-x  1 www-data www-data    1302 Dec  5 16:41 jsdoc.json
<nowiki>#</nowiki> =============================================================================


drwxr-xr-x  5 www-data www-data    4096 Jan  5 15:58 languages
<nowiki>#</nowiki> **SKINS (TEMI GRAFICI)**


-rwxr-xr-x  1 www-data www-data    1464 Dec  5 16:41 load.php
<nowiki>#</nowiki> =============================================================================


drwxr-xr-x 11 www-data www-data   12288 Jan  5 15:58 maintenance
$wgDefaultSkin = "vector-2022"; # Skin predefinita


drwxr-xr-x  4 www-data www-data    4096 Jan  5 15:58 mw-config
<nowiki>#</nowiki> Skin abilitati


-rwxr-xr-x  1 www-data www-data    1761 Dec  5 16:41 opensearch_desc.php
wfLoadSkin( 'MinervaNeue' );


-rwxr-xr-x  1 www-data www-data    1643 Dec  5 16:41 README.md
wfLoadSkin( 'MonoBook' );


-rwxr-xr-x  1 www-data www-data   54673 Dec 20 19:45 RELEASE-NOTES-1.43
wfLoadSkin( 'Timeless' );


drwxr-xr-x  5 www-data www-data    4096 Jan  5 15:58 resources
wfLoadSkin( 'Vector' );


-rwxr-xr-x  1 www-data www-data    1239 Dec  5 16:41 rest.php
<nowiki>#</nowiki> =============================================================================


-rwxr-xr-x  1 www-data www-data     199 Dec  5 16:41 SECURITY
<nowiki>#</nowiki> **ALTRE CONFIGURAZIONI**


drwxr-xr-x  6 www-data www-data    4096 Jan  5 15:58 skins
<nowiki>#</nowiki> =============================================================================


drwxr-xr-x 11 www-data www-data    4096 Jan  5 15:58 tests
<nowiki>#</nowiki> Aggiungere configurazioni personalizzate qui sotto.


-rwxr-xr-x  1 www-data www-data    1659 Dec  5 16:41 thumb_handler.php
<nowiki>#</nowiki> End of automatically generated settings.


-rwxr-xr-x  1 www-data www-data    1357 Dec  5 16:41 thumb.php
<nowiki>#</nowiki> Add more configuration options below.


-rwxr-xr-x  1 www-data www-data    4394 Dec  5 16:41 UPGRADE


drwxr-xr-x 21 www-data www-data    4096 Jan  5 15:58 vendor


parallels@ubuntu-linux-22-04-02-desktop:/var/www/html/mediawiki$
{{:Score:Ubuntu_Roadmap}}
{{:Score:Ubuntu_Localsetting config}}
Editor, Editors, USER, admin, Bureaucrats, Check users, dev, editor, founder, Interface administrators, member, oversight, Suppressors, Administrators, translator
11,492

edits