InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Apache tutorials

  • AWStats on Ubuntu
  • ApacheBench - load testing
  • Auth to a location or directory
  • Block directory access using htaccess 404
  • Different expire Headers for multiple images
  • Disable directory listing
  • List loaded modules
  • Log Content-Type in access log
  • Log latency and host in apache log
  • Monitoring using mod_status
  • Python to analyze bots in logs
  • Remove php extension from url
  • egrep and access log
  • log custom data in apache access log
  • mod_rewrite
  • top IP list from access log
 
  • Home
  • > Tutorials
  • > Web Development
  • > Apache

Monitor apache using mod_status on Ubuntu

on Mar 2, 2016

Apache installation on Ubuntu Linux automatically installs mod_status also. mod_status can be used to view server activities and performance from a web interface. Here are quick steps to get started with mod_status.

  1. First ensure if you have mod_status installed. Assuming you have apache2 installed run the following on command line.

    $ apache2ctl -M | grep status
    status_module
    

    Note that apache2ctl -M lists all apache loaded modules.

  2. mod_status comes with a default config (/etc/apache2/mods-available/status.conf) which is only accessible from localhost. Here is how the config entry looks like:
    ...
            <Location /server-status>
                    SetHandler server-status
                    Require local
                    #Require ip 192.0.2.0/24
            </Location>
    ...
  3. To setup mod_status remote access with basic http auth add the following apache config. Note that you will have to create /etc/auth-file and a user in it. You can follow steps mentioned in tutorial Apache – add basic auth to a location or directory.
    <IfModule mod_status.c>
      <Location /my-server-status>
        SetHandler server-status
        AuthType Basic
        AuthName "Restricted Resource"
        AuthBasicProvider file
        AuthUserFile /etc/auth-file
        Require valid-user
      </Location>
    </IfModule>
  4. In case you are using wordpress or similar such software where every request is routed to index.php using .htaccess, you can add the following config to .htaccess before RewriteRule entry

    ...
    RewriteCond %{REQUEST_URI} !^/my-server-status$
    RewriteRule . /index.php [L]
    
  5. Now restart apache and access the /my-server-status page. You should be able to see the server status page with all requests being handled by Apache at that time. Here is how it will look like:
    apache-mod-status

Suggested posts:

  1. Disable directory listing in apache
  2. How to list git branches
  3. Why and how to log Content-Type in apache access log
  4. How to use ssh port forwarding to surf a site from different location
  5. Block directory access using htaccess 404
  6. PHP apc – setup and performance benchmarks on Ubuntu Linux
  7. How to zip/unzip a directory with password
  8. Linux – find files containing specific text
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Apache, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress