Solved

Setting up postgresql to talk to Trac

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
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…

763 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