LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Apache Migration/Compatibility > Problem with CustomLog (at DirectAdmin server)

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2007, 11:54 PM
slimak slimak is offline
Senior Member
 
Join Date: Aug 2006
Posts: 67
Default Problem with CustomLog (at DirectAdmin server)

Hello,
yesterday I do some tests and installed LiteSpeed at DirectAdmin box. I found only problem with logs. In every virtual host are lines:
Code:
CustomLog /var/log/httpd/domains/$domain.com.bytes bytes
CustomLog /var/log/httpd/domains/$domain.com.log combined
ErrorLog /var/log/httpd/domains/$domain.com.error.log
In main httpd.conf are lines:
Code:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%b" bytes
The problems is with byteslog (they doesn't be create, so the bandwidth usage isn't counted). Also the $domain.com.error.log doesn't be create, but these logs are in main lsws error.log file, so I don't thing this is a bug. The combined logs seems to be ok.
Reply With Quote
  #2  
Old 03-04-2007, 04:49 AM
slimak slimak is offline
Senior Member
 
Join Date: Aug 2006
Posts: 67
Default Answer

Today I found two another problems:

1. In every virtual host are lines like:

Code:
<VirtualHost $ip:80>
...
        <Directory /home/$user/domains/$domain/public_html>
                ...
                php_admin_value open_basedir /home/$user/:/tmp/:/usr/local/lib/php/
        </Directory>
</VirtualHost>
The problem is that their works for all virtual host, especially for aliases (from /var/www/html). Every thing is ok when I change the first line to:
Code:
        <Directory ~ /home/$user/domains/$domain/public_html>
2. The second problem is with webmails installed by DirectAdmin and phpsuexec. They created files in /var/www/html (e.g. /var/www/html/uebimiau/tmp). When I enter webmail by hostname (http://server_hostname/webmail/) then it's ok, but when I enter it by user domain then I have no permissions to write tmp folder. Changing permissions to tmp folder doesn't help, because webmails override them - for the first user will be ok, but for the second no. I see to solutions:
a) force apache:apache for php scripts in /var/www/html
b) I could move the "User $user" and "Group $group" lines to directory directive in virtual hosts, but currently the lines User&Group doesn't work in such situation.
Reply With Quote
  #3  
Old 03-05-2007, 08:36 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
We will treat directadmin's byte log as a special case. Custom access log is not supported in standard edition, and this feature is not available via Apache's httpd.conf.

Can you please clarify what exactly is the problem #1?

I guess it is that "php_admin_value" should not be applied to alias?
The reason LSWS does that is because LSWS combind implementation of <directory><location> and alias directives all together as a "Context", so those configurations were inherited with alias. We will change our implementation to match Apache's.

For problem #2, does DirectAdmin + Apache run the webmails under user "apache:apache" without suexec for all user accounts? Is there any special directives in httpd.conf for this?
I have a sample directadmin httpd.conf file, seems directadmin only uses "SuexecUserGroup" at <VirtualHost ...> level.
"/webmail" is a server wide alias. I think suexec should be used for the entire virtual host, including aliases, for the sake of security.

Last edited by mistwang; 03-05-2007 at 02:25 PM..
Reply With Quote
  #4  
Old 03-05-2007, 07:03 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
updated 3.0 package should have the log file and problem #1 addressed. We have no good idea about the second problem yet.
Reply With Quote
  #5  
Old 03-06-2007, 01:09 PM
slimak slimak is offline
Senior Member
 
Join Date: Aug 2006
Posts: 67
Default Answer

#0. The bytes log problem still occur.

#1. Now it's ok.

#2. Yes, it does. DirectAdmin + Apache doesn't have phpsuexec by default. There is possibility to install suphp. Scripts in suphp (configured for DA) run by the owner of file (not owner of the document_root). When the owner is root (e. g. script in /var/www/html), then the scripts are run under "apache:apache"

"I think suexec should be used for the entire virtual host, including aliases, for the sake of security." - I suppose so, by in that case some scripts (webmails) installed by DirectAdmin in /var/www/html won't work, so there should be possibility to disable/force phpsuexec for some directories.

Last edited by slimak; 03-06-2007 at 01:13 PM..
Reply With Quote
  #6  
Old 03-06-2007, 02:22 PM
slimak slimak is offline
Senior Member
 
Join Date: Aug 2006
Posts: 67
Default Answer

#2. I did some changes in configuration of webmails and now their works. I did two changes:

1. in file /var/www/html/webmail/inc/config.php I changes $temporary_directory... to:
Code:
$uidinfo = posix_getpwuid(posix_getuid());
$temporary_directory = (($uidinfo['name']=='apache')?'tmp/':"/home/".$uidinfo['name']."/webmail/uebimiau/");
2. in file /var/www/html/squirrelmail/config I inserted after line "$data_dir = SM_PATH . 'data/';" these lines:
Code:
$uidinfo = posix_getpwuid(posix_getuid());
if($uidinfo['name']!='apache') {
    @mkdir("/home/".$uidinfo['name']."/webmail");
    @mkdir("/home/".$uidinfo['name']."/webmail/squirrelmail");
    $data_dir = "/home/".$uidinfo['name']."/webmail/squirrelmail/";
}
Now the webmails temporary files are stored in /home/$user/webmail/ directory.

Last edited by slimak; 03-06-2007 at 02:41 PM..
Reply With Quote
  #7  
Old 03-06-2007, 03:12 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
For bytes log file, I tried a sample DA httpd.conf, the bytes log file get created on my server. Are you sure it is not a permission problem?
Reply With Quote
  #8  
Old 03-10-2007, 01:48 AM
slimak slimak is offline
Senior Member
 
Join Date: Aug 2006
Posts: 67
Default Answer

Yes, that isn't a permission problem. I deleted all files from /var/log/httpd. The files are created, but all $domain.bytes files are always empty.

Today I found another problem. In every VH is line:
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN|'
It sets the sendmail_path to '/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN|' and in that case the mail() function in PHP doesn't work. It should be set to:
/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN| (with out the ' ').
Reply With Quote
  #9  
Old 03-10-2007, 07:36 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Thanks for the update.
Who own $domain.bytes files? Should be apache:apache.
The quoted string problem will be fixed in official 3.0 release.
Reply With Quote
  #10  
Old 03-11-2007, 01:35 AM
slimak slimak is offline
Senior Member
 
Join Date: Aug 2006
Posts: 67
Default Answer

Yes, the files are owned by apache:apache.
Reply With Quote
Reply

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


All times are GMT -7. The time now is 10:06 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.