The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Account suspension and htaccess

Discussion in 'General Discussion' started by kbuser, Dec 17, 2014.

  1. kbuser

    kbuser Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Previously, upon suspending an account, WHM would replace an account's .htaccess file in order to "suspend" the account's website. This is no longer happening on any of the 6 cpanel/WHM servers I manage with versions ranging from 11.44.1 (and maybe even before this upgrade) to 11.46.1.

    Here is the output from the WHM web interface:

    Suspension of ticket15780test.com

    Changing Shell to /bin/false...Changing shell for kylet1.
    Warning: "/bin/false" is not listed in /etc/shells.
    Shell changed.
    Done
    Locking Password...Locking password for user kylet1.
    passwd: Success
    Done
    1Suspending mysql users
    No filesystems with quota detected.
    Suspending websites...
    No filesystems with quota detected.
    Suspending FTP accounts...
    Updating FTP passwords for kylet1
    FTP password files updated.
    FTP vhost passwords synced
    kylet1's account has been suspended


    This is the relevant /usr/local/cpanel/logs/error_log text:

    [2014-12-17 10:05:37 -0600] warn [suspendmysqlusers] kylet1 has no databases. at /usr/local/cpanel/scripts/suspendmysqlusers line 29
    [2014-12-17 10:05:37 -0600] info [suspendacct] suspendacct Notification => systems@[redacted].com via EMAIL [level => 3]
    [2014-12-17 10:05:37 -0600] info [suspendacct] Quotas are not enabled


    When I look at the List Suspended Accounts page it shows the account as suspended but says "Locked: No"
    I'm going to look through the change logs now for any mention of this locking mechanism, but I haven't seen any reference to it in any WHM options.

    This is the folder where the .htaccess would be written:
    drwxr-x--- 7 kylet1 nobody 4096 Dec 17 10:02 public_html/

    I've tried suspending with an .htaccess file in place already, and also without.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,451
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Here's mine on a server running CURRENT (11.46.1 3)

    Code:
    Changing Shell to /bin/false...Changing shell for username.
    Warning: "/bin/false" is not listed in /etc/shells.
    Shell changed.
    Done
    Locking Password...Locking password for user username.
    passwd: Success
    Done
    1Suspending webdav users
    Suspending email account logins for domain.com .... Done
    Suspending mysql users
    Using Universal Quota Support (quota=0)
    Suspending websites...
    Using Universal Quota Support (quota=614400)
    Suspending FTP accounts...
    Updating FTP passwords for username
    FTP password files updated.
    FTP vhost passwords synced
    username's account has been suspended
    htaccess is empty, untouched.
    No unexpected output in error log that you mention.
     
  3. kbuser

    kbuser Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    The expected behavior is for the .htaccess file to not be empty, but instead redirect to the suspend page. Correct?

    When I suspend an account, their site is still accessible.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,451
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    The site redirected to the suspended page just fine for me.

    Please open a ticket to cPanel Technical Support concerning the issue you're having here. If you wouldn't mind, post back the ticket ID here.

    Thanks!
     
  5. kbuser

    kbuser Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    How does cPanel/WHM handle the redirects for suspended accounts now?
     
  6. kbuser

    kbuser Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    I traced the suspension process through the /scripts/suspendacct script and fixed the issue on one of my servers. I may have found a bug, will test with my other servers and update or submit a bug report as needed.
     
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
  8. kbuser

    kbuser Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    Thank you Kenneth, this was helpful.

    One of my servers required a conf rebuild and restart, this was sufficient. The other ones were not fixed by this process. I traced the issue as far as the file /var/cpanel/templates/apache2/main.default - This does not include the code to check for the existence of, and then include, the file /usr/local/apache/conf/includes/account_suspensions.conf

    Of the servers that don't have this code segment in main.default the versions are
    11.44.1 Build 23
    11.44.1 Build 19
     
  9. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Do you have a customer Apache template in /var/cpanel/templates/apachen_n? For main.local?
    If so that would explain that as custom templates would not have been updated with the change.
     
  10. kbuser

    kbuser Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    66
    Likes Received:
    2
    Trophy Points:
    8
    I should note that I was able to add the line manually and run the distiller to apply/keep the changes, and account suspensions are now working properly.





    Code:
    ls -la /var/cpanel/templates/
    total 36
    drwxr-xr-x  7 root root  4096 Oct  9 04:26 ./
    drwxr-xr-x 92 root root 12288 Dec 30 12:25 ../
    drwxr-xr-x  2 root root  4096 Oct  4 07:25 apache1/
    lrwxrwxrwx  1 root root    29 Oct  4 07:25 apache1_3 -> /var/cpanel/templates/apache1/
    drwxr-xr-x  2 root root  4096 Oct  4 07:25 apache2/
    lrwxrwxrwx  1 root root    29 Oct  4 07:25 apache2_0 -> /var/cpanel/templates/apache2/
    lrwxrwxrwx  1 root root    29 Oct  4 07:25 apache2_2 -> /var/cpanel/templates/apache2/
    drwxr-xr-x  2 root root  4096 Oct  4 07:25 apache2_4/
    drwxr-xr-x  2 root root  4096 Oct  9 04:26 dovecot1.1/
    drwxr-xr-x  2 root root  4096 Nov 13  2012 dovecot1.2/
    

    This is what I see in the directories listed there:

    Code:
    ls -la /var/cpanel/templates/*/
    /var/cpanel/templates/apache1/:
    total 8
    drwxr-xr-x 2 root root 4096 Oct  4 07:25 ./
    drwxr-xr-x 7 root root 4096 Oct  9 04:26 ../
    
    /var/cpanel/templates/apache1_3/:
    total 8
    drwxr-xr-x 2 root root 4096 Oct  4 07:25 ./
    drwxr-xr-x 7 root root 4096 Oct  9 04:26 ../
    
    /var/cpanel/templates/apache2/:
    total 48
    drwxr-xr-x 2 root root  4096 Oct  4 07:25 ./
    drwxr-xr-x 7 root root  4096 Oct  9 04:26 ../
    -rw-r--r-- 1 root root 21085 Oct  4 07:25 main.default
    -rw-r--r-- 1 root root  6761 Oct  4 07:25 ssl_vhost.default
    -rw-r--r-- 1 root root  6125 Oct  4 07:25 vhost.default
    
    /var/cpanel/templates/apache2_0/:
    total 48
    drwxr-xr-x 2 root root  4096 Oct  4 07:25 ./
    drwxr-xr-x 7 root root  4096 Oct  9 04:26 ../
    -rw-r--r-- 1 root root 21085 Oct  4 07:25 main.default
    -rw-r--r-- 1 root root  6761 Oct  4 07:25 ssl_vhost.default
    -rw-r--r-- 1 root root  6125 Oct  4 07:25 vhost.default
    
    /var/cpanel/templates/apache2_2/:
    total 48
    drwxr-xr-x 2 root root  4096 Oct  4 07:25 ./
    drwxr-xr-x 7 root root  4096 Oct  9 04:26 ../
    -rw-r--r-- 1 root root 21085 Oct  4 07:25 main.default
    -rw-r--r-- 1 root root  6761 Oct  4 07:25 ssl_vhost.default
    -rw-r--r-- 1 root root  6125 Oct  4 07:25 vhost.default
    
    /var/cpanel/templates/apache2_4/:
    total 8
    drwxr-xr-x 2 root root 4096 Oct  4 07:25 ./
    drwxr-xr-x 7 root root 4096 Oct  9 04:26 ../
    
    /var/cpanel/templates/dovecot1.1/:
    total 48
    drwxr-xr-x 2 root root  4096 Oct  9 04:26 ./
    drwxr-xr-x 7 root root  4096 Oct  9 04:26 ../
    -rw-r--r-- 1 root root 40098 Oct  9 04:26 main.default
    
    /var/cpanel/templates/dovecot1.2/:
    total 52
    drwxr-xr-x 2 root root  4096 Nov 13  2012 ./
    drwxr-xr-x 7 root root  4096 Oct  9 04:26 ../
    -rw-r--r-- 1 root root 42637 Nov 13  2012 main.default
    

    Running Apache 2.2.22
     
    #10 kbuser, Dec 30, 2014
    Last edited: Dec 30, 2014
Loading...

Share This Page