Ubuntu 16.04 LAPP Setup: Difference between revisions

From myWiki
No edit summary
No edit summary
 
Line 2: Line 2:


Install Apache
Install Apache
  sudo apt-get install apache2
  sudo apt-get install apache2
  sudo apt install libapache2-mod-php
  sudo apt install libapache2-mod-php


Install Postgresql
Install Postgresql
  sudo apt-get install postgresql postgresql-contrib
  sudo apt-get install postgresql postgresql-contrib


Line 17: Line 15:


In the pg_hba.conf, change the host to 'trust' to get operational
In the pg_hba.conf, change the host to 'trust' to get operational
  # Database administrative login by Unix domain socket
  # Database administrative login by Unix domain socket
  local  all            postgres                                peer
  local  all            postgres                                peer
Line 32: Line 28:
  listen_addresses = '*'
  listen_addresses = '*'


After creating tables and accounts, login using:
$ psql -h localhost -U test -d test


Install PHP 7.0
Install PHP 7.0
  sudo apt-get install php
  sudo apt-get install php
  sudo apt-get install php-pgsql php-cgi
  sudo apt-get install php-pgsql php-cgi
Restart apache2
sudo service apache2 restart

Latest revision as of 13:05, 15 June 2016

Using Ubuntu 16.04 as a host

Install Apache

sudo apt-get install apache2
sudo apt install libapache2-mod-php

Install Postgresql

sudo apt-get install postgresql postgresql-contrib

The contrib is used with PGadmin III. The install creates a system user account: postgres

Change O/S user to postgres and open a Postgres session

sudo -i -u postgres
psql

In the pg_hba.conf, change the host to 'trust' to get operational

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust

In the postgresql.conf, change 'listen_addresses' to get operational

listen_addresses = '*'

After creating tables and accounts, login using:

$ psql -h localhost -U test -d test

Install PHP 7.0

sudo apt-get install php
sudo apt-get install php-pgsql php-cgi

Restart apache2

sudo service apache2 restart