FYI, MacDevCenter reader Derek Hansen figured out how to compile Apache with suEXEC and sent me the details. He has graciously allowed me to forward his HOWTO to this list, both so that others may benefit and so that it's archived somewhere.

Enjoy!

David

Begin forwarded message:

From: Derek Hansen <[EMAIL PROTECTED]>
Date: Mon Jan 6, 2003 2:09:08 PM US/Pacific
To: David Wheeler <[EMAIL PROTECTED]>
Subject: Re: Getting suEXEC on Apache on OSX

Sure. I hope it helps others. I would definitely put a link to your site so people know that this build of Apache DOES NOT overwrite the default one in OS X. The information you have on editing the StartupItem and turning OFF Web Sharing would are great.

Also, my little HOWTO is faulted -- If the person is authenticated as ROOT there is no need to use the sudo command (you would just need to remove that).

Indeed, you may want to mention that the httpd.conf file is stock and would need to be edited to include any modifications they have made to Apple's Apache config. Things like the User Directory would need to be changed to "Users" instead of "public_html" etc. Although I'm no Apache install guru, I'm guessing things like that could be issued at compile time?

Being a scrub myself, I like detailed HOWTOs that do not leave out some things as assumptions.

~derek

http://www.macdevcenter.com/pub/a/mac/2002/12/18/ apache_modssl.html?page=4

On Monday, January 6, 2003, at 02:26 PM, David Wheeler wrote:

Cool! Can I forward this to the [EMAIL PROTECTED] list so that it's archived somewhere?
On Monday, January 6, 2003, at 12:47  PM, Derek Hansen wrote:

Thanks.

I did get it to work. It was pretty simple, actually. All that was needed was to add the suexec hooks in the install process.

PREPARATION

1. Become root
% su
Password:

1. Move to a temporary directory where you can download and build the Apache code:
@ cd /usr/local/src

DOWNLOAD, CONFIGURE & INSTALL

1. Download the Apache source
@ curl -O http://mirror.telentente.com/pub/apache/dist/httpd/> apache_1.3.27.tar.gz

2. Unpack the tarball
@ tar xzvf apache_1.3.27.tar.gz

3. Configure Apache for Mac OSX and suEXEC

Note: The --suexec-docroot should match httpd.conf. The example below should really be switched to /usr/local/apache/htdocs.

@ ./configure --enable-suexec \
--suexec-docroot=/Library/WebServer/Documents \
--suexec-userdir=Sites \
--suexec-uidmin=500 \
--suexec-gidmin=20 \
--suexec-caller=www \
--suexec-logfile=/var/log/httpd/suexec_log \
--suexec-safepath=/usr/local/bin:/usr/bin:/bin \
--suexec-umask=077 \
--with-layout=Apache\
--enable-module=so \
--without-execstrip

4. Build the source

@ make
@ make install

5. Test the Apache configuration

@ sudo /usr/local/apache/bin/apachectl configtest
Syntax OK

6. Restart Apache

@ sudo /usr/local/apache/bin/apachectl start
/usr/local/apache/bin/apachectl start: httpd started

This example uses your suggestion of creating a different Apache than the default Apple install. Turning off Personal Web Sharing in the System Preferences and editing the StartupItem are also suggested.

~derek

On Monday, January 6, 2003, at 01:16 PM, Jason Hansen wrote:

Let me know if you figure it out, and good luck!
--
David Wheeler                                     AIM: dwTheory
[EMAIL PROTECTED]                                 ICQ: 15726394
http://david.wheeler.net/                      Yahoo!: dew7e
                                               Jabber: [EMAIL PROTECTED]

Reply via email to