Sunday, 6 June 2010

VirtualBox PUEL on OpenSUSE on 64 bit machine

It took me a while to solve this problem, therefore here is the solution for everyone...

I installed the PUEL version of VirtualBox from the virtualbox.org website, the version for personal use and evaluation.
There is the OSE version included in OpenSUSE, but that does not support USB connections.

Now for the PUEL version, you need to build the kernel module for VirtualBox.
You might need to install gcc and make, and also the kernel sources.
I will come to the details of the kernel sources later.

When I ran /etc/init.d/vboxdrv setup, I got the error in /var/log/vbox-install.log:
make -f /usr/src/linux-2.6.31.12-0.2/scripts/Makefile.modpost
scripts/mod/modpost -m -a -i /usr/src/linux-2.6.31.12-0.2-obj/i386/desktop/Module.symvers -I /tmp/vbox.3/Module.symvers -o /tmp/vbox.3/Module.symvers -S -K /usr/src/linux-2.6.31.12-0.2-obj/i386/desktop/Module.markers -M /tmp/vbox.3/Module.markers -w -c -s
FATAL: /tmp/vbox.3/vboxdrv.o has no symtab?
I looked for symtab on the Internet, and found that it has to do with conflicts in the architecture.

It took me a while to have a look at the versions of kernel packages I had installed:
rpm -qa | grep kernel
This showed for my system, that the package for kernel-syms was not for x86_64, but for 586. This caused the error with symtab.

Solution (please check the result of rpm above to know which exact version of the kernel you are using):
zypper install kernel-syms-2.6.31.12-0.2.1.x86_64
As an example, here is what rpm -qa | grep kernel shows after I installed the correct packages:
kernel-xen-devel-2.6.31.12-0.2.1.x86_64
kernel-syms-2.6.31.12-0.2.1.x86_64
kernel-desktop-2.6.31.12-0.2.1.x86_64
kernel-debug-devel-2.6.31.12-0.2.1.x86_64
kernel-desktop-devel-2.6.31.12-0.2.1.x86_64
linux-kernel-headers-2.6.31-3.4.noarch
kernel-default-devel-2.6.31.12-0.2.1.x86_64
kernel-source-2.6.31.12-0.2.1.noarch
Then building the kernel module for VirtualBox worked.

Monday, 10 May 2010

CruiseControl.net and Mono

I have set up CruiseControl.net (http://sourceforge.net/projects/ccnet/) on Mono for building our OpenPetra.org project, which is quite a big project.

Here are the steps I followed, and my config files so that people can benefit from it:

Here is some advice how to change the ccnet.exe.config to make it work for Mono: http://markmail.org/message/uyfqysd55u4xqhfs; main things are to change the xsl paths' backslash to forward slash, and to replace ColoredConsoleAppender with ConsoleAppender, and to remove mappings for the ConsoleAppender.

You can see my modified ccnet.exe.config, and also the ccnet.config for OpenPetra here in the online git repository:

http://openpetraorg.git.sourceforge.net/git/gitweb.cgi?p=openpetraorg/openpetraorg;a=tree;f=csharp/ICT/PetraTools/ContinuousIntegration

You will also find a cruisecontrol.sh which I use as a init.d script for starting and stopping my CruiseControl server.

I had to install Mono XSP from the Lenny backports repository, to get Mono 2.x. It was also important to install sendmail, otherwise the EmailProvider would obviously not work (which took me quite a while to notice).
apt-get -t lenny-backports install mono-xsp
apt-get install sendmail sendmail-bin

Then I had a nasty problem with the logging. After a failed build, I had this exception:

[OpenPetraOrg:ERROR] Publisher threw exception: ThoughtWorks.CruiseControl.Core.CruiseControlException: Unable to read the contents of the file: /home/timop/CruiseControl.NET/Server/OpenPetraOrg/Artifacts/nant-results-b2f2a299-05c5-42a6-a311-24df30a59b9a.xml ---> System.NotImplementedException: The requested feature is not implemented.
at ThoughtWorks.CruiseControl.Core.Tasks.FileTaskResult.ReadFileContents () [0x00000]
--- End of inner exception stack trace ---
at ThoughtWorks.CruiseControl.Core.Tasks.FileTaskResult.ReadFileContents () [0x00000]
at ThoughtWorks.CruiseControl.Core.Tasks.FileTaskResult.get_Data () [0x00000]
at ThoughtWorks.CruiseControl.Core.Publishers.XmlIntegrationResultWriter.WriteTaskResults (IIntegrationResult result) [0x00000]
at ThoughtWorks.CruiseControl.Core.Publishers.XmlIntegrationResultWriter.WriteBuildElement (IIntegrationResult result) [0x00000]
at ThoughtWorks.CruiseControl.Core.Publishers.XmlIntegrationResultWriter.Write (IIntegrationResult result) [0x00000]
at ThoughtWorks.CruiseControl.Core.Publishers.XmlLogPublisher.Execute (IIntegrationResult result) [0x00000]
at ThoughtWorks.CruiseControl.Core.Tasks.TaskBase.Run (IIntegrationResult result) [0x00000]
[OpenPetraOrg:ERROR] Unable to build email message: ThoughtWorks.CruiseControl.Core.CruiseControlException: Unable to read the contents of the file: /home/timop/CruiseControl.NET/Server/OpenPetraOrg/Artifacts/nant-results-b2f2a299-05c5-42a6-a311-24df30a59b9a.xml ---> System.NotImplementedException: The requested feature is not implemented.
After some searching, I realised that the log file had become quite big, and in the CruiseControl.net code in FileTaskResult.cs the function ReadFileContents would call MemoryFailPoint, but this class has not been implemented yet in Mono 2.x (http://anonsvn.mono-project.com/viewvc/tags/mono-2-4-2-2/mcs/class/corlib/System.Runtime/MemoryFailPoint.cs).

My solution was to download the sources of Mono, and modify MemoryFailPoint.cs to not throw that NotImplementedException, but just stay quiet. I then copied the resulting file (eg. mono-2.4.2.3/mcs/class/lib/net_2_0/mscorlib.dll) to my server with the CruiseControl.net, to /usr/lib/mono/2.0/mscorlib.dll

Now CruiseControl.net works quite nicely, though I have not played with NUnit yet, and there are more things to explore...

Monday, 1 March 2010

Charity Resource Planning - CRP and ERP

After some attempts to explain what my work is all about, I have come to the conclusion that the description "Charity Resource Planning" might fit best.

Previous attempts were "Administration Software", but then people think about administration of computers, etc. And I have not read about anyone calling any software "Administration software".

Other people call it "Back Office Software".
Wikipedia describes Back office in these words:
"A back office is a part of most corporations where tasks dedicated to running the company itself take place. The term comes from the building layout of early companies where the front office would contain the sales and other customer-facing staff and the back office would be those manufacturing or developing the products or involved in administration but without being seen by customers. Although the operations of a back office are usually not given a lot of consideration, they are a major contributor to a business."
But does a charity have a front office and a back office? It is usually quite a small team of dedicated people. I remember once a funny bookkeeper in one of our smallest offices, telling me he would ask the system administrator to do something for him... it took me a few seconds to realise he was speaking of himself in the third person...
To some degree, the work of a charity, helping people in need, empower the people without rights, telling the Good News, could be called the "front office".
But even in normal companies and enterprises, no one calls their software "Back Office Software". You want it all integrated. The salesman in the front office needs to know the addresses of the customer, etc.

This is where the term "Enterprise Resource Planning (ERP)" comes to mind.

Again the definition from Wikipedia: Enterprise Resource Planning
"Enterprise resource planning (ERP) is a term usually used in conjunction with ERP software or an ERP system which is intended to manage all the information and functions of a business or company from shared data stores.
It is a commercial software package that promotes seamless integration of all the information flowing through a company.
[...]
[The term ERP] was introduced by research and analysis firm Gartner in 1990. ERP systems now attempt to cover all core functions of an enterprise, regardless of the organization's business or charter. These systems can now be found in non-manufacturing businesses, non-profit organizations and governments."
For a while I thought about using the term ERP for the things I do. But then it sounded strange. Can you run a charity like an enterprise? On the one hand, many concepts can be brought over from the enterprise experience, and a charity can benefit from the lessons learned in business. Some charities even are run as an enterprise, and their goal is to grow and move more and more money. They pay salaries etc.

But I am not talking about those huge well-known charities that you see on TV ads. My background are mission organisations. They and many other charities work mostly on a low profile. They live from dedicated workers who are willing to work for a small salary or even raise their own support, and such organisations could not exist without their dedicated supporters that not only back the work financially but also with prayer.

There are quite a number of Open Source ERP systems around. The question is how hard it would be to modify them by adding modules to turn these software packages into "Charity Resource Planning" tools.
There is a good example of Medical, which is an Electronic Medical Record (EMR) and Hospital Information System, and it is based on OpenERP, an Open Source Enterprise Management solution.

So it would work to adjust an ERP system to work for charities. I wish there were such initiatives to use the benefit of Open Source for charities in this area.
The question will be how close the ERP system will match the processes of a charity. How far can you modify the software, and how much do you have to change your own processes?

Therefore my goal is to make a real "Charity Resource Planning (CRP)" software.
  • CRP software has to be easy to use, since charities often have much higher staff turnover than normal businesses, due to short term commitments etc
  • CRP software should center on managing relations with supporters and workers and the people involved in the projects in a way that is right and honourable.
  • CRP software should provide tools for most of the office tasks, eg. Personnel department, Donor contact management, Financial Planning, Accounting
  • CRP software has to be available in all sorts of languages and support many currencies, so that it can be used across a multi-national organisation, in such a diversity of countries that companies of the size of a usual charity normally would never work in because they don't have the manpower.
  • Such a CRP software has to allow easy integration with other software, eg. Payroll which is probably too difficult to adapt to the laws of each country. It should also provide many plugin interfaces that allow localisation of the tools, eg. for processing bank statements etc.
  • CRP software has be available at justifiable costs, considering the personal effort of supporters and workers to keep the charity going.
There is already a small number of software systems around that fit well into the category of "Charity Resource Planning". And I think there is certainly a need for more developers and IT specialists working in this area, both voluntarily and to earn their living. I think it would benefit many charities if we use Open Source software for this in order to be able to share solutions even if we are using different technology or emphasize different management/organisational styles.

My personal aim is to make OpenPetra.org one of the first choices in Charity Resource Planning systems.



Disclosure
Timotheus Pokorra is currently working as a software developer for OM, a christian charity working in many countries. OM owns the OpenPetra.org project which aims to provide a free software solution for the administration of charities.

Saturday, 20 February 2010

KnowledgeTree and Versioning of documents uploaded by WebDAV

The advantage of KnowledgeTree is that it keeps versions of each document that you upload. Unfortunately, this does not seem to work in version 3.7.0.2, when uploading a new version of an existing file via WebDAV. The file is overwritten with the new version, but there is no version history.

There might be good reasons for that behaviour, which are explained in this issue?

Here is a solution that works for me, but of course, I do not know the interna of Knowledge Tree, therefore please use it at your own risk...

In file ktwebdav/lib/KTWebDAVServer.inc.php, find the lines:
// Modified - 25/10/07 - changed add to overwrite
// $oDocument =& KTDocumentUtil::add($oParentFolder, $name, $oUser, $aOptions);
$oDocument =& KTDocumentUtil::overwrite($oDocument, $name, $sTempFilename, $oUser, $aOptions);
It seems, with the add method a new file would be created, with a unique filename. So uploading a new version of test.txt would result in two files, test.txt would stay, and the new file would be test(1).txt. This is not really what you want.

To get real versioning, comment that line with "overwrite", and add these lines:
$aOptions['newfilename'] = $name;
$oDocument =& KTDocumentUtil::checkin($oDocument, $sTempFilename, 'WebDAV upload', $oUser, $aOptions);
This should do the trick. You will only have one file in your folder, and when you click on "Version History" in your webinterface, you will see the old versions and the current version. The file you download via WebDAV is always the latest version. This makes sense to me...

Sunday, 14 February 2010

A look at charities and Open Source ERP software

I want to look at several articles and initiatives that I have found on the web, and address some of the questions and risks and benefits.

Why can't you just use commercial software to manage your administration?
This really depends on the type of charity.

For example a representative from Christian Aid says in this BBC article (
http://news.bbc.co.uk/1/hi/technology/6124582.stm), which I will refer to again later:
"We are a funding organisation that ships £90m around the world ..."
[...]
"We spend one pence in the pound on administration, and that means we've got to be as effective and efficient as we can, and software is one way to do that."

Reading this, that means that they are still spending £900.000 on administration.

I would like to list different goals that a charity has:
  • deliver a message
  • provide material help
  • provide training or practical help through people

Therefore an organisation that ships a lot of money around the world, it is much easier to spend quite big amounts on software, and this saves them all sorts of trouble with technical support etc.

But if your organisation is more about highly motivated workers working alongside the people you want to help, and your main motivation is the message you deliver, the picture is different. You will probably not "ship vast amounts of money around the world", and the percentage you use for overall administration is more critical. The amounts you can spend on IT is probably quite small. It will be difficult to subscribe to proprietary software licenses which you will be depend on for the next decade or so.

We should also not forget cultural differences. It seems it is much more acceptable in the US to invest into administration than it is in Europe.

The BBC article about Christian Aid also mentions the use of standard office software, e.g. Windows XP and MS Office licenses. They are very happy with the good charity discounts from Microsoft. I will not address this topic here, because I am not discussing Operating Systems or Office Software, but Administrative software.

A charity is no software company, why should we invest into OpenSource and develop our own software?
I want to introduce the idea that has been formed by the Collaborative Software Initiative (CSI) (see
http://www.csinitiative.com/).
I quote from their website:
"The Collaborative Software Initiative (CSI) brings together like-minded companies to build software applications at a fraction of the cost of traditional methods. CSI introduces a market-changing process that applies open source methodologies to building Collaborative Software.
For applications that don't enable competitive advantage or are associated with non-value added activities such as compliance, regulatory, and industry standards, Collaborative Software empowers customer core team members to provide control and direction over a project while leveraging the efficiencies of using the same software and reducing costs."
They are thinking of banks and insurances and the automobile industry. I think we can easily apply the same to mission organisations and charities. We don't want to develop software for the sake of it, and we don't want a competitive advantage over other mission organisations or charities. Therefore it would make much sense to coordinate the efforts, and let others benefit from our work, and even encourage them to contribute.


Open Source is not as good as the best of breed

First of all, the best of breed software will probably cost more. In case it is cheaper or you can afford it anyways, and you have also calculated the cost of training etc, then it might well be that the best of breed is better for you.
Regarding the issue that the users know the best of breed and it is more difficult training them on an Open Source system because it is unknown to them: This might be more an issue for Operating Systems and Office packages. Although the introduction of Office 2007 has shown how easy it is to force users to suddenly use ribbons instead of menus.
The advantage of an Open Source administration suite should be that it is easy because it can be customized to the specific needs. Can your workers cope with the complexity of the best of breed, fits-all system? Most of the time you don't need all functionality of the best of breed software.
In the case that you have to train your workers on the best of breed software, make sure you know how often you have to train new staff, and how expensive that is, depending if it is possible to provide your own in-house training, or you have to pay expensive courses.

With Open Source you don't get what you really need
This is generally true for all software. But with Open Source you have a chance, to change the software much easierly, either by doing it yourself or get someone to do it for you.
If you have a good reason, you can convince a developer to do it, and it can benefit others as well.
Depending on the size of differences of expectation, you need to be able and willing to invest into adaption yourself; but you will own the change and don't need to pay license fees for it in the future.

There are too many updates to install for Open Source software
see also the article "
How open source is losing the charity battle" at ZDNet.

Security nowadays requires updates anyways, even Microsoft have a monthly patch day.
Nowadays updates should become much more easy to install.
The more users there are, the quicker a solution is provided; frequent updates prevent a bug from annoying you for a longer time.

Who will provide support for us? Is there a guarantuee of service and continued development?
You should look for a contract with a software engineer, and the greater the community for an Open Source software, the more people are willing to help. It is not all for free, but that is a good thing for you, because when you pay you have rights. On the other hand, you might find IT people that specifically want to support your organisation as volunteers. Because of the free nature of Open Source, it will be much easier for them to accustom themselves to the software.
There should also be general support of the users amongst each other, therefore leaving only serious extensions to paid or volunteering developers.

More Links
Most of the Links don't relate to Open Source regarding office administration. But they might give the interested reader an overview of opinions and possibilities.
Case Studies:
http://news.bbc.co.uk/1/hi/technology/6124582.stm
Charity shuns open source code

http://www.cafamily.org.uk/opensource.html
A charity using open source

http://news.zdnet.co.uk/software/0,1000000121,39166840,00.htm
London-based charity which saved more than £28,000 by using Linux Terminal Server to build its network.

Articles:
http://www.linux.com/feature/33378
Article: Help introduce open source software to charities

http://www.uwnyc.org/technews/v5_n6_a1.html
How "Open Source" Can Open Doors for Nonprofits

comparison Office vs Open Office for nonprofits

article from the year 1999, from Danny Yee: "Development, Ethical Trading, and Free Software"

Initiatives:
http://www.donortec.org/
DonorTec provides donated software and hardware from companies such as Microsoft and Cisco to eligible Australian non profit groups with Income Tax Exempt Status (ITE).

http://charityware.info/
Charityware (c-ware) is any software that supports charity. Some developers ask that proceeds from the sale of software be donated to charity, while others license or donate their software directly to charity.

http://www.socialsource.org.uk/
Last update in 2005.
This wiki is a central point for an advocacy initiative
("SocialSource") seeking to promote and assist the practical use of Free/Open Source Software (FOSS) within the UK Voluntary and Community Sector (VCS)*.

http://www.volresource.org.uk/swit/miscsw.htm
information for voluntary and community organisations

http://www.it4communities.org.uk/it4c/home/index.jsp
We are the UK's leading national IT volunteering programme.
iT4Comunities can help
charities, community groups and social enterprises access free IT support from IT professional volunteers and make substantial savings

http://www.nosi.net/projects/primer
Nonprofit Open Source Initiative
"Choosing and Using Free and Open Source Software: A Primer for Nonprofits" describes what open source software is and what impact this type of software may have on the nonprofit sector.

http://www.benetech.org/
technology serving humanity

http://www.ngogeeks.com/
To evaluate Open Source Software in an effort to reduce the IT costs of Non-Government and Not for Profit Organisations

http://www.ngopulse.org/article/ngo-ict-management-toolkit
The Southern African NGO Network (SANGONeT)

http://ngoinabox.mahiti.org/
This is the website of the South Asian hub of NGO-in-a-box, a collection of Free and Open Source Software (FOSS) tools selected for use by non-profit organisations.

http://www.codn.net/plugins/content/content.php?content.10
Christian Open Development Network

On the FSF's High Priority Projects list there is a call for the creation of a donor transaction and contact system.

http://www.lightsys.org/
LightSys is dedicated to equipping Christian missions and ministries with the computer technology correct for them, including the knowledge and contacts needed to support that technology. As a result they can serve with greater efficiency, keeping their mind on their task, not their computers, thus redeeming technology -- for God's Kingdom.
latest update on Kardia/Centrallix: http://lan.lightsys.org/blogs/?id=4470&one

Disclosure
Timotheus Pokorra is currently working as a software developer for OM, a christian charity working in many countries. OM owns the OpenPetra.org project which aims to provide a free software solution for the administration of charities.

Thursday, 15 January 2009

Request Tracker scrip that involves the Category of a Custom Field

Our Request Tracker works for users in many countries, which are all assigned to areas. There is an IT administrator for each area, which should be added to the CC list for the request that is from one of the countries in his/her area.

We have created a custom field, and used the category to group the countries by areas.

We needed a scrip with an action that needs to know the category of the currently selected value of a custom field.


Condition: User Defined
Action: User Defined
Template: Global Template: Blank
Stage: TransactionCreate


Custom condition:
my $CFName = 'Field/Country';

my $CF = RT::CustomField->new( $RT::SystemUser );
$CF->LoadByNameAndQueue( Name => $CFName, Queue => $self->TicketObj->Queue );

if ( (($self->TransactionObj->Type eq "CustomField" && $self->TransactionObj->Field == $CF->id)
||
$self->TransactionObj->Type eq "Create" ) &&
($self->TicketObj->FirstCustomFieldValue('Field/Country')) )
{
return 1;
}
return 0;


Custom action preparation code:
my $CFName = 'Field/Country';
# for FirstCustomFieldValue see in Record.pm
my $fieldcountryVal = $self->TicketObj->FirstCustomFieldValue($CFName);
my $aita_email = '';
my $area = '';

#see CustomFieldValue_Overlay.pm, sub Category

my $CFObj = new RT::CustomField($RT::SystemUser);
$CFObj->Load($CFName);
my $valuesObj = $CFObj->ValuesObj();
while (my $myValue = $valuesObj->Next) {
if ($myValue->Name eq $fieldcountryVal)
{
#$RT::Logger->info($fieldcountryVal." belongs to area ".$myValue->Category);
$area = $myValue->Category;
}
}

if ($area eq "Some Area")
{
$aita_email = 'admin@somearea.ourdomain.org';
}
elsif ($area eq "Another Area")
{
$aita_email = 'admin@anotherarea.ourdomain.org';
}
#if ($aita_email ne '')
{
my ($ret, $msg) = $self->TicketObj->AddWatcher( Type => "Cc", Email => $aita_email);

if ($ret) {
#$RT::Logger->info("scrip: New watcher added to ticket");

} else {
#$RT::Logger->error("scrip: Failed to add new watcher to ticket");
}
}

return 1;

Custom action cleanup code:
return 1;

Friday, 21 November 2008

BestPractical RT: Request Tracker on CentOS 5 with PostgreSQL

see also http://www.ptitov.net/2008/07/request-tracker-installation-o.html

Here are the steps how to install Request Tracker on CentOS 5 with PostgreSQL:

Install RPM packages

yum install postgresql postgresql-server postgresql-libs
yum install httpd perl-BSD-Resource perl-FCGI perl-Apache-DBI mod_perl
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uhv rpmforge-release*.rpm
yum install perl-Digest-HMAC perl-Apache-Session perl-Class-Container perl-Class-Data-Inheritable perl-Crypt-DES perl-Devel-StackTrace perl-Exception-Class perl-GD \
perl-GD-Graph perl-GD-Text-Util perl-Hook-LexWrap perl-HTML-Mason perl-HTTP-Server-Simple perl-HTTP-Server-Simple-Mason perl-IO-Socket-INET6 \
perl-Net-SNMP perl-Params-Validate perl-Socket6 perl-UNIVERSAL-require perl-HTML-scrubber perl-Text-WikiFormat perl-XML-RSS perl-Tree-Simple \
perl-Text-Wrapper perl-Module-Versions-Report perl-CSS-Squish \
perl-Term-ReadKey perl-Class-ReturnValue perl-Text-Quoted perl-Calendar-Simple perl-DBIx-SearchBuilder perl-Text-Autoformat \
perl-MailTools perl-Regexp-Common perl-Locale-Maketext-Lexicon perl-Locale-Maketext-Fuzzy perl-Time-HiRes perl-Time-modules perl-TimeDate \
perl-Log-Dispatch perl-Text-Template perl-HTML-Tree perl-HTML-Format \
perl-HTML-Scrubber perl-libwww-perl perl-MIME-tools perl-DBD-mysql



Configuration of Perl modules
To see if all required perl modules have been installed, run this:
/usr/bin/perl -MCPAN -e shell
make testdeps
/usr/bin/perl ./sbin/rt-test-dependencies --verbose --with-pgsql


Also, make sure you have newer versions of IO::File (1.14) and File-Temp (1.21).
Otherwise you get in trouble. More details follow here:

Fixes:
cat testemail.txt | /usr/bin/rt-mailgate --queue MyQueue --action correspond --url http://rt.mydomain.org/
Can't locate object method "seek" via package "File::Temp"


check currently installed version of File::Temp:
perl -le 'use File::Temp; print File::Temp->VERSION'

install the latest version 0.21:
cpan
# for reinitialising cpan:
o conf init
i /MIME-tools/
test D/DO/DONEILL/MIME-tools-5.425.tar.gz
i /file-temp/
install T/TJ/TJENNESS/File-Temp-0.21.tar.gz


Problem with attachements:
cat rttestmailatt.txt | /usr/bin/rt-mailgate --debug --queue myQueue --action correspond --url http://rt.mydomain.org
Connecting to http://rt.mydomain.org/REST/1.0/NoAuth/mail-gateway at /usr/bin/rt-mailgate line 102, <> line 1.
hello http://rt.mydomain.org/REST/1.0/NoAuth/mail-gateway
not ok - Failed to parse this message. Something is likely badly wrong with the message at /usr/bin/rt-mailgate line 112, <> line 1
another problem:
Can't locate object method "binmode" via package "IO::File" at /usr/lib/perl5/vendor_perl/5.8.5/MIME/Body.pm line 437.


We need version 1.14 of IO::File

perl -le 'use IO::File; print IO::File->VERSION'

requires: yum install gcc
cpan
i /IO-1.2301/
install G/GB/GBARR/IO-1.2301.tar.gz


IMPORTANT: need to reload the apache server, otherwise the new perl packages have no effect:
/etc/init.d/httpd reload

I came once across a Cpan problem:
Going to read /root/.cpan/sources/modules/03modlist.data.gz
Unrecognized character \x88 at (eval 29) line 1.

The solution was: delete 03modlist.data.gz, and just run cpan again

Install RT
Download the latest tar.gz file from http://bestpractical.com/rt/download.html
In a tmp directory, not the destination directory:
cd /home/timop
tar xvzf rt-3.6.6.tar.gz
cd rt-3.6.6
./configure --prefix=/usr --enable-layout=RH \
--with-db-host=localhost \
--with-db-dba=rt --with-db-rt-user=rt \
--with-db-database=rt --with-pgsql

Check to see if all dependancies are installed:
make testdeps | grep MISSING
make install

You then need to configure /etc/rt/RT_SiteConfig.pm
e.g. if you want to use Postgresql, it could look like this:
# {{{ Database Configuration

# Database driver beeing used. Case matters
# Valid types are "mysql", "Oracle" and "Pg"

Set($DatabaseType , 'Pg');

# The domain name of your database server
# If you're running mysql and it's on localhost,
# leave it blank for enhanced performance
Set($DatabaseHost , 'localhost');
Set($DatabaseRTHost , 'localhost');

# The port that your database server is running on. Ignored unless it's
# a positive integer. It's usually safe to leave this blank
Set($DatabasePort , '');

#The name of the database user (inside the database)
Set($DatabaseUser , 'rt');

# Password the DatabaseUser should use to access the database
Set($DatabasePassword , 'secret');

# The name of the RT's database on your database server
Set($DatabaseName , 'rt');

# If you're using Postgres and have compiled in SSL support,
# set DatabaseRequireSSL to 1 to turn on SSL communication
Set($DatabaseRequireSSL , undef);

# }}}


Configuration of PostgreSQL
vi /var/lib/pgsql/data/postgresql.conf;
For PostgreSQL 7.x: add line: tcpip_socket=true;
For PostgreSQL 8.x: listen_addresses = 'localhost'

vi /var/lib/pgsql/data/pg_hba.conf; it should contain:
local all all ident sameuser
host template1 rt 127.0.0.1/32 md5
host rt rt 127.0.0.1/32 md5
host all postgres 127.0.0.1/32 trust

/etc/init.d/postgresql start
postgresql logfile if db does not start: /var/lib/pgsql/pgstartup.log
chkconfig postgresql on
make initialize-database: problem: user rt does not exist; need to use dba postgres
/usr/bin/perl //usr/sbin/rt-setup-database --action init --dba postgres --prompt-for-dba-password

For a nightly backup of your database, you can use this command:
su - postgres -c "umask 0077; pg_dumpall | gzip > /var/lib/pgsql/data/backup.sql.gz"
To restore a database, e.g. when moving from one server to another:
su - postgres
psql template1
drop database rt;
create database rt;
\q
psql rt < /var/tmp/rt-20071210.sql

HTTPD configuration
/etc/httpd/conf.d/rt.conf should contain:
<VirtualHost *:80>
ServerName rt.mysupport.com
DocumentRoot /var/rt/html
AddDefaultCharset UTF-8

ServerAdmin Timotheus.Pokorra@mysupport.com
PerlModule Apache::DBI
PerlRequire /usr/bin/webmux.pl

<Location />
Options None
SetHandler perl-script
PerlHandler RT::Mason
<IfDefine PerlDProf>
<IfDefine PerlSmallProf>
PerlFixupHandler Apache::SmallProf
</IfDefine>
</IfDefine>
</Location>

<Location /NoAuth/images>
SetHandler default-handler
</Location>
# To use this you have to start apache with -DPerlStatus.
#
# In RHEL, add the following line to /etc/sysconfig/httpd:
#
# OPTIONS=-DPerlStatus
<IfDefine PerlStatus>
<Location /perl-status>
SetHandler perl-script
PerlHandler Apache2::Status
PerlSetVar StatusOptionsAll On
PerlSetVar StatusTerse On
PerlSetVar StatusTerseSize On
PerlSetVar StatusTerseSizeMainSummary On
PerlSetVar StatusLexInfo On
</Location>
</IfDefine>

To solve issues with "Can't change ownership of files written by interp object: Permission denied" when running Apache:
chcon -Rt httpd_sys_content_t /var/rt/mason_data/obj

chown -R apache /var/rt/mason_data/obj
chgrp -R apache /var/rt/mason_data/obj
chcon -Rt httpd_sys_content_t /var/rt/html
not: chcon -Rt httpd_sys_script_t /var/rt/html
/etc/init.d/httpd restart

To solve issues after upgrading RT, I had to do this sometimes:

rm -fr /var/rt/mason_data/obj
mkdir /var/rt/mason_data/obj
touch /var/rt/mason_data/obj/.__obj_create_marker
chmod -R a+w /var/rt/mason_data/obj
/etc/init.d/httpd restart
Configure Sendmail
The goal is to receive new requests via email.

You need to create a symbolic link, to avoid errors like "DSN: Service unavailable" or "write error: Broken pipe" in /var/log/maillog
ln -s /usr/bin/rt-mailgate /etc/smrsh
I have these lines in my /etc/aliases file:
my-support-comment: "|/etc/smrsh/rt-mailgate --queue MySupport --action comment --url http://rt.mysupport.com/"
my-support: "|/etc/smrsh/rt-mailgate --queue MySupport --action correspond --url http://rt.mysupport.com/"

Make sure that your server knows about rt.mysupport.com, you might need to add it to /etc/hosts.

You can test the delivery of emails:
echo "test" | mail my-support@rt.mysupport.com -s "test rt"
tail -f /var/log/maillog
or even more directly:
cat testemail.txt |/etc/smrsh/rt-mailgate --queue MySupport --action correspond --url http://rt.mysupport.com/
One other error I got was: "Relaying denied. IP name lookup failed" in /var/log/maillog
The problem was that emails were delivered to ticket.mycompany.com, and the rt server was at rt.mysupport.com.
I had to edit the file /etc/mail/local-host-names
and add the line ticket.mycompany.com