Jump to content

Recommended Posts

Hello guys

 

I'm trying to use Suexec in my computer. I've installed apache with default settings (so Suexec is installed with my emerge Apache , Gentoo) .

 

My settings on /etc/conf.d/apache2

# SUEXEC Enables running CGI scripts (in USERDIR) through suexec.
# USERDIR Enables /~username mapping to /home/username/public_html
#
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC -D PHP5 -D USERDIR "

 

When I'm restarting my apache, I've the correct line on my log who indicate Suexec is running well :

[sat Jan 26 15:33:39 2008] [notice] Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.7i PHP/5.2.5-pl0-gentoo configur$
[sat Jan 26 15:41:44 2008] [notice] caught SIGTERM, shutting down
[sat Jan 26 15:41:46 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[sat Jan 26 15:41:47 2008] [notice] Digest: generating secret for digest authentication ...
[sat Jan 26 15:41:47 2008] [notice] Digest: done

 

I create an user

/usr/sbin/useradd evolv -m -s /bin/bash

 

In /var/www/evolv/public_html folder, I create php file with :

"<?php echo "user: ".exec('whoami');?>"

 

My vhost below :

<VirtualHost *:80>
ServerAdmin webmaster@evolv.com
DocumentRoot /var/www/evolv/public_html
ServerName www.evolv.com
ServerAlias evolv.com
SuexecUserGroup evolv evolv
CustomLog /var/log/apache2/evolv-web-access_log combined
ErrorLog /var/log/apache2/evolv-web-error_log
<Directory />
AllowOverride All
Options FollowSymLinks -Indexes Includes ExecCGI
</Directory>
</VirtualHost>

 

# suexec -V
-D AP_DOC_ROOT="/var/www"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="apache"
-D AP_LOG_EXEC="/var/log/apache2/suexec_log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_SUEXEC_UMASK=077
-D AP_UID_MIN=1000
-D AP_USERDIR_SUFFIX="public_html"

 

SuexecUserGroup is well using because, if I changed anything in this line, I have an error when I'm restarting apache. So, no error on apache restart, but always : "user: apache"! What's wrong ?

 

Sorry for my poor english :o , I'm french!

 

Thanks all

Bye

Link to comment
https://forums.phpfreaks.com/topic/88027-how-to-use-suexec-with-apache2/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.