0

I'm facing an issue where I can't restart the apache server or starting it. The error says "There was an error while performing the operation". I don't know what causing this problem.

Maybe someone can help me to solve this problem ? Thank you.

EDIT:: OS Distro: CentOS 6 64bit Apache Version: Apache/2.2.31 (Unix) DAV/2 mod_ssl/2.2.31 OpenSSL/1.0.1u mod_wsgi/4.4.22 Python/2.7.11

K. Pradnyana
  • 77
  • 1
  • 1
  • 12
  • 1
    Add more information, such as your apache version, OS distro and version and the last few lines of your apache error log. If you haven't customized it, the apache error log may be in: /var/log/apache2/error.log – Kanuj Bhatnagar Nov 27 '17 at 06:01
  • @KanujBhatnagar I updated my question, but I didn't find the directory you suggest – K. Pradnyana Nov 27 '17 at 06:39
  • Are you able to run the following command: tail -f /var/logs/httpd/error_log and post the content of the last few lines here? – Kanuj Bhatnagar Nov 27 '17 at 08:15
  • @KanujBhatnagar this the output -> tail: cannot open `/var/logs/httpd/error_log' for reading: No such file or directory tail: no files remaining – K. Pradnyana Nov 27 '17 at 08:38
  • Previously, I was removed error_log and all log files in /usr/local/apps/apache/logs/ , because it spend a lot space. So, I decide to remove it, and then when I want to restart the apache service via webuzo it doesn't work – K. Pradnyana Nov 27 '17 at 09:02

2 Answers2

0

I just reboot my vps and then normally work again. So maybe it because there is some config is not correct.

K. Pradnyana
  • 77
  • 1
  • 1
  • 12
  • For future reference, you may want to enable your logs again. It is not advised to delete them, you'll face trouble in debugging the next time your apache won't start again. – Kanuj Bhatnagar Nov 28 '17 at 04:34
  • @KanujBhatnagar how do I enable it ? just by command touch error_log ? – K. Pradnyana Nov 29 '17 at 07:39
0

First, check the is there any service running on port 80 by executing the following command

lsof -i:80

if you found anything just kill it by

kill -9(processid)

Now run the following command to restart the apache:

service httpd restart

This command will work for both Centos as well as ubuntu.

if still not starting the apache then you can check the apache log located at

/var/log/apache/