PDA

View Full Version : Suspending accounts on cPanel


slimak
02-27-2007, 08:43 AM
I done some tests with suspending accounts at cPanel server. I found 3 bugs/differences:
1. I created a test account with domain lsws.domain.com.
2. I created by FTP:
public_html/sub/ - directory
public_html/sub/.htaccess - empty file
public_html/sub/script.php - empty file
3. I created a subdomain in cPanel (sub.lsws.domain.com).
4. I suspended the account in cPanel.

The bugs were at:
1. http://sub.lsws.domain.com/ - there was no redirect to suspended page until lsws restart or change in public_html/sub/.htaccess
2. http://lsws.domain.com/sub/script.php - there was 403 error (should be redirect to suspended page) (the line "Options -Includes -Indexes -ExecCGI" in public_html/.htaccess works, but "RedirectMatch .* http://server_domain/suspended.page/" doesn't). Even lsws restart doesn't help for that.

I also found a difference with Apache. It occurs when account exceed its bandwidth limit and after that it will be suspend (by admin/reseller in WHM). At Apache the site will be redirected to suspended page. In lsws will be information about bandwidth exceed.

mistwang
02-27-2007, 10:24 PM
Thank you for the bug report.

Those should be fixed in the updated 3.0 package, please give it a try.

slimak
02-28-2007, 01:00 AM
The bugs (1 & 2) are now removed, but the difference still occurs.

mistwang
02-28-2007, 08:46 AM
Does cPanel uses the same error page for accounts suspended and account exceed bandwidth limit?

You can customize lsws/share/autoindex/bwlimit.html , only drawback is that it will be overwritten during a server update.

slimak
03-01-2007, 02:43 AM
No, the suspended page is quite different.

mistwang
03-01-2007, 08:53 AM
Do you have an idea about the location of the suspended page?

slimak
03-03-2007, 05:10 AM
The solution for that problem could be checking for file: /var/cpanel/suspended/$user. If it exist then bwlimit shouldn't work, because there is a redirection to suspended page by the .htaccess file.

mistwang
03-03-2007, 10:13 AM
The solution for that problem could be checking for file: /var/cpanel/suspended/$user. If it exist then bwlimit shouldn't work, because there is a redirection to suspended page by the .htaccess file.
The problem is that, LSWS may not know the value of $user, only the domain name.
Does cPanel suspend the account automatically when bandwidth limit exceeds? does it redirect to another suspended page in .htaccess other than the default account suspended page?

If LSWS does not do anything special for the bandwidth limit, the error page in .htaccess should be displayed. Right now LSWS checks /var/cpanel/bwlimited/%{SERVER_NAME} and redirect to the 509 page.

cPanel's mod_bwlimit uses /usr/local/cpanel/etc/bwlimit.html as the "509 bandwidth exceeded", I wonder if this is ever displayed.

slimak
03-04-2007, 01:26 AM
1. No, it doesn't suspend an account at all. It create file in /var/cpanel/bwlimited/$domain and suspend only http.
2. When http is suspended by bandwidth overusage then is no redirection by .htaccess file.

slimak
03-04-2007, 01:39 AM
I did some test and I see that Apache must parse .htaccess file before checking for file /var/cpanel/bwlimited/$domain. It that case the redirection is before 509 error, so Apache firstly redirect to suspended page by .htaccess (the suspended page is at http://server_hostname/suspended.page/).

mistwang
03-05-2007, 08:41 AM
I did some test and I see that Apache must parse .htaccess file before checking for file /var/cpanel/bwlimited/$domain. It that case the redirection is before 509 error, so Apache firstly redirect to suspended page by .htaccess (the suspended page is at http://server_hostname/suspended.page/) (http://server_hostname/suspended.page/%29).

Thanks, I think we will do exactly the same. :)

mistwang
03-05-2007, 08:05 PM
updated 3.0 package should have this issue addressed.

slimak
03-06-2007, 01:48 PM
Now every thing works perfectly.