Forum Moderators: phranque

Message Too Old, No Replies

problem installing suexec on apache2

         

localhost

1:53 am on Mar 25, 2004 (gmt 0)

10+ Year Member



i've installed Apache2 with PHP 4 support and now i want to securise my CGI using suexec solution ,so i downloaded the relative docs of suexec installation and i made this :

quote:
-------------------------
# service httpd stop
# ./configure --prefix=/usr/local/httpd --enable-deflate --enable-so --enable-mods-shared=all --enable-suexec --with-suexec-bin=/usr/local/httpd/bin/ --with-suexec-caller=nobody --with-suexec-docroot=/usr/local/httpd/htdocs/ --with-suexec-logfile=/usr/local/httpd/logs/suexec_log
# make
# make install
-------------------------

(caller=nobody) :arrow: it's the user under wich my Apache's working

All is done and no errors given
so i test if suexec is on by typing :

quote:
-------------------------
# ls -alF /usr/local/httpd/bin/suexec
-rwsr-xr-x 1 root root 48903 mar 24 20:21 /usr/local/httpd/bin/suexec*
-------------------------

it's ok.
but in the doc of httpd ,it says that i must have a [notice] in the error log of apache saying that suexec was successfully charged :

quote:
-------------------------
# cat /usr/local/httpd/logs/error_log
[Wed Mar 24 20:21:26 2004] [notice] Digest: generating secret for digest authentication ...
[Wed Mar 24 20:21:26 2004] [notice] Digest: done
[Wed Mar 24 20:21:27 2004] [notice] Apache/2.0.48 (Unix) DAV/2 PHP/4.3.4 configured -- resuming normal operations
-------------------------

there's no notice!

another test ,here's the built in modules of my apache :

quote:
-------------------------
# /usr/local/httpd/bin/apachectl -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c
-------------------------

there's no suexec

anyone got a solution for me?
thanks anyway

Donboy

6:26 pm on Mar 25, 2004 (gmt 0)

10+ Year Member



I gave up on trying to do it using ./configure. My solution uses RPMs. You didn't say what distro you're using, but if you're using one that supports RPMs, it should be easy...

1) Download apache2-x.x.x.src.rpm (notice this is a src RPM)
2) rpm -ivh apache2-x.x.x.src.rpm
3) vi /usr/src/redhat/SPECS/httpd.spec (or wherever this file ends up being located)
4) Add the suexec parameters (reply if you need help finding them in the file... should be easy)
5) Also change the top few variables; at least the first one where it says /var/www to /home or wherever you want your server root to be.
6) rpmbuild -bs /usr/src/redhat/SPECS/httpd.spec
7) cd /usr/src/redhat/SRPMS/ (Should have a new source rpm there)
8) rpmbuild --rebuild /usr/src/redhat/SRPMS/whatever.rpm (where whatever is the RPM found there. If no errors: should be a new RPM in the directory shown in step 9.)
9) cd /usr/src/redhat/RPMS/i386/ ; ls -l
10) rpm -ivh --replacepkgs --replacefiles apche2-x.x.x.i386.rpm

Now you should be set. You may also want to look for an suexec log to see if its working right. You should also add "SuexecUserGroup username groupname" to your virtual host stanza, where username is the owner of all the files under that document root, and groupname is the group name of all the files under that doc root.

This procedure worked for me and I've used it a couple of times with no problems to speak of.

localhost

11:48 pm on Mar 25, 2004 (gmt 0)

10+ Year Member



hi!
thanks for the reply ,am installing apache from it's tarbal source ,it's more flexible for installing modules after a time ,and i succeed installing my suexec ,it was because the suexec bin file wasnt in the right place.
suexec works fine with only [domaine.com...] urls ,but my served is configured to let users consult their homes with userX.domain.com (i use mod_rewrite for that) and suexec do not work with that subdomain :(
how can i redirect every userX.domain.com to its www.domain.com/~userX? do u have any experience doing that?
thanks a lot

Donboy

1:44 am on Mar 26, 2004 (gmt 0)

10+ Year Member



For that, you'll want to use a rewrite rule. Search the site for "rewriterule" and you should get a bunch of good hits. I've actually used this site for help with my rewrite rules in the past. This will suffice until you get all of your users accustomed to the correct URL scheme, at which point you should remove the rewrite rules as they tend to add a burden to the server load.

jdMorgan

6:51 pm on Mar 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



localhost,

If suexec works at the file level, you may be able to keep your subdomains, too.

Just use an internal rewrite instead of an external redirect, and see if it works... No harm trying.

Jim