Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Setting up postgresql to talk to Trac

Posted on 2013-11-05
2
Medium Priority
?
564 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

704 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