Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 8th February 2006, 21:24
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,768
Thanks: 821
Thanked 5,331 Times in 4,183 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Sponsored Links
  #12  
Old 8th February 2006, 22:07
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

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
Code:
User wwwrun
If it finds that line, it removes User in front so that wwwrun is remaining.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #13  
Old 8th February 2006, 23:51
st2xo st2xo is offline
Member
 
Join Date: Jan 2006
Location: Wiesloch [DE]
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #14  
Old 9th February 2006, 00:16
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #15  
Old 9th February 2006, 13:11
st2xo st2xo is offline
Member
 
Join Date: Jan 2006
Location: Wiesloch [DE]
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #16  
Old 9th February 2006, 21:39
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Please post the output of
Code:
ls -l /etc/apache2/httpd.conf
and
Code:
httpd -V
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #17  
Old 9th February 2006, 23:08
st2xo st2xo is offline
Member
 
Join Date: Jan 2006
Location: Wiesloch [DE]
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #18  
Old 10th February 2006, 00:17
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

The output is ok.

Can you find the line
Code:
User wwwrun
in /etc/apache2/httpd.conf or any of the included files?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #19  
Old 10th February 2006, 08:28
st2xo st2xo is offline
Member
 
Join Date: Jan 2006
Location: Wiesloch [DE]
Posts: 47
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
Can you find the line
Code:
User wwwrun
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.
Reply With Quote
  #20  
Old 10th February 2006, 10:08
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
 
Default

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...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VSFTPD is not working after install the ISPConfig gimhan90 Server Operation 8 3rd February 2006 09:25
Ability to add components for users webstergd Feature Requests 1 20th December 2005 10:25
regarding proftpd and users with shell access Ovidiu Server Operation 2 5th December 2005 13:03


All times are GMT +2. The time now is 11:39.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.