Successfully reported this slideshow.
Your SlideShare is downloading. ×

PostgreSQL: Prima configurazione

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
PostgreSQL : Tuning
PostgreSQL : Tuning
Loading in …3
×

Check these out next

1 of 11 Ad

More Related Content

Slideshows for you (20)

Advertisement

Similar to PostgreSQL: Prima configurazione (20)

Recently uploaded (20)

Advertisement

PostgreSQL: Prima configurazione

  1. 1. Prima configurazione Prima configurazione 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 1
  2. 2. Prima configurazione Di cosa parleremo: Messa in rete della prima installazione di postgresql Prima configurazione del files postgresql.conf Prima configurazione del file pg_hba.conf 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 2
  3. 3. Prima configurazione Postgresql in prima installazione lavora per default  solo in local host Per utilizzare postgresql in rete bisogna abilitarlo  attraverso i suoi file di configurazione. postgresql.conf pg_hba.conf 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 3
  4. 4. Prima configurazione 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 4
  5. 5. Postgresql.conf E' il file che gestisce la maggior parte delle  configurazioni / ottimizzazioni per postgresql. Lo vedremo più in dettaglio in seguito Per ora ci limiteremo a configurarlo per gestire  la connessione in lan 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 5
  6. 6. Postgresql.conf #­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ # CONNECTIONS AND AUTHENTICATION #­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ # ­ Connection Settings ­ # listen_addresses = 'localhost' # what IP  address(es) to listen on; # comma­separated list of addresses; # defaults to 'localhost', '*' = all # (change requires restart) port = 5432      # (change requires restart) max_connections = 100 # (change requires restart) 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 6
  7. 7. Postgresql.conf #­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ # CONNECTIONS AND AUTHENTICATION #­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ # ­ Connection Settings ­  listen_addresses = '*' # what IP address(es) to listen on; # comma­separated list of addresses; # defaults to 'localhost', '*' = all # (change requires restart) port = 5432      # (change requires restart) max_connections = 100 # (change requires restart) 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 7
  8. 8. Postgresql.conf listen_addresses = '*'    →   assicuriamoci che il  valore di listen_addresses sia impostato su * in  questo modo verranno accettate tutte le  connessioni dagli hosts remoti; Ora attraverso il file pg_hba.conf andiamo a  definire quali reti e quali tipi di autenticazione  vengono abilitati 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 8
  9. 9. pg_hba.conf Configurazione di default: # TYPE  DATABASE    USER        CIDR­ADDRESS        METHOD # IPv4 local connections: host     all          all          127.0.0.1/32           trust L'unico collegamento possibile è dal localhost con  la password passata in chiaro 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 9
  10. 10. pg_hba.conf Esempio di collegamento dalle reti 192.168.1.x e  192.168.2.x # IPv4 local connections: host all all 127.0.0.1/32 trust host all all 192.168.1.0/24 trust host all all 192.168.2.0/24 trust Ora è possibile collegarsi al server postgresql dal  localhost e dalle reti 192.168.1.x e 192.168.2.x con  la password passata in chiaro 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 10
  11. 11. Punto della situazione Cosa sappiamo fare ora? Prima Configurazione configurazione di Postgresql Semplice connessione alla rete locale 27/11/08 /home/scotty/enrico/corso­web/finale/Installazione/prima­configurazione.odp page 11

×