Monday, April 12, 2010

The pg_hba.conf file

http://www.postgresql.org/docs/8.2/static/auth-pg-hba-conf.html

Posted by shenxb in 07:31:27 | Permalink | Comments Off

PostgreSQL

PostgreSQL is an object-relational database system that has
the features of traditional commercial database systems with
enhancements to be found in next-generation DBMS systems.

Installation

To install PostgreSQL, run the following command in the
command prompt:

sudo apt-get install postgresql

Once the installation is complete, you should configure the
PostgreSQL server based on your needs, although the default
configuration is viable.

Configuration

By default, connection via TCP/IP is disabled.
PostgreSQL supports multiple client authentication methods.
By default, IDENT authentication method is used for postgres and local users.
Please refer
the PostgreSQL Administrator’s Guide
.

The following discussion assumes that you wish to enable
TCP/IP connections and use the MD5 method for client
authentication. PostgreSQL configuration files are stored in the
/etc/postgresql/<version>/main
directory. For example, if you install PostgreSQL 8.3, the
configuration files are stored in the
/etc/postgresql/8.3/main directory.

[Tip]
To configure ident
authentication, add entries to the /etc/postgresql/8.3/main/pg_ident.conf
file.

To enable TCP/IP connections, edit the file /etc/postgresql/8.3/main/postgresql.conf

Locate the line #listen_addresses = ‘localhost’ and change it to:

listen_addresses = 'localhost'
[Note]
To allow other computers to connect to your PostgreSQL server replace ‘localhost’ with
the IP Address of your server.

You may also edit all other parameters, if you know what you are doing!
For details, refer to the configuration file or to the PostgreSQL documentation.

Now that we can connect to our PostgreSQL server, the next step is to
set a password for the postgres user. Run the following command at a terminal
prompt to connect to the default PostgreSQL template database:

sudo -u postgres psql template1

The above command connects to PostgreSQL database template1 as user
postgres. Once you connect to the PostgreSQL server, you will be
at a SQL prompt. You can run the following SQL command at the psql
prompt to configure the password for the user postgres.

ALTER USER postgres with encrypted password 'your_password';

After configuring the password, edit the file
/etc/postgresql/8.3/main/pg_hba.conf to use
MD5 authentication with the postgres user:

local   all         postgres                          md5 sameuser

Finally, you should restart the PostgreSQL service to
initialize the new configuration. From a terminal prompt enter the following to
restart PostgreSQL:

sudo /etc/init.d/postgresql-8.3 restart
[Warning]
The above configuration is not complete by any means. Please
refer
the PostgreSQL Administrator’s Guide
to configure more parameters.

Resources

  • As mentioned above the Administrator’s Guide
    is an excellent resource. The guide is also available in the postgresql-doc-8.3 package.
    Execute the following in a terminal to install the package:

    sudo apt-get install postgresql-doc-8.3

    To view the guide enter file:///usr/share/doc/postgresql-doc-8.3/html/index.html into the address
    bar of your browser.

  • For general SQL information see Using SQL Special Edition by
    Rafe Colburn.

Posted by shenxb in 07:21:15 | Permalink | Comments Off

Postgresql command

connect to remote database:

USE:

psql -h <host> -p <port> -u <database>

psql -h <host> -p <port> -U <username> -W <password> <database>

For example:

psql -h localhost -p 5432 -U webuser  dbs_cosi

Posted by shenxb in 07:19:20 | Permalink | Comments Off

Thursday, March 18, 2010

Start Apache in my Ubuntu

1. sudo /etc/init.d/apache2 start
HOME:  /var/www
2. sudo /etc/apache2/bin/apachectl -k start

HOME:  /etc/apache2/htdocs

Posted by xrshen@unimelb.edu.au in 02:00:42 | Permalink | Comments Off

Wednesday, March 17, 2010

Ubuntu apt-get

sudo apt-get install php5
sudo /etc/init.d/apache2 restart
sudo gedit /var/www/testphp.php

Posted by xrshen@unimelb.edu.au in 00:29:01 | Permalink | Comments Off

Tuesday, March 16, 2010

Ubuntu .bin file installation

test1

Posted by xrshen@unimelb.edu.au in 05:52:24 | Permalink | Comments Off

Ubuntu install

test

Posted by xrshen@unimelb.edu.au in 05:13:17 | Permalink | Comments Off

Thursday, July 2, 2009

Squire (Java version of VALET)

http://code.google.com/p/valet/wiki/ARROW_Contribution?tm=6
Squire is a java version of VALET
Mr Tim McCallum (http://apps.usq.edu.au/usqwebsite/aspnet/staffsearch/default.aspx?staffsearchaction=showdetails&staffsearchusername=mccallum)
Posted by xrshen@unimelb.edu.au in 05:24:27 | Permalink | Comments Off

Friday, June 19, 2009

Fedora

1. launch ‘fedora tomcat’
 C:Fedoratomcatbinstartup.bat

2. launch ‘fedora client’
C:Fedoraclientbinfedora-admin.bat
username: fedoraAdmin
simple password

3. Ingest demo data

C:Fedoraclientbin>fedora-ingest-demos.bat localhost 8080 fedoraAdmin 123xxx http

4. view objects online
http://localhost:8080/fedora/get/demo:5

Posted by xrshen@unimelb.edu.au in 05:09:55 | Permalink | Comments Off

Wednesday, June 17, 2009

Visualization Workshop

Today, attend a visualization workshop. A couple of key note speakers:
1. Dr Jurgen Schulze
StarCave
http://calit2.net/~jschulze/

2. Prof. Chris Johnson
http://www.cs.utah.edu/~crj/
Seg3D
BioMesh3D
ImageVis3D

3. Prof. Gary Egan
http://www.florey.edu.au/about/management-and-staff/scientific-staff/gary-egan/

Posted by xrshen@unimelb.edu.au in 04:19:17 | Permalink | Comments Off