Tag Archive | "Linux"

Tags: , , , ,

Aaaaaaaaaaaargh SELinux!

Posted on 06 January 2009 by Demian Turner

When it comes to installing Trac it’s not something I usually worry about, I must have installed it from version 0.9 to the latest around 20 times and on at least most of the flavours of linux, OS X and recently Windows.  It used to be tough to setup but the package has been great improved over the years.

And what great software, by the way, I can’t say enough good things about Trac, I’ve been running all my projects on it for around the last 4 years.

But I recently got a new dedicated box, running Fedora Core 9 32 bit, and I’ve already installed Trac twice on this OS, it’s one of the smoothest platform/software combos.  However something went wrong, with the app complaining about requiring root permissions to write to the DB file.  Considering I setup Trac to run with the mod_python module in Apache, this seemed a little strange.  Stranger still was that Google returned absolutely ZERO results for the error message I was getting:

The user root requires read _and_ write permission to the database file 

The log file set to DEBUG also failed to shed any light.  I tried giving root every possible permission to the DB file and its parent folder but the above error persisted.

After banging my head against the wall it struck me that maybe my new web hoster enabled SELinux by default, something I always take special precautions to disable  right off the bat, having struggled with it in the past.

A prompt reply from RapidSwitch revealed that it was in fact enabled, and it was a quick job to disable it.

You can check the status of SELinux in the configuration file as follows:


You can then disable or enable it by editing this file.  The contents of the file looks like this on Fedora:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - No SELinux policy is loaded.
# SELINUXTYPE= can take one of these two values:
#       targeted - Targeted processes are protected,
#       mls - Multi Level Security protection.

Needless to say, problem solved!

I hope there will be at least 1 Google result now 😉

NB: I’ve recently used a pretty handy recipe HOWTO install Trac on Fedora Core 9, it needs some adaptation which I hope to post soon.

Comments (6)

Tags: , ,

Stackoverflow – good code Q&A resource

Posted on 20 October 2008 by Demian Turner

It seems http://stackoverflow.com/ is finally out of private beta, check it out.  It’s the programmer’s Q&A resource that’s had the massive pre-hyping from Joel Spolsky and Jeff Atwood over at IT conversations.

First impression: it seems really great, better than the hyping in fact.  Also quite active – while I was trying to answer a question 4 more response came in, inline.  Some great community karma-enabling ideas.  Only problem is it’s really heavily .NET weighted at the moment, so head on over and give it some of your PHP/linux/open source expertise 🙂

UPDATE: There are some real classics like this: http://stackoverflow.com/questions/164432/what-real-life-bad-habits-has-programming-given-you

Comments (4)


Unix: How to delete all files modified in the last x days

Posted on 26 September 2002 by Demian Turner

To do this at the command line for, say, 30 days, the following will do the trick:

find /path/to/dir -name "*.log" -mtime -30 -exec -rm {} \;
  • where /path/to/dir is just that, the path to the target directory
  • “*.log” will only delete files of a specified extension however you can apply any filter you like
  • the -exec switch is very handy when used in conjunction with ‘find’ – in fact you can feed the output of your search to any other command you like, same idea as pipe ‘|’
  • if this is your first time you may wish to try the less destructive -exec mv -f {} ./tmp \;
  • all statements of this type must terminate with ‘\;’ this closes the statement and escapes the final semi-colon

Comments (2)


Switching Desktops in Linux

Posted on 21 July 2002 by Demian Turner

Why is it the most simple things are impossible to find? There is a very simple way to switch between the two main desktop environments in Linux, KDE and Gnome. Just type:

# switchdesk

at the command prompt. Try find that on Google and you\’ll be out of luck. If you have a similar experience to me, you\’ll need to download the 176 MB Ximian desktop which contains the basic gnome libraries required to run the majority of Linux gui apps. What\’s that you say, you\’ve used up2date so your redhat install has all the bleeding edge libraries? Well it still won\’t have the required gnome libraries. So start downloading, hope you have adsl 😉

Then you think you\’re happy with KDE but you want to give gnome a try. So you switch into gnome via an obviously provided app named \’desktop switcher\’. Well once you\’re in gnome no where within the gnome menu system, options, configurations will you find the option of how to switch back to KDE. A ploy almost worthy of Microsoft?

Comments (0)



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up