Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2000 20:45:12 +0100
From:      Peter McGarvey <Peter.McGarvey@telinco.net>
To:        Stephen Beitzel <sbeitzel@foobie.net>
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: php4 and mod_perl
Message-ID:  <395A55C8.DCE10C63@telinco.net>
References:  <200006281905.MAA18044@foobie.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Stephen Beitzel wrote:
> 
> I'm setting up a webserver with FreeBSD 4.0-STABLE. I wonder if anyone can
> offer advice on how to go about installing apache with both php4 and mod_perl.
> In /usr/ports/www there is a plain old apache port as well as ports for
> apache and one other module, but I don't see any options for including both
> of these. Is there some incompatibility between them that I should know
> about?
> 
> Thank you,
> 
> Steve
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

I've got Apache, mod_perl, PHP3 and PHP4 all running quite happily.  I
gave up on the ports and did it by hand.  In the end I found it just as
simple, but I did have some false starts :)

Once you know how it's done it's fairly simple.  The APXS mechanism
allows you to add PHP and mod_perl as shared objects.  So you can
compile them an add them to a precompiled apache installation.  THis is
great as you don't have to recompile apache.  Taking it step by step
also allow you to work out where you've gone wrong.

So...

Get all the sources, and exract them to a commmon directory.  Personaly
I put soft links to the source directories.  I did have some scripts to
automate the extraction, compilation and installation.  But I can't find
them, so I'll tell you how to do it from some script fragments I've just
found lying around...

First READ THE DOCUMENTATION!  Doing it by the seat of your pants is a
good way to loose a couple of days.  Believe me I know.  Assuming you
have read the docs, here is how you do it.  Well, here is how I do it. 
You'll probably want to change a thing or two.

now, configure and build Apache....   

cd some_dir/apache
./configure  \
	--prefix=/usr/local \
	--bindir=/usr/local/bin \
	--sbindir=/usr/local/sbin \
	--libexecdir=/usr/local/libexec \
	--mandir=/usr/local/man \
	--sysconfdir=/usr/local/etc/apache \
	--includedir=/usr/local/include/apache \
	--datadir=/usr/local/share/apache \
	--htdocsdir=/usr/local/share/apache/htdocs \
	--iconsdir=/usr/local/share/apache/icons \
	--cgidir=/usr/local/share/apache/cgi-bin \
	--suexec=/usr/local/share/apache/suexec
	--localstatedir=/var \
	--runtimedir=/var/run \
	--logfiledir=/var/log \
	--proxycachedir=/var/spool/apache \
	--enable-module=all \
	--enable-shared=all \
	--server-uid=httpd \
	--server-gid=httpd

make
make install

That's it.  It's installed.  So fire it up and play with it.  When you
are finished, stop apache.

Now, to install PHP3...

cd some_dir/php
./configure \
	--prefix=/usr/local \
	--with-system-regex \
	--with-apache=/usr1/builds/apache \
	--with-config-file-path=/usr/local/etc/apache \
	--disable-debug \
	--disable-short-tags \
	--enable-track-vars \
	--enable-safe-mode \
	--without-gd \
	--with-mysql \
	--with-apxs
make
make install

And PHP4

cd ./php4
./configure \
	--enable-versioning \
	--prefix=/usr/local \
	--with-system-regex \
	--with-config-file-path=/usr/local/etc/apache \
	--disable-debug \
	--disable-short-tags \
	--enable-track-vars \
	--enable-safe-mode \
	--without-gd \
	--with-mysql \
	--with-apxs


Now add perl


cd some_dir/mod_perl
perl Makefile.PL \
	USE_APXS=1 \
	WITH_APXS=/path/to/bin/apxs \
	EVERYTHING=1
make
make install

Configure it all.

Start Apache....

Done.


-- 
TTFN, FNORD

Peter McGarvey, Unix Administrator
Network Operations Center, Telinco Limited


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?395A55C8.DCE10C63>