commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Doesn't list connections to other ports than port 80. Not f.e. 8080 or 8091.
Excludes programs listening for connections, like your favorite webserver.
Strip a password from a openssl key to use with apache httpd server
Easiest way to check which modules are loaded in apache.
Grabs the Apache config file (yielded from httpd) and returns the path specified as DocumentRoot.
this version is going to work on redhat/centos/suse AND ubuntu/debian systems
Returns the number of running httpd processes
It's not my code, but I found it useful to know how many open connections per request I have on a machine to debug connections without opening another http connection for it.
You can also decide to sort things out differently then the way it appears in here.
as unixmonkey7109 pointed out, first awk parse replaces three steps.
It's not a big line, and it *may not* work for everybody, I guess it depends on the detail of access_log configuration in your httpd.conf. I use it as a prerotate command for logrotate in httpd section so it executes before access_log rotation, everyday at midnight.
This let you know which modules has loaded the Apache server, very useful to know if the mod_rewrite is ready to use.