How to verify that the Apache web server is running and working properly on Linux

Created:

2016-11-16 12:53:22 UTC

Modified:

2017-08-22 19:56:18 UTC

78

Was this article helpful?


Have more questions?

Submit a request

How to verify that the Apache web server is running and working properly on Linux

Applicable to:

  • Plesk for Linux

Question

How to verify that the Apache web server is running and working properly on Linux?

Answer

Connect to the server using SSH or run Terminal.

Note: The name of Apache 2 binary on Debian is "apache2," not "httpd" as it is on Red Hat-based Linux distributions.

  1. Make sure that "httpd" ("apache2" on Debian) processes are shown in "ps" output:
    # ps aux | grep httpd | grep -v grep
  2. If not, try to start Apache from Plesk(Tools & Settings > Services Management) or via command line(Terminal):
    # service apache2 start (For Debian/Ubuntu)
    # service httpd start (For RHEL/CentOS)

    If an error is received, check /var/log/httpd/error_log (/var/log/apache2/error_log on Debian) for a detailed error description and search in Plesk Knowledge Base 
  3. If no errors appear and Apache silently does not start, make sure that the /var/log/httpd/error_log (the path may differ for different operating systems) consumes less than 2GB.
  4. Make sure that Apache is listening on the both HTTP and HTTPS ports (80/443 or 7080/7081) on all needed IP addresses:
    # netstat -ntpl | grep httpd
    tcp 0 0 0.0.0.0:7080 0.0.0.0:* LISTEN 528/httpd
    tcp 0 0 0.0.0.0:7081 0.0.0.0:* LISTEN 528/httpd
  5. Check that the Apache server is responsive, try to open a page from the server itself using "curl" or a console browser (e.g, Lynx, Links):
    # curl example.com
  6. Check that websites configuration is loaded in Apache by running:
    # apachectl -S (For CentOS/RHEL)
    # apache2ctl -S (For Debian/Ubuntu)
Have more questions? Submit a request
Please sign in to leave a comment.