
8th February 2006, 21:24
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,198 Times in 3,213 Posts
|
|
The function searches for the line that begins with "User" in all you apache config files and returns the name of the user. Maybe the user is not set correctly in your apache config.
There is no global statement for the variable $apache_user missing.
|

8th February 2006, 22:07
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,594 Times in 2,445 Posts
|
|
Quote:
|
Originally Posted by st2xo
How will be the variable $apache_user set in the function apache_user()?
|
In this part:
PHP Code:
for($i=0;$i<$anz_includes;$i++){
$includes[$i] = $mod->file->unix_nl($mod->file->no_comments($includes[$i]));
if($line = $mod->system->grep($includes[$i], "User", "w")){
$lines = explode("\n", $line);
$line = $lines[0];
$line = trim($line);
while(strstr($line, " ")){
$line = str_replace(" ", " ", $line);
}
list($f1, $apache_user) = explode(" ", $line);
$apache_user = trim($apache_user);
$i = $anz_includes;
}
}
the function looks in the Apache configuration and all the included configuration files for something like
If it finds that line, it removes User in front so that wwwrun is remaining.
|

8th February 2006, 23:51
|
|
Member
|
|
Join Date: Jan 2006
Location: Wiesloch [DE]
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Quote:
|
Originally Posted by till
The function searches for the line that begins with "User" in all you apache config files and returns the name of the user. Maybe the user is not set correctly in your apache config.
|
Hi till and falko - hehe, that looks smart! :-)
what apache files would be grepped by:
Code:
$includes[$i] = $mod->file->unix_nl($mod->file->no_comments($includes[$i]));
in my complete /etc/apache2/* the only match to "wwwrun" is uid.conf (is 644)
Code:
more /etc/apache2/uid.conf:
User wwwrun
Group www
Are there some other files grepped for "user" and one match gives a blank line? Could that be? Are there other files grepped except uid.conf?
Perhaps the other condition than $apache_user is not set and so root is returned?
Code:
if(isset($apache_user) && $mod->system->is_user($apache_user)){
return $apache_user;
} else {
return "root";
}
$mod depends on
Code:
/root/ispconfig/scripts/lib/classes/ispconfig_system.lib.php
function is_user($user){
global $mod;
$user_datei = $this->server_conf["passwd_datei"];
$users = $mod->file->no_comments($user_datei);
$lines = explode("\n", $users);
if(is_array($lines)){
foreach($lines as $line){
if(trim($line) != ""){
list($f1, $f2, $f3, $f4, $f5, $f6, $f7) = explode(":", $line);
if($f1 == $user) return true;
}
}
}
return false;
}
so, if wwwrun is correctly given by uid.conf and then is_user() is called - what should then be checked in is_user() ?
I guess $user_datei is at last /etc/passwd and the exploding ":" returns " wwwrun" - which is then equal to is_user( $user)
my /etc/passwd and /etc/groups contents wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
www:x:8:wwwrun Seem´s to be ok.
Or am I completely in a wrong way?
__________________
regards,
Stefan.
|

9th February 2006, 00:16
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,594 Times in 2,445 Posts
|
|
The function searches in all files included in your main Apache configuration file.
Does the column dist_httpd_conf in the isp_server table in the ISPConfig database contain your correct Apache configuration file?
Quote:
|
Originally Posted by st2xo
so, if wwwrun is correctly given by uid.conf and then is_user() is called - what should then be checked in is_user() ?
I guess $user_datei is at last /etc/passwd and the exploding ":" returns " wwwrun" - which is then equal to is_user( $user)
my /etc/passwd and /etc/groups contents wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
www:x:8:wwwrun Seem´s to be ok.
Or am I completely in a wrong way?
|
Yes, that function checks /etc/passwd, and if wwwrun is in there, then it's fine.
|

9th February 2006, 13:11
|
|
Member
|
|
Join Date: Jan 2006
Location: Wiesloch [DE]
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
the column contains /etc/apache2/httpd.conf and that is the used file (which was edited by myself, it´s not the default ISPConfig-file!)
The other cols seem to be allright (www,wwwrun, /etc/*-files, etc.), all data is valid.
__________________
regards,
Stefan.
Last edited by st2xo; 9th February 2006 at 13:14.
|

9th February 2006, 21:39
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,594 Times in 2,445 Posts
|
|
Please post the output of
Code:
ls -l /etc/apache2/httpd.conf
and
|

9th February 2006, 23:08
|
|
Member
|
|
Join Date: Jan 2006
Location: Wiesloch [DE]
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Hi Falko,
here´s the data:
Code:
n05:~ # ls -l /etc/apache2/httpd.conf
-rw-r--r-- 1 root root 10044 Feb 9 21:13 /etc/apache2/httpd.conf
Code:
n05:~ # httpd -V
Server version: Apache/2.0.54
Server built: Sep 9 2005 18:32:43
Server's Module Magic Number: 20020903:9
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/srv/www"
-D SUEXEC_BIN="/usr/sbin/suexec2"
-D DEFAULT_PIDLOG="/var/run/httpd2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/accept.lock"
-D DEFAULT_ERRORLOG="/var/log/apache2/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"
thanks!
__________________
regards,
Stefan.
|

10th February 2006, 00:17
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,594 Times in 2,445 Posts
|
|
The output is ok.
Can you find the line in /etc/apache2/httpd.conf or any of the included files?
|

10th February 2006, 08:28
|
|
Member
|
|
Join Date: Jan 2006
Location: Wiesloch [DE]
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Quote:
|
Originally Posted by falko
Can you find the line in /etc/apache2/httpd.conf or any of the included files?
|
yes, in /etc/apache/uid.conf:
Code:
n05:/etc/apache2 # more uid.conf
User wwwrun
Group www
An uid.conf ist included in httpd.conf (I checked it)
__________________
regards,
Stefan.
|

10th February 2006, 10:08
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,594 Times in 2,445 Posts
|
|
Strange...
Maybe you can debug the function by putting echo statements into it or let it write some output to a file that you can check afterwards...
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 19:36.
|
|
Recent comments
18 hours 14 min ago
23 hours 19 min ago
1 day 3 hours ago
1 day 5 hours ago
1 day 19 hours ago
1 day 19 hours ago
2 days 47 min ago
2 days 7 hours ago
2 days 8 hours ago
2 days 9 hours ago