Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 30th, 2001, 07:19 AM
northernlake northernlake is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 1 northernlake User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Apache & SUexec

I'm running an Apache box (on FreeBSD 4.4-stable) with a growing number of Virtualhosts. Many of the websites use cgi- or PHP scripts which write information to specific files, which are subsequently 'owned' by Apache's UID and GID, and therefore no longer useable for the actual owner of the website.

I know that SUexec resolves these things, letting scripts run under the UID of the actual user.

Is there anyone here who's got experience with setting it up. I install Apache from the FreeBSD ports, and know that some changes have to made to the actual Makefile in order for it to build with SUexec. What things should I keep in mind, etc. I've already looked at the Apache docs, but would like to hear some experiences 'from the field' :-)

Regards,
Wilco.

Reply With Quote
  #2  
Old December 30th, 2001, 03:16 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> Is there anyone here who's got experience with setting it up

Do a search using the search keyword suexec under my username in All open forums. suexec's topic has been discussed and answered hundred times.

>> What things should I keep in mind

The most significant concern is to restructure your Apache directory layout by moving all vhost's docroot under the --suexec-docroot.

Here is my very own hier standard:

/www - suexec-docroot (a unique partition for better performance)
/www/htdocs - server's default docroot
/www/cgi-bin - server's cgi-bin
/www/icons - default icons
/www/vhosts/vhost1.com - vhost1 user's homedir
/www/vhosts/vhost1.com/htdocs - vhost1's docroot
/www/vhosts/vhost1.com/cgi-bin - vhost1's cgi-bin

Read this thread for more details -> http://forums.devshed.com/showthrea...8485&forumid=15

>> I install Apache from the FreeBSD ports, and know that some changes have to made to the actual Makefile

You can send configure options to make as if you are compiling from src yourself. Or you can alter /usr/ports/www/apache13/Makefile directly (cvsup will overwrite this file so do appropriate backup):

For example:

1) create www user+group (uid/gid 100)
2) Alter the Makefile:
--prefix=${PREFIX} \
--with-perl=${PERL} \
--with-layout${FILESDIR}/FreeBSD.layout:FreeBSD \
--enable-module=most \
--enable-shared=max \
--enable-module=auth_db \
--enable-module=mmap_static \
--disable-module=auth_dbm \
--without-confadjust \
--server-uid=www \
--server-gid=www \
--suexec-docroot=/www \
--enable-suexec \
--suexec-caller=www \
--suexec-logfile=/var/log/apache/suexec_log \
--suexec-userdir=public_html \
--suexec-uidmin=100 \
--suexec-gidmin=100 \
--suexec-safepath=/usr/local/bin:/usr/bin:/bin
3) Alter /usr/ports/www/apache13/files/FreeBSD.layout:
<Layout FreeBSD>
prefix: /usr/local
exec_prefix: $prefix
bindir: $exec_prefix/bin
sbindir: $exec_prefix/sbin
libexecdir: $exec_prefix/libexec/apache
mandir: $prefix/man
sysconfdir: $prefix/etc/apache
datadir: /www
iconsdir: $datadir/icons
htdocsdir: $datadir/htdocs
cgidir: $datadir/cgi-bin
includedir: $prefix/include/apache
localstatedir: /var
runtimedir: $localstatedir/run
logfiledir: $localstatedir/log/apache
proxycachedir: $localstatedir/tmp/proxy
</Layout>

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Apache & SUexec


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway