Solved

Setting up postgresql to talk to Trac

Posted on 2013-11-05
2
523 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Update in Sql 7 37
Error when loading the database 16 64
Update from TABLE-A to TABLE-B 5 49
add and run outdated exchange database to an Exchange server 1 39
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
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…

832 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