cPanel migration - .htaccess (sus.page)

Discussion in 'Apache Migration/Compatibility' started by slimak, Nov 16, 2006.

  1. slimak

    slimak New Member

    Hello,
    When I suspend an account, cPanel creates a .htaccess file in user public_html:
    RedirectMatch .* http://serv_host_name/suspended.page/
    Options -Includes -Indexes -ExecCGI
    The problem is that the addons domains are still working in lsws. The addon domain root dir is: /home/$user/public_html/$domain, so the lsws isn't looking for .htaccess in /home/$user/public_html, like does it Apache.

    The second problem is, when I unsuspend an account. The redirect is still working until I remove the .htaccess file by hand (cPanel leave an empty .htaccess).
  2. mistwang

    mistwang LiteSpeed Staff

    The problem with addon domains is because the htaccess cache implemented, no easy fix, may be in 3.0 release.

    I cannot reproduce the second problem, it works. LiteSpeed cache .htaccess for a few seconds, maybe you did that too fast, or it is the browser cached the page.
  3. slimak

    slimak New Member

    .htaccess

    1. OK, when could we expect the 3.0 version? That future is very important, because without it, there is impossible to block fully account in cPanel.

    2. There must be an .htaccess file in public_html before suspend - cPanel is restoring the old .htaccess when the account is being unsuspend. I waited for about 10 minutes, but still the redirection was working. When I change the modification time of .htaccess (or delete it), then the page starts working.

    I have some others, less important problems:
    3. Is there something like ScriptRedirectMatch in Apache? cPanel is adding below line to httpd.conf, but it doesn't work:
    ScriptAliasMatch ^/cpanel/(.*) /usr/local/cpanel/cgi-sys/redirect.cgi
    4. I tested the Apache mod_perl Equivalent (from Wiki) and it is working good, but it doesn't have one thing when we import the configuration from httpd.conf - suexec (like phpsuexec). I think, you may add it in future.
    5. Is there possible to setup something like server-status? WHM displays Apache status by this lines:
    <Location /whm-server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    </Location>
    ExtendedStatus On
    6. And the last thing, but the most important for me. I'm selling also account without PHP/CGI (only data files) and to block the possibility of using PHP (add others) I use these lines in .htaccess:
    <Directory ~ "^/home/(user1|user2|user3)/public_html">
    Options -Includes -ExecCGI
    RemoveType .php .php3 .php4 .phtml .phps .php5 .wmls .wmlsc .cgi .pl
    AllowOverride AuthConfig Indexes Limit
    </Directory>
    <Directory ~ "^/home/(user1|user2|user3)/.*/cgi-bin/">
    Order deny,allow
    Deny from all
    </Directory>
    The problem is that, these lines aren't working in LSWS.
    Last edited: Nov 18, 2006
  4. mistwang

    mistwang LiteSpeed Staff

    Answers to your questions:
    No. 1: 3.0RC1 is expected on Monday, but blocking subdomain may not able to make it, it is a bigger change. Maybe in RC2 release.

    No. 2: Fixed.

    No. 3: It should work, I will check, fix should be 3.0RC1.

    No. 4: Maybe in RC2 release if cannot make into RC1

    No. 5: No plan for this yet. the status of LiteSpeed is completely different.

    No. 6: Try to make it into 3.0RC1
  5. slimak

    slimak New Member

    2&3. OK, now it works.
    5. At this time there could by only the ability to setup the LSWS status accessible from location/alias.

    7. I found another inconvenience: the http isn't suspended after the bandwidth limit is reached. In Apache does that the mod_bwlimited (if file /var/cpanel/bwlimited/$domain exist, then Apache respond an error). That could by done e. g. by these rewrite rules, but I don't know how to add them to all VH:
    RewriteEngine On
    RewriteCond /var/cpanel/bwlimited/%{SERVER_NAME} -f
    RewriteRule ^.* /_autoindex/bwlimit.html [L]

    (in lsws/share/_autoindex/bwlimit.html I created file with an info for users).
  6. mistwang

    mistwang LiteSpeed Staff

    LiteSpeed has its own status/ realtime report page in the admin page, not sure how to make it available. It just a php script parses /tmp/lshttpd/.rtreprot file.

    7. We can hard code those rules into vhosts configured via httpd.conf, when bandwidth logging is set for that vhost. if there is no other better ways to do that. I wonder how cPanel adds similar rewrite rules to Apache configuration? In .htaccess file or httpd.conf?
  7. slimak

    slimak New Member

    7. By httpd.conf is loading module mod_bwlimited.so from /usr/local/cpanel/apache. You may find in this directory the mod_bwlimited.c - source of that little module.
  8. mistwang

    mistwang LiteSpeed Staff

    We implement something similar to the rewrite rules you suggested in 3.0 release.
  9. mistwang

    mistwang LiteSpeed Staff

    Most issue listed above should have been addressed in 3.0RC1 release.
    Except #4, mod_perl suexec has not been added, I think it might take too much memory in shared hosting environment, Perl uses a lot of memory.

Share This Page