Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 14 of 14
  1. #1
    Member
    Join Date
    Oct 2008
    Posts
    22

    Exclamation httpd restart fails with no access to cPanel/WHM

    Hi there

    I don't have access to cPanel/WHM and any website on the server. When I try to restart httpd service this error appears:

    [root@server ~]# service httpd restart
    Syntax error on line 11 of /usr/local/apache/conf/modsec2.conf:
    ModSecurity: Failed to open the audit log file: /usr/local/apache/logs/modsec_audit.log
    Anybody can help me solve it?

    Thanks

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: httpd restart fails with no access to cPanel/WHM

    The error message indicates that the /usr/local/apache/logs/modsec_audit.log cannot be opened. Does the file exist?

    Code:
    ls -lah /usr/local/apache/logs/modsec_audit.log
    If it doesn't exist, try creating it:

    Code:
    touch /usr/local/apache/logs/modsec_audit.log
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    Oct 2008
    Posts
    22

    Default Re: httpd restart fails with no access to cPanel/WHM

    I tried to use the first command but it says:

    [root@server ~]# ls -lah /usr/local/apache/logs/modsec_audit.log
    ls: invalid option -- h
    Try `ls --help' for more information.
    I checked this with sftp but the "logs" dir does not exist!
    Should I create it?

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: httpd restart fails with no access to cPanel/WHM

    Try instead to use ls -l:

    Code:
    ls -l /usr/local/apache/logs/modsec_audit.log
    Also, please use SSH to log into the machine rather than using sFTP.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  5. #5
    Member
    Join Date
    Oct 2008
    Posts
    22

    Default Re: httpd restart fails with no access to cPanel/WHM

    Code:
    [root@server ~]# ls -l /usr/local/apache/logs/modsec_audit.log
    ls: /usr/local/apache/logs/modsec_audit.log: No such file or directory
    [root@server ~]# touch /usr/local/apache/logs/modsec_audit.log
    touch: cannot touch `/usr/local/apache/logs/modsec_audit.log': No such file or directory
    What should I do now?

  6. #6
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: httpd restart fails with no access to cPanel/WHM

    Now try:

    Code:
    ls -l /usr/local/apache/logs
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  7. #7
    Member
    Join Date
    Oct 2008
    Posts
    22

    Default Re: httpd restart fails with no access to cPanel/WHM

    Code:
    [root@server ~]# ls -l /usr/local/apache/logs
    ls: /usr/local/apache/logs: No such file or directory
    It seems that my logs folder is lost!
    Last edited by saqur; 09-21-2011 at 01:58 PM.

  8. #8
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: httpd restart fails with no access to cPanel/WHM

    Does /usr/local/apache itself exist?
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  9. #9
    Member
    Join Date
    Oct 2008
    Posts
    22

    Default Re: httpd restart fails with no access to cPanel/WHM

    Yes it is, with some folders in it.
    I think only the logs folder is lost & I don't know why?!

  10. #10
    Member
    Join Date
    Oct 2008
    Posts
    22

    Default Re: httpd restart fails with no access to cPanel/WHM

    Code:
    [root@server ~]# ls -l /usr/local/apache
    total 88
    drwxr-xr-x   2 root     root         4096 Sep 21 04:55 bin
    drwxr-xr-x   2 root     root         4096 Apr  1 00:48 build
    drwxr-xr-x   2 root     root         4096 Mar 31 22:45 cgi-bin
    drwxr-xr-x   9 root     root         4096 Sep 21 18:30 conf
    drwxr-xr-x   9 root     root         4096 Dec 23  2008 conf_pre_ea3
    drwx--x--x  42 root     wheel       28672 Sep 21 23:31 domlogs
    drwxr-xr-x   3 root     root         4096 Mar 31 22:45 error
    drwxr-xr-x   6 root     root         4096 Apr  1 00:48 htdocs
    drwxr-xr-x   3 root     root         4096 Mar 31 22:45 icons
    drwxr-xr-x   2 root     root         4096 Apr  1 00:48 include
    drwxr-xr-x   2 root     root         4096 Apr  1 00:48 lib
    drwxr-xr-x   4 root     root         4096 Mar 31 22:45 man
    drwxr-xr-x  14 root     root        12288 Sep 21 04:55 manual
    drwxr-xr-x   2 root     root         4096 Apr  1 01:04 modules
    This is the list of /usr/local/apache

  11. #11
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: httpd restart fails with no access to cPanel/WHM

    You are going to have to create the folder:

    Code:
    cd /usr/local/apache
    mkdir logs
    After that, create any files it notes don't exist when you try to start Apache

    Code:
    touch /pathtofilename
    Where pathtofilename is the path and name of the file.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  12. #12
    Member
    Join Date
    Oct 2008
    Posts
    22

    Default Re: httpd restart fails with no access to cPanel/WHM

    I did it. but now I see all of my websites are hacked. I think the attack was on the server and some cpanel files are deleted, because I still can not access to WHM.
    What can I do to repair cpanel/WHM?

  13. #13
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: httpd restart fails with no access to cPanel/WHM

    The first thing you should do is check for any backups you have, then format a new machine with cPanel on it to transfer those backups for restoring them. A hacked machine at the level you are talking about (/usr/local/apache) means a root level compromise in all likelihood. They could end up leaving a backdoor on that machine to allow them access again. The best idea is to get a fresh machine up and running from backups, then check the old machine to determine how they managed to compromise it.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  14. #14
    Member
    Join Date
    Oct 2008
    Posts
    22

    Default Re: httpd restart fails with no access to cPanel/WHM

    Thank you for all useful helps.

Similar Threads & Tags
Similar threads

  1. httpd restart fails
    By Sander-Rob in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-23-2009, 11:54 PM
  2. Apache update and httpd fails on restart
    By claude in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 09-05-2006, 02:51 PM
  3. Replies: 1
    Last Post: 08-21-2006, 01:16 PM
  4. httpd fails to restart after install ssl certificate
    By fcitrolo in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-01-2006, 09:57 PM
  5. Apache Fails and Service httpd restart does not start SSL
    By mmkassem in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 02-29-2004, 02:47 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube