Question

How to resolve this error in Linux Centos?

Posted July 10, 2017 57.3k views
CentOSApache

I have a Error in my Linus Server. When i will logon my domain on browser example.com it can show an error ERROR: Gateway Timeout I will use PuTTy on Computer Windows, when i login my root User and Enter My Password after given of this command, systemctl status httpd.service a error show. Error=>

● httpd.service - The Apache HTTP Server

Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)

Active: failed (Result: exit-code) since Mon 2017-07-10 00:04:01 PKT; 9h ago Docs: man:httpd(8)

man:apachectl(8)

Process: 40522 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited,

status=1/FAILURE)

Process: 40521 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited,

status=1/FAILURE)

Main PID: 40521 (code=exited, status=1/FAILURE)

Jul 10 00:04:01 example.com systemd[1]: Starting The Apache HTTP Server…

Jul 10 00:04:01 example.com httpd[40521]: (2)No such file or directory: A…1

Jul 10 00:04:01 example.com httpd[40521]: AH00014: Configuration check failed

Jul 10 00:04:01 example.com systemd[1]: httpd.service: main process exite…E

Jul 10 00:04:01 example.com kill[40522]: kill: cannot find process “”

Jul 10 00:04:01 example.com systemd[1]: httpd.service: control process ex…1

Jul 10 00:04:01 example.com systemd[1]: Failed to start The Apache HTTP S....

Jul 10 00:04:01 example.com systemd[1]: Unit httpd.service entered failed....

Jul 10 00:04:01 example.com systemd[1]: httpd.service failed.

Jul 10 03:19:01 example.com systemd[1]: Unit httpd.service cannot be relo....

Hint: Some lines were ellipsized, use -l to show in full.

Note: Example.com in above question is my primary domain name. I will not show my primary domain due to security reason. Thank you

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hi @salmanafzal

It looks like there’s a configuration error somewhere in your Apache configs. Run this:

sudo apachectl configtest

Please post the last 30 lines from the Apache error log. Run this:

sudo tail -30 /var/log/apache2/error.log

Hi @hansen
When i enter these command in PuTTy , an error show.
=>sudo apachectl configtest
Result:
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:355
(2)No such file or directory: AH02291: Cannot access directory ’/var/www/subdomain.example.com/logs/’ for error log of vhost defined at /etc/httpd/conf.d/subdomain.example.com.conf:1
AH00014: Configuration check failed
=> sudo tail -30 /var/log/apache2/error.log
Result:
tail: cannot open ‘/var/log/apache2/error.log’ for reading: No such file or directory

Kindly solve my issue please. What is error in my Linux Server?

  • @salmanafzal

    The ErrorLog parameter defined in /etc/httpd/conf.d/subdomain.example.com.conf is incorrect. Either remove it or change it to something correct, and then restart Apache.

    This is the community forum, meaning user-to-user support.
    And there’s nothing wrong with your Linux Server, you just have a bad configuration in Apache.

Submit an Answer