Mac OS X - Permissions

I posted previously with a question about FastCGI. I couldn’t solve that
problem, so decided to recompile Apache with mod_perl static. I’m running Mac OS
X 10.2.3, perl 5.8.0, apache 1.3.27, mod_perl 1.27, rt 2.1.59 (apparently also
referred to as 3.0 alpha 2).

I get this error:

[error] Can’t locate RT/Handle.pm in @INC (@INC contains: /opt/rt3/lib
/opt/rt3/local/lib /sw/lib/perl5/darwin /sw/lib/perl5
/System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin
/Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl . /usr/
/usr/lib/perl) at /opt/rt3/lib/RT.pm line 119.

I have done make fixperms-nosetgid, to no avail. I’ve got a sneaking suspicion
that this has to do with OS X perl’s inability to setuid. I’ve seen the chmod
u+s /usr/bin/suidperl tip, but that doesn’t appear to be where suidperl lives in
10.2 (The tip mentioned FreeBSD, not OS X)

Now, I could just chmod /opt/rt3 recursively just to get the thing working, but
that would be bad form. I don’t care about security at this point, I’m just
trying to do a proof of concept install.

Thanks for any help anyone is able to provide.

Thanks to Jesse and others, I got the permissions squared away. In the interests
of maintaining a record in the archive, here are the steps I took to install RT
on Mac OS X. They’re just a general list of some of the problems that I
experienced, not a full guide by any means.

  1. Update perl to 5.8.0; there are good instructions at
    http://developer.apple.com/internet/macosx/perl.html

2… perl on OS X can’t handle setgid perl scripts.
make fixperms-nosetgid will leave your config file open to perusing by local
users. (It has your database password in it) but will let you run RT.

  1. Because DSOs don’t consistently load in Apache on OS X, I compiled mod_perl
    in statically.
    First download and compile mod_perl, as it patches the Apache source. The last
    command is crucial.

perl Makefile.PL
APACHE_SRC=/usr/local/src/apache_1.3.27/src
NO_HTTPD=1
USE_APACI=1
PREP_HTTPD=1
EVERYTHING=1

  1. I ran into the infamous libwww head vs. HEAD glitch. Because HFS+ is case
    preserving, but not case sensitive, install libwww as part of make fixdeps
    overwrote /usr/bin/head with /usr/bin/HEAD. This messes with the apache make
    process. Copy the original head binary from a Jaguar install disc. More
    information on this is available here:
    http://www.macosxhints.com/article.php?story=20010603142727786

  2. Install apache with mod_perl compiled statically. For some reason I also had
    to enable the extended API; this wasn’t mentioned in any of the other notes I’ve
    read on apache and OS X. This the command I ran:

sudo ./configure
–with-layout=Darwin
–enable-module=most
–enable-module=so
–activate-module=src/modules/perl/libperl.a
–enable-module=perl
–disable-shared=perl
–without-execstrip
–disable-rule=EXPAT
–enable-rule=EAPI \

  1. my httpd.conf settings are pretty standard

  2. The following steps also circumvented various permissions, but leave the
    system less secure.

chmod -R 755 /opt/rt3/lib/
chmod -R 777 /opt/rt3/var/

  1. Now I was finally able to start apache, with the command
    sudo apachectl start

There were some references I found extremely helpful, besides the answers I got
on this list.

http://david.wheeler.net/osx.html - using OS X as an industrial strength server
http://www.macdevcenter.com/pub/a/mac/2002/11/05/apache_osx.html - using apache,
mod_perl and OS X
http://www.entropy.ch/software/macosx/mysql/ - MySQL binaries built for OS X
http://archive.develooper.com/macosx@perl.org/msg02447.html - recompiling perl
modules after updating perl, and the “dyld undefined symbols” error
http://lists.fsck.com/pipermail/rt-devel/2002-November/002722.html - another
list of steps necessary to install RT on OS X

I hope this helps someone else get this great package up and running. Thanks to
Jesse and the RT-devel community.

Josh Levinger
Dartware, LLC