Perl install tips on FreeBSD 4.8?

I’m building a FreeBSD (4.8) box that will be a RT server.

I did a minimal install and just cvsup’d all the ports.
By default it comes with perl 5.005_03
There is a 5.8 port (which RT 3.x needs).

Should I just:
cd /usr/ports/lang/perl5.8 ; make clean ; make install
or do I need to deinstall, upgrade, etc… the existing port?

I’m building a FreeBSD (4.8) box that will be a RT server.

I did a minimal install and just cvsup’d all the ports.
By default it comes with perl 5.005_03
There is a 5.8 port (which RT 3.x needs).

Should I just:
cd /usr/ports/lang/perl5.8 ; make clean ; make install
or do I need to deinstall, upgrade, etc… the existing port?

Install perl5.8 like the way above, then type ‘use.perl port’.

cheers
Aurel

Mike Patterson wrote:

I’m building a FreeBSD (4.8) box that will be a RT server.

I did a minimal install and just cvsup’d all the ports.
By default it comes with perl 5.005_03
There is a 5.8 port (which RT 3.x needs).

Should I just:
cd /usr/ports/lang/perl5.8 ; make clean ; make install
or do I need to deinstall, upgrade, etc… the existing port?

Firstly, I would start using sysutils/portupgrade to install and upgrade
software in the FreeBSD Ports tree. There have been a couple articles on
ONLamp about it. Here’s one.

http://www.onlamp.com/lpt/a/4111

It makes your life much easier, but it is just a recommendation and not a
requirement.

To answer your question, you don’t run “make deinstall” to remove the base
install of Perl in FreeBSD 4.x because it wasn’t installed via Ports in the
beginning.

You simply need to run “make clean install” in the lang/perl5.8 directory
and then use the “use.perl” script (which is installed with the Port) to
adjust which version of Perl the system recognizes.

Also, RT3 is available via FreeBSD Ports at www/rt3; however, I have not
tried it. I installed RT3 prior to the Port being made available, so I
haven’t had the chance to mess with it.

http://www.freshports.org/www/rt3/

Good luck.

Matt Barton
Webexcellence
PH: 317.423.3548 x22
TF: 800.808.6332 x22
FX: 317.423.8735
matt@webexc.com
www.webexc.com

“MP” == Mike Patterson mikep@uclink.berkeley.edu writes:

MP> I’m building a FreeBSD (4.8) box that will be a RT server.
MP> I did a minimal install and just cvsup’d all the ports.
MP> By default it comes with perl 5.005_03
MP> There is a 5.8 port (which RT 3.x needs).

MP> Should I just:
MP> cd /usr/ports/lang/perl5.8 ; make clean ; make install
MP> or do I need to deinstall, upgrade, etc… the existing port?

the perl that it comes with, 5.005_03, is not a port, it is part of
the base system. what you want to do is install the perl5.8 port as
you indicate above, then run the “use.perl port” command to make sure
your ports system and the default /usr/bin/perl is the new one, and
won’t be stomped on a system upgrade. There’s absolutely no need for
the old perl.

Then just install RT as per the install instructions.

Hi Mike,On Sat, 2003-09-13 at 01:23, Mike Patterson wrote:

I’m building a FreeBSD (4.8) box that will be a RT server.

Should I just:
cd /usr/ports/lang/perl5.8 ; make clean ; make install
or do I need to deinstall, upgrade, etc… the existing port?

If you haven’t installed either of the perl5 ports then there is nothing
you need to delete. Perl 5.005_03 ships by default with FreeBSD 4.x.
The port versions (5.6.1 and 5.8) are designed to be installed alongside
the system perl and you can switch between them using the

“use.perl <port|system>”

command. I would recommend you go straight to perl 5.8 with RT.

If you have already installed Apache and mod_perl, then you will need to
do them again and reinstall all perl modules required by RT using Perl
5.8.

Otherwise it’s reasonably straight forward. You may find some perl
modules install easier using the port version rather than via CPAN but
most will install fine via CPAN.

We have RT 3.0.5 with RTFM running here on MySQL 4.0.14, Apache 1.3.27
etc under FreeBSD 4.8-RELEASE with no problems.

Carl.

Thank you Carl and others for the practical advice on FreeBSD perl
install tips. I really appreciate it. I particularly needed to know
about the “use.perl” command.

I’ll probably make things a bit more difficult for myself by installing
Apache 2.x with Fastcgi instead of 1.x with mod_perl, so that I can do
some LDAP auth later down the line.

Thanks,
Mike

Carl Makin wrote:

“MP” == Mike Patterson mikep@uclink.berkeley.edu writes:

MP> I’ll probably make things a bit more difficult for myself by installing
MP> Apache 2.x with Fastcgi instead of 1.x with mod_perl, so that I can do
MP> some LDAP auth later down the line.

One of my production systems is FreeBSD 4.8, perl 5.8 from ports,
postgres 7.3.4 from ports, apache2 from ports, rt3.0.5 + speedy_cgi.

works fine on light load. haven’t had heavy load on this project
(yet).

Hi Mike,On Tue, 2003-09-16 at 00:51, Mike Patterson wrote:

I’ll probably make things a bit more difficult for myself by installing
Apache 2.x with Fastcgi instead of 1.x with mod_perl, so that I can do
some LDAP auth later down the line.

I’m doing LDAP Auth using the module someone posted to the list a while
ago rather than mod_auth_ldap or similar. It works well. It has
nothing to do with Apache 1.3 or 2.0. :slight_smile:

Carl.

This is how I installed RT. It may not be the easiest to install/best
configuration, but it works for me.
I found the RedHat 7.2 step-by-step instructions for the RT2 series a
lifesaver when I was first starting.
http://fsck.com/rtfm/article.html?id=2#180

I would have liked to include step-by-step LDAP Active Directory
external authentication for RT.
However I haven’t figured it out yet and have only seen reference to it
being able to work, not quite enough concrete docs or at least conf file
snippets.

  1. First I installed FreeBSD 4.8 from CD choosing the “Minimal install”
    option with “linux compatibility”.
    (Why install stuff that you don’t need/might be vulnerable)

Here’s some tips on FreeBSD ports basics:

  1. Get a couple basic ports installed, then update all of the ports
    before doing any other installation.
    I installed lynx, portupgrade, and /usr/ports/net/cvsup-without-gui
    % cd /usr/ports/www/lynx ; make ; make install
    % cd /usr/ports/net/cvsup-without-gui ; make ; make install

  2. created /root/ports-supfile from template
    % cp /usr/share/examples/cvsup/ports-supfile /root/ports-supfile
    I changed 2 things on this file. You could of course choose a different
    cvsup host.

%diff /usr/share/examples/cvsup/ports-supfile /root/ports-supfile
51c51
< *default host=CHANGE_THIS.FreeBSD.org

*default host=cvsup10.FreeBSD.org
58c58
< *default compress
#*default compress

  1. Run this to update ports (take a coffee break after starting)
    % cvsup -g -L 2 /root/ports-supfile

  2. Run this update ports index (Lunchtime!)
    % portsdb -Uu

The command below updates all installed ports and dependencies. This

could be dangerous later down the line.
% portupgrade -arR

–FREEBSD Port Tricks–
: to tell if any of the installed ports need upgrading run this:
% portversion -l “<”
Trick to list dependencies:
% cd /usr/ports/www/rt3
% make pretty-print-build-depends-list

Searching for a ports
by keyword:
% cd /usr/ports
% make search key=dvd | more
by name:
% make search name=netscape | more

update port listing (takes awhile to run)
% make index

display info on installed packages
% pkg_info -ac
more detail info
pkg_info -a

show postinstall messages (in case there is postconfig):
% pkg_info -xD lynx
show file locations:
% pkg_info -xL lynx | more

To check if port is a dependency from another port:
% pkg_info -R lynx-2.8.4.1d
–END FREEBSD Port Tricks0–

  1. Now update Perl to 5.8 (thanks RT community for telling me how to do
    this)
    cd /usr/ports/lang/perl5.8 ; make clean ; make install
    #command below tells perl to use the 5.8 perl instead of the 5.00x
    system installed perl
    % use.perl port
    #below tells me what I’m using
    % perl -v

if you dedide to go back to using the original perl run this

“use.perl system”

  1. Get MCPAN up and going. First get the CPAN dependencies
    INSTALLED for MCPAN build
    % pwd
    cd /usr/ports/archivers/unzip ; make ; make install
    cd /usr/ports/ftp/wget ; make ; make install
    cd /usr/ports/ftp/ncftp3 ; make ; make install

#Now install CPAN

ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY has lists of good CPAN sites

% perl -MCPAN -e shell
% install Bundle::CPAN

  1. install mysql
    install mysql server
    % cd /usr/ports/databases/mysql40-server ; make WITH_OPENSSL=yes; make
    install
    % /usr/local/bin/mysqld_safe &
    % /usr/local/bin/mysqladmin -u root password ‘mypasswenthere’
    % /usr/local/bin/mysql -p to check password

  2. install Apache with SSL (you may not want SSL)
    #now install apache
    % /usr/ports/www/apache13-modssl ; make ; make install

note this is startup script /usr/local/etc/rc.d/apache.sh-dist

  1. install mod_perl, tell it to use modssl build
    cd /usr/ports/www/mod_perl
    #changed to this on mod_perl Makefile
    APACHE_PORT?= ${PORTSDIR}/www/apache13-modssl
    cd /usr/ports/www/mod_perl ; make clean install && make clean
    cd /usr/ports/www/apache13-modssl ; make reinstall
    ##got error so…
    cd /usr/ports/www/apache13-modssl ; make deinstall ; make reinstall

  2. Rather than going with the RT port (which at the time was 3.04, I
    downloaded the newest RT at the time 3.0.5 (into /usr/local/src), it
    could be argued that it would be easier to just use the RT port.
    Shortly after my install I noticed the RT port was updated to 3.0.5)
    test RT dependencies:
    % perl /usr/local/src/rt-3-0-5/sbin/rt-test-dependencies --with-mysql

#install RT prereqs
#install prereqs for HTML mason
% perl -MCPAN -e shell
cpan> install Params::Validate
cpan> install Exception::Class
cpan> install Class::Container
cpan> install Scalar::Util
cpan> install Cache::Cache
cpan> install MLDBM
cpan> install FreezeThaw
cpan> install Apache::Session
cpan> install HTML::Mason

#MAILGATE dependencies
cpan> install HTML::TreeBuilder
cpan> install HTML::FormatText
cpan> install LWP::UserAgent

#CORE dependencies
cpan> install Test::Inline
cpan> install Class::ReturnValue
cpan> install DBIx::SearchBuilder
cpan> install Text::Template
cpan> install Log::Dispatch
cpan> install Locale::Maketext
cpan> install Locale::Maketext::Lexicon
cpan> install Locale::Maketext::Fuzzy
cpan> install MIME::Entity
cpan> install Text::Wrapper
cpan> install Time::ParseDate
cpan> install Text::Autoformat
cpan> install Text::Quoted

DEV dependencies:
###Note I couldn’t get this right from CPAN so I ended up installing
from port instead.
###You can probably skip straight to port install.
cpan> install WWW::Mechanize
make test had returned bad status, won’t install without force
possible unmet dependecies for test…
cpan> install Test::Pod
cpan> install Test::Warn
still failed installed using cpan, so did from port below

% cd /usr/ports/www/p5-WWW-Mechanize ; make clean ; make install

#all dependencies met :slight_smile:

  1. Create user rt3 in the rt3 group (look at this if you need user
    creation tips):
    Radar – O’Reilly

  2. now install rt3 (I like it in /usr/local/ better than the default
    /opt but suit yourself)
    % ./configure --with-mysql --prefix=/usr/local/rt3 --with-web-user=www
    –with-web-group=www --with-db-rt-user=rt3 --with-rt-group=rt3
    –with-db-rt-pass=mypasswordwent here
    % make install

13)Edit your SiteConfig
% vi /usr/local/rt3/etc/RT_SiteConfig.pm
—mine looks like this:-----------------------------------------------
— change myserver, myrtname, myemail substitute to match your setup–
—I prefer using an Alias of /rt3 rather than a virtualhost-----------
—I like using https instead of http----------------------------------
1;
$Timezone=‘US/Pacific’;
$CorrespondAdddress=‘rt@myserver.mycompany.com’;
$WebBaseURL=‘https://myserver.mycompany.com’;
$WebPath=‘/rt3’;
Set($rtname , “myrtname”);
Set($Organization , “myserver.mycompany.com”);
Set($OwnerEmail , ‘myemail@mycompany.com’);
Set($CorrespondAddress , ‘rt@myserver.mycompany.com’);
Set($CommentAddress , ‘rt@myserver.mycompany.com’);

14)Add tables to mysql
% make initialize-database

  1. Add httpd.conf directives
    % vi /usr/local/etc/apache/httpd.conf
    #Note: I’m not sure whether or not I needed theNoAuth alias
    ##################RT#############################
    Alias /rt3/rt3/NoAuth/images/ /usr/local/rt3/share/html/NoAuth/images
    Alias /rt3 /usr/local/rt3/share/html/
    PerlRequire /usr/local/rt3/bin/webmux.pl
    <Location /rt3>
    SetHandler perl-script
    PerlHandler RT::Mason
    PerlModule Apache::DBI

    <Directory “/usr/local/rt3/share/html”>
    Options FollowSymLinks
    AllowOverride All

    ###############END RT#############################

  2. Apache not Quite working yet, what I did to fix DBI error message.
    #Both of these attempts to start apached failed (note it did work before
    adding httpd.conf directives in step 13)
    % /usr/local/sbin/apachectl startssl
    % /usr/local/sbin/apachectl start
    Syntax error on line 1333 of /usr/local/etc/apache/httpd.conf:
    Can’t locate Apache/DBI.pm in @INC (@INC contains:
    /usr/local/lib/perl5/site_perl/5.8.0/i386-freebsd
    /usr/local/lib/perl5/site_perl/5.8.0/mach
    /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl
    /usr/local/lib/perl5/5.8.0/BSDPAN /usr/local/lib/perl5/5.8.0/mach
    /usr/local/lib/perl5/5.8.0 . /usr/local/ /usr/local/lib/perl) at (eval

  3. line 3.

/usr/local/sbin/apachectl start: httpd could not be started

#try to fix DBI
% cd /usr/ports/databases/p5-DBI ; make clean ; make install
#nope, try again
% cd /usr/ports/databases/p5-DBI ; make deinstall ; make reinstall
#no dice trying this
%perl -MCPAN -e shell
cpan> install Apache::DBI

% /usr/local/sbin/apachectl startssl
#Web Interface is up :slight_smile:

Note: For me sendmail, mysql, and apache were already running, but

sometimes I forget this when testing or just after a reboot. This is a
good thing to doublecheck.

#Logged into web interface using defaults
#User= “root”
#Password = “password”
#Changed root Password to something else
#gave “everyone” create and reply permission in general queue (so
sending an email will create ticket).

Add lines below to /etc/aliases - run newaliases to make changes in
alias file take effect.
#so mail to rt@myserver.mycomany.com goes into general queue,
rt-comment@mysever adds comment to existing ticket
rt: “|/usr/local/rt3/bin/rt-mailgate --queue general --action correspond
–url http://myserver.mycompany.com/rt3/
rt-comment: “|/usr/local/rt3/bin/rt-mailgate --queue general --action
comment --url http://myserver.mycompany.com/rt3/
% newaliases

  1. So now that RT is running I want to Add On to it:

#downloaded and unzipped RTFM 2.0.0 from http://fsck.com/pub/rt/release/
to /usr/local/src
changed RT prefix in Makefile since I installed in /usr/local/ instead
of /opt
#RT_PREFIX = /opt/rt3
RT_PREFIX = /usr/local/rt3
% cd /usr/local/src/rtfm-2-0-0 ; make install

restart Apache to test interface, it works :slight_smile:

%/usr/local/sbin/apachectl stop && /usr/local/sbin/apachectl startssl

  1. I just noticed a new RT release that has bug fixes for RTFM, decide
    to upgrade.
    #download and unzip src
    cd /usr/local/src/rt-3-0-6
    % ./configure --with-mysql --prefix=/usr/local/rt3 --with-web-user=www
    –with-web-group=www --with-db-rt-user=rt3 --with-rt-group=rt3
    –with-db-rt-pass=mypasswordwenthere
    $ make upgrade
    % ls etc/upgrade

“2.1.71” was listed

% /usr/local/rt3/sbin/rt-setup-database --action insert --datafile
etc/upgrade/2.1.71
% /usr/local/sbin/apachectl stop && /usr/local/sbin/apachectl startssl

  1. I decided to install Statistics Package
    #statistics package
    #meet prereqs (libgd and GD::Graph)
    % make search name=gd #this is how I searched for correct ports
    % cd /usr/ports/graphics/gd ; make ; make install
    % cd /usr/ports/graphics/p5-GD-Graph3d ; make ; make install

download stats package http://www.fsck.com/pub/rt/contrib/3.0/

I gunzipped and untared and then moved folders to correct location

(for me).
% mv Statistics /usr/local/rt3/local/html
% mv Elements /usr/local/rt3/local/html
#stats are generally working, but not the graph (I believe this worked
in 3.0.5, the author is working on a fix).

  1. I noticed that I had 2 copies of every scrip, removed 2nd copy
    (This has happend to me before, I’m not sure if it’s me or RT)
    From WebRT choose Configruation:Global:Scrips

On Correspond Open Tickets with template Blank
On Create Autoreply To Requestors with template Autoreply
On Create Notify AdminCcs with template Transaction
On Correspond Notify AdminCcs with template Admin Correspondence
On Correspond Notify Requestors and Ccs with template Correspondence
On Correspond Notify Other Recipients with template Correspondence
On Comment Notify AdminCcs as Comment with template Admin Comment
On Comment Notify Other Recipients as Comment with template
Correspondence
On Resolve Notify Requestors with template Resolved

  1. I decided to sign my own SSL certificate, instead of using the
    default “snakeoil” one or purchasing one.
    I followed instructions here to make a self-signed certificate
    SSL Certificates Support | Thawte

% openssl genrsa -out myserver.mycompany.com.key 1024
% openssl req -new -key myserver.mycompany.com.key -out
myserver.mycompany.com.csr
% openssl x509 -req -days 10000 -in myserver.mycompany.com.csr -signkey
myserver.mycompany.com.key -out myserver.mycompany.com.crt

#Gave path to newly generated certificates in httpd.conf
#SSLCertificateFile /usr/local/etc/apache/ssl.crt/server.crt
SSLCertificateFile /usr/local/etc/apache/ssl.crt/myserver.mycompany.com.crt
#SSLCertificateKeyFile /usr/local/etc/apache/ssl.key/server.key
SSLCertificateKeyFile
/usr/local/etc/apache/ssl.key/myserver.mycompany.com.key

#restarted apache
/usr/local/sbin/apachectl stop && /usr/local/sbin/apachectl startssl

  1. I wanted PHP too, although you don’t need this for RT
    INSTALL PHP
    % cd /usr/ports/www/mod_php4 ; make ; make install
    (added in addition to defaults: mcrypt, mhash, openldap2, openssl,
    postgresql by checking the box when prompted)

#I added these lines to httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

#restarted apache
/usr/local/sbin/apachectl stop && /usr/local/sbin/apachectl startssl

I hope that was useful I appreciate all the help I’ve gotten from the RT
community.

This is very nice, Mike. I hope somebody will post also for RH9 since
availble docs for RH is almost obsolete already.

—rommie

Mike Patterson wrote:

This is how I installed RT. It may not be the easiest to install/best
configuration, but it works for me.

[snip]

Very impressive, but what’s wrong with

cd /usr/ports/www/rt3 && make install

?
Phil Homewood, Systems Janitor, http://www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances