Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
Prossima revisione
Revisione precedente
raspberry_so_webserver_trixie [2026/06/20 23:37] – [1.3. Aggiornamento del sistema] walterraspberry_so_webserver_trixie [2026/06/20 23:45] (versione attuale) – [1.4.2. Installare PHP] walter
Linea 95: Linea 95:
 <code> <code>
 a2enmod userdir a2enmod userdir
-service apache2 restart+systemctl restart apache2
  
 </code> </code>
Linea 108: Linea 108:
 </code> </code>
  
-Cambiare il gruppo di appartenenza come root (sostituire con il vostro username, che se non è stato cambiato è “pi” (vedere sul terminale l'oputput del comado precedente) \\ es. www-data/home/pi/public_htlm) e riavviare il web server:+Cambiare il gruppo di appartenenza come root (sostituire con il vostro username, che se non è stato cambiato è “pi” (vedere sul terminale l'oputput del comado precedente)\\ 
 +es. www-data/home/pi/public_htlm) e riavviare il web server:
  
 <code> <code>
Linea 115: Linea 116:
 chgrp -v www-data /home/<username>/public_html chgrp -v www-data /home/<username>/public_html
 chmod -v 755 /home/<username> chmod -v 755 /home/<username>
-service apache2 restart+systemctl restart apache2
  
 </code> </code>
Linea 133: Linea 134:
 <box 100% round #ffff99 #d2d2d2 #d2d2d2 #ffff99 |file=000-default> <box 100% round #ffff99 #d2d2d2 #d2d2d2 #ffff99 |file=000-default>
  
-<VirtualHost *:80> \\ <wrap indent># The ServerName directive sets the request scheme, hostname and port that</wrap> \\ <wrap indent># the server uses to identify itself. This is used when creating</wrap> \\ <wrap indent># redirection URLs. In the context of virtual hosts, the ServerName</wrap> \\ <wrap indent># specifies what hostname must appear in the request's Host: header to</wrap> \\ <wrap indent># match this virtual host. For the default virtual host (this file) this</wrap> \\ <wrap indent># value is not decisive as it is used as a last resort host regardless.</wrap> \\ <wrap indent># However, you must set it for any further virtual host explicitly.</wrap> \\ <wrap indent>ServerName 127.0.0.1</wrap>+<VirtualHost *:80>\\ 
 +<wrap indent># The ServerName directive sets the request scheme, hostname and port that</wrap>\\ 
 +<wrap indent># the server uses to identify itself. This is used when creating</wrap>\\ 
 +<wrap indent># redirection URLs. In the context of virtual hosts, the ServerName</wrap>\\ 
 +<wrap indent># specifies what hostname must appear in the request's Host: header to</wrap>\\ 
 +<wrap indent># match this virtual host. For the default virtual host (this file) this</wrap>\\ 
 +<wrap indent># value is not decisive as it is used as a last resort host regardless.</wrap>\\ 
 +<wrap indent># However, you must set it for any further virtual host explicitly.</wrap>\\ 
 +<wrap indent>ServerName 127.0.0.1</wrap>
  
-<wrap indent>ServerAdmin webmaster@localhost</wrap> \\ <wrap indent>DocumentRoot /var/www</wrap>+<wrap indent>ServerAdmin webmaster@localhost</wrap>\\ 
 +<wrap indent>DocumentRoot /var/www</wrap>
  
-<wrap indent># Available loglevels: trace8, …, trace1, debug, info, notic$</wrap> \\ <wrap indent># error, crit, alert, emerg.</wrap> \\ <wrap indent># It is also possible to configure the loglevel for particular</wrap> \\ <wrap indent># modules, e.g.</wrap> \\ <wrap indent>#LogLevel info ssl:warn</wrap>+<wrap indent># Available loglevels: trace8, …, trace1, debug, info, notic$</wrap>\\ 
 +<wrap indent># error, crit, alert, emerg.</wrap>\\ 
 +<wrap indent># It is also possible to configure the loglevel for particular</wrap>\\ 
 +<wrap indent># modules, e.g.</wrap>\\ 
 +<wrap indent>#LogLevel info ssl:warn</wrap>
  
-<wrap indent>ErrorLog ${APACHE_LOG_DIR}/error.log</wrap> \\ <wrap indent>CustomLog ${APACHE_LOG_DIR}/access.log combined</wrap>+<wrap indent>ErrorLog ${APACHE_LOG_DIR}/error.log</wrap>\\ 
 +<wrap indent>CustomLog ${APACHE_LOG_DIR}/access.log combined</wrap>
  
-<wrap indent># For most configuration files from conf-available/, which are</wrap> \\ <wrap indent># enabled or disabled at a global level, it is possible to</wrap> \\ <wrap indent># include a line for only one particular virtual host. For exa$</wrap> \\ <wrap indent># following line enables the CGI configuration for this host o$</wrap> \\ <wrap indent># after it has been globally disabled with "a2disconf".</wrap> \\ <wrap indent>#Include conf-available/serve-cgi-bin.conf</wrap> \\ </VirtualHost>+<wrap indent># For most configuration files from conf-available/, which are</wrap>\\ 
 +<wrap indent># enabled or disabled at a global level, it is possible to</wrap>\\ 
 +<wrap indent># include a line for only one particular virtual host. For exa$</wrap>\\ 
 +<wrap indent># following line enables the CGI configuration for this host o$</wrap>\\ 
 +<wrap indent># after it has been globally disabled with "a2disconf".</wrap>\\ 
 +<wrap indent>#Include conf-available/serve-cgi-bin.conf</wrap>\\ 
 +</VirtualHost>
  
 </box|ctrl+O per salvare e ctrl+X per uscire> </box|ctrl+O per salvare e ctrl+X per uscire>
Linea 148: Linea 169:
 <code> <code>
  
-service apache2 restart+systemctl restart apache2
  
 </code> </code>
 +
  
 ==== 1.4.2. Installare PHP ==== ==== 1.4.2. Installare PHP ====
Linea 158: Linea 180:
 <code> <code>
 cd /.. cd /..
-apt-get install php5 libapache2-mod-php5 php5-curl+apt-get install php8.4 libapache2-mod-php8.4 php8.4-curl
  
 </code> </code>
  
-Per controllare che PHP5 sia installato correttamente eseguire i seguenti comandi per aprire un editor e creare una nuova pagina php chiamata test.php:+Per controllare che PHP sia installato correttamente eseguire i seguenti comandi per aprire un editor e creare una nuova pagina php chiamata test.php:
  
 <code> <code>
Linea 175: Linea 197:
 </box | ctrl+O per salvare e ctrl+X per uscire> </box | ctrl+O per salvare e ctrl+X per uscire>
  
-Per verificare se tutto si è installato correttamente puntare il proprio browser a [[http://IPserver/test.php|http://IPserver/test.php]] (Ipserver è l'IP del Raspberry) e questo dovrebbe visualizzare tutte le configurazioni e settaggi di default di PHP5.+Per verificare se tutto si è installato correttamente puntare il proprio browser a [[http://IPserver/test.php|http://IPserver/test.php]] (Ipserver è l'IP del Raspberry) e questo dovrebbe visualizzare tutte le configurazioni e settaggi di default di PHP.
  
 Passiamo ora a configurare di php, per far cio si dovranno modificare alcuni parametri nel file php.ini Passiamo ora a configurare di php, per far cio si dovranno modificare alcuni parametri nel file php.ini
 <code> <code>
  
-nano /etc/php5/apache2/php.ini+nano /etc/php/8.4/apache2/php.ini
  
 </code> </code>
  
-Si apre il file in modifica, scorrere fino ai settori evidenziati e scommentate (cioè togliete il; davanti alla riga) modificando come segue:+Si apre il file in modifica, scorrere fino ai settori evidenziati e scommentate (cioè togliete il ; davanti alla riga) modificando come segue:
  
 <box 100% round #ffff99 #d2d2d2 #d2d2d2 #ffff99| file: php.ini> <box 100% round #ffff99 #d2d2d2 #d2d2d2 #ffff99| file: php.ini>
  
-<nowiki>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</nowiki> \\ Module Settings \\ ​<nowiki>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</nowiki> \\ <nowiki>;</nowiki> \\ date.timezone = "Europe/Rome" \\ <nowiki>;</nowiki> \\ <nowiki>;</nowiki> \\ date.default_latitude= xx.xxxx <wrap indent>#(la vostra latitudine)</wrap> \\ date.default_longitude=yy.yyyy <wrap indent>#(la vostra longitudine)</wrap> \\ <nowiki>;</nowiki>+<nowiki>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</nowiki>\\ 
 +Module Settings\\ 
 +​<nowiki>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</nowiki>\\ 
 +<nowiki>;</nowiki>\\ 
 +date.timezone = "Europe/Rome"\\ 
 +<nowiki>;</nowiki>\\ 
 +<nowiki>;</nowiki>\\ 
 +date.default_latitude= xx.xxxx <wrap indent>#(la vostra latitudine)</wrap>\\ 
 +date.default_longitude=yy.yyyy <wrap indent>#(la vostra longitudine)</wrap>\\ 
 +<nowiki>;</nowiki>
  
 </box | ctrl+O per salvare e ctrl+X per uscire> </box | ctrl+O per salvare e ctrl+X per uscire>