{"id":526,"date":"2009-11-03T10:39:38","date_gmt":"2009-11-03T10:39:38","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/index.php\/?p=526"},"modified":"2009-11-03T10:39:38","modified_gmt":"2009-11-03T10:39:38","slug":"apachetop","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/apachetop\/","title":{"rendered":"Apachetop"},"content":{"rendered":"<p>Monitor Your Website in Real-Time with Apachetop<\/p>\n<p>As a webmaster, I\u2019ve often wanted to be able to see real-time hits as they arrive. Sure, Google Analytics is a wonderful package for looking at trends over time, but there\u2019s a delay of a few hours there, and you really can\u2019t see data like requests per second or total bytes.<\/p>\n<p>This is where the apachetop utility comes in. It\u2019s a very simple command line utility that you can use to monitor traffic real-time. It accomplishes this by parsing the apache logfiles and displaying meaningful output to the screen.<\/p>\n<p>Using Apachetop<\/p>\n<p>Once you\u2019ve installed the utility (instructions below), you can launch it by simply running apachetop from the command line. Since apachetop sometimes defaults to the wrong directory for the logfiles, you can pass in the -f parameter to specify the location of the logfile. This is also helpful when you have many virtual hosts on the same box.<\/p>\n<p>    apachetop -f \/var\/www\/vhosts\/howtogeek.com\/statistics\/logs\/access_log<\/p>\n<p>Monitoring Timeframe<\/p>\n<p>The first thing to note is that the default time range for data shown is 30 seconds, so don\u2019t expect the total counts to continue to climb forever. You can change this by passing in a few different arguments.<\/p>\n<p>    apachetop -H hits  (Will display stats on the last x number of hits)<\/p>\n<p>    apachetop -T secs  (Will display stats on the last x number of seconds)<\/p>\n<p>I\u2019ve been using a range of 5-10 minutes in my testing, and it really shows some useful feedback. There\u2019s other options you can try out as well.<\/p>\n<p>Filters<\/p>\n<p>The next thing to note is that you can filter what gets shown in the view. To access the filters, use the f key, and you should see a small line pop up.<\/p>\n<p>Hit the a key to add a filter and the line should switch. Now you can choose to filter by URL, referrer, or host.<\/p>\n<p>I\u2019m going to choose URL by hitting the u key. The filter dialog will show up near the bottom:<\/p>\n<p>Since all of my articles are under the subdirectory \/howto\/, I\u2019m going to enter that. Now apachetop will only show the hits relevant to hits to the articles, instead of every hit for every image.<\/p>\n<p>Viewing Request Details<\/p>\n<p>If you use the up\/down keys, you\u2019ll notice the cursor move up and down to allow you to select a request. (notice the * char)<\/p>\n<p>If you hit the Right arrow key, you\u2019ll be taken to the details page for that request. From here you can see the actual hosts hitting your site, as well as the referrers. I\u2019m not going to show the hosts, since I don\u2019t want to give out user\u2019s IP address, but you can see the referrer here:<\/p>\n<p>To go back to the list, just use the Left arrow key.<\/p>\n<p>Switch Between Hosts, Referrers and URLs<\/p>\n<p>If you use the d key, you can easily switch between the different views.<\/p>\n<p>For instance, I can see what traffic StumbleUpon is sending me, and then I can use the details view(right arrow) to see the exact articles that are getting hit from stumbleupon.<\/p>\n<p>Help<\/p>\n<p>At any point you can hit the ? or the h keys to take you to the help screen, which will give you a quick view of all the options.<\/p>\n<p>I find the sort to be very useful.<\/p>\n<p>Installing on Ubuntu<\/p>\n<p>    sudo apt-get install apachetop<\/p>\n<p>Installing from Source on CentOS<\/p>\n<p>    wget http:\/\/www.webta.org\/apachetop\/apachetop-0.12.6.tar.gz<\/p>\n<p>    yum install readline-devel<\/p>\n<p>    yum install ncurses-devel<\/p>\n<p>    tar xvzf apachetop-0.12.6.tar.gz<\/p>\n<p>    cd apachetop-0.12.6<\/p>\n<p>    .\/configure<\/p>\n<p>    make<\/p>\n<p>The binary can be found in src\/apachetop, and you can copy it anywhere you\u2019d like.<\/p>\n<p>Installing from Source on Ubuntu<\/p>\n<p>    wget http:\/\/www.webta.org\/apachetop\/apachetop-0.12.6.tar.gz<\/p>\n<p>    sudo apt-get install ncurses-dev<\/p>\n<p>    sudo apt-get install libreadline5-dev<\/p>\n<p>    tar xvzf apachetop-0.12.6.tar.gz<\/p>\n<p>    cd apachetop-0.12.6<\/p>\n<p>    .\/configure<\/p>\n<p>    make<\/p>\n<p> The binary can be found in src\/apachetop, and you can copy it anywhere you\u2019d like.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Monitor Your Website in Real-Time with Apachetop As a webmaster, I\u2019ve often wanted to be able to see real-time hits as they arrive. Sure, Google Analytics is a wonderful package for looking at trends over time, but there\u2019s a delay of a few hours there, and you really can\u2019t see data like requests per second&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/apachetop\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-526","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apachetop - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/apachetop\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apachetop - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"Monitor Your Website in Real-Time with Apachetop As a webmaster, I\u2019ve often wanted to be able to see real-time hits as they arrive. Sure, Google Analytics is a wonderful package for looking at trends over time, but there\u2019s a delay of a few hours there, and you really can\u2019t see data like requests per second... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/apachetop\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2009-11-03T10:39:38+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/apachetop\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/apachetop\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Apachetop\",\"datePublished\":\"2009-11-03T10:39:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/apachetop\\\/\"},\"wordCount\":677,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/apachetop\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/apachetop\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/apachetop\\\/\",\"name\":\"Apachetop - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2009-11-03T10:39:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/apachetop\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/apachetop\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/apachetop\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apachetop\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apachetop - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/apachetop\/","og_locale":"en_US","og_type":"article","og_title":"Apachetop - Linux Shtuff","og_description":"Monitor Your Website in Real-Time with Apachetop As a webmaster, I\u2019ve often wanted to be able to see real-time hits as they arrive. Sure, Google Analytics is a wonderful package for looking at trends over time, but there\u2019s a delay of a few hours there, and you really can\u2019t see data like requests per second... Read More","og_url":"https:\/\/g33kinfo.com\/info\/apachetop\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2009-11-03T10:39:38+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/apachetop\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/apachetop\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Apachetop","datePublished":"2009-11-03T10:39:38+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/apachetop\/"},"wordCount":677,"commentCount":0,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/g33kinfo.com\/info\/apachetop\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/apachetop\/","url":"https:\/\/g33kinfo.com\/info\/apachetop\/","name":"Apachetop - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2009-11-03T10:39:38+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/apachetop\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/apachetop\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/apachetop\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Apachetop"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=526"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/526\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}