Prepare PostgreSQL and PHP
Ubuntu uses aptitude for package management. Before attempting any software installations, aptitude should be updated and upgraded (this process can take quite some time).
iwuser$ sudo apt-get update iwuser$ sudo apt-get upgrade
Install and Configure PostgreSQL
iwuser$ sudo apt-get install postgresql
I want to change the access control to trust for the unix socket connections.
Listing: /etc/postgresql/8.3/main/pg_hba.conf# Database administrative login by UNIX sockets local all postgres trust # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: (was "md5") host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 md5
Those changes make it more convenient for using PostgreSQL's command line tool, allowing a user to assume the identity of any PostgreSQL user. The security here is fine because the only way to access PostgreSQL at the command line is to be ssh'd into www.istarelworkshop.com. Any change to PostgreSQL's security requires a restart of the database server.
iwuser$ sudo /etc/init.d/postgresql-8.3 restart iwuser$ psql template1 postgres Welcome to psql 8.3.11, the PostgreSQL interactive terminal. Type: copyright for distribution terms h for help with SQL commands ? for help with psql commands g or terminate with semicolon to execute query q to quit template1=# q
Install and Configure PHP 5
iwuser$ aptitude search php5- iwuser$ sudo apt-get install php5-pgsql php5-xdebug
The aptitude search command is useful for seeing what packages are available (the search term is wildcarded). Because this is a production server, I want to modify the PHP configuration file to provide a little more memory to running scripts, and to hide errors from any visitor.
Partial Listing: /etc/php5/apache2/php.inimemory_limit = 64M ; Maximum amount of memory a script may consume (16MB) display_errors = Off
As always, any changes to the PHP configuration require a restart of the Apache server (which is pre-installed).
iwuser$ sudo /etc/init.d/apache2 restart







