Solved

Setting up postgresql to talk to Trac

Posted on 2013-11-05
2
520 Views
Last Modified: 2013-11-05
Hi all,

I'm installing Trac 1.0 on a new CentOS 6.4 server. I'm planning on using postgresql as the database backend.

General Trac Instructions are here:
http://trac.edgewall.org/wiki/TracInstall

Postgresql installation details for Trac are here:
http://trac.edgewall.org/wiki/DatabaseBackend#Postgresql

I've successfully installed postgresql, and I've done the initialization:

   service postgresql initdb
   chkconfig postgresql on
   service postgresql start

Now... I'm plenty experienced with MySQL but not postgresql. I need to create a database and a username/password which trac can use to connect. Trac is a python-based web application, it runs on Apache and will probably run under the "nobody" user.

Trac's instructions say
If you're using user trac without a password to connect through unix sockets to database trac and have only one project (hence no need for different schemas), your connections string would be postgres://trac:@/trac

That sounds pretty good, I want to set that up.

But I don't know how to administer a postgresql server, what the various commands are etc.

Can somebody give me the easy way out and tell me how to do this?
0
Comment
Question by:Frosty555
  • 2
2 Comments
 
LVL 31

Accepted Solution

by:
Frosty555 earned 0 total points
ID: 39625564
Solution ended up being this:

First, as the root user, sudo to the postgres user and run the "psql" command to get to the psql CLI:

su - postgres
psql

Open in new window

Once inside the psql CLI, set up the database and user:

CREATE USER trac PASSWORD 'thepassword';
CREATE DATABASE trac OWNER trac;
GRANT ALL ON DATABASE trac TO trac;
\q

Open in new window

Now edit the /var/lib/pgsql/data/pg_hba.conf file,  and change the authentication type for local connections from "ident" to "trust" by modifying the lines to read as follows:

local   all         all                               trust
host    all         all         127.0.0.1/32          trust

Open in new window


Now you can create the trac environment like this:

trac-admin /usr/share/trac/mytracproject initenv

Open in new window


And finally, when prompted for the database connection string:

postgres://trac:thepassword@/trac

Open in new window

0
 
LVL 31

Author Closing Comment

by:Frosty555
ID: 39625567
see above
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now