{"id":796,"date":"2013-06-10T01:44:04","date_gmt":"2013-06-09T23:44:04","guid":{"rendered":"https:\/\/www.npcglib.org\/~stathis\/blog\/?p=796"},"modified":"2013-10-19T15:00:06","modified_gmt":"2013-10-19T13:00:06","slug":"apache-tip-custom-css-for-your-server-status","status":"publish","type":"post","link":"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/","title":{"rendered":"apache tip: custom css for your server status"},"content":{"rendered":"<p>Currently, there isn&#8217;t a straight forward way to stylize the output of the Apache-generated server status. The server&#8217;s status is generated by the <a href=\"http:\/\/httpd.apache.org\/docs\/2.4\/mod\/mod_status.html\" target=\"_blank\">mod_status<\/a> module. I assume that this module is already loaded and its <location> properly configured on your setup. The default location on most installations is <code>\/server-status<\/code> on your web server. You should see a rather minimalistic web page with statistics about the resources consumed by the server when you visit it.<\/p>\n<p>If you would like to add your own touch to the Apache-generated server status output then one way to do it would be to manipulate the generated output to inject some CSS code. The simplest approach to do this is to use another Apache module <a href=\"http:\/\/httpd.apache.org\/docs\/2.4\/mod\/mod_substitute.html\" target=\"_blank\">mod_substitute<\/a>. This module is specifically designed for both simple and advanced substitution of generated html by the server before that is sent to the client.<\/p>\n<p>First, make sure that mod_substitute is loaded by your server:<\/p>\n<pre>\r\n    apache2 -M | grep substitute\r\nor\r\n    httpd -M | grep substitute\r\n<\/pre>\n<p>If you see a line with <code>substitute_module<\/code>, then you&#8217;re good to go. If not see the documentation of your OS vendor on how to install it. Next configure your web server to do the substitution:<\/p>\n<pre>\r\n&lt;Location \/server-status&gt;\r\n\r\n   SetHandler server-status \r\n\r\n   # Add a line on the html head to include a CSS file, \r\n   # instead of writing your CSS code as a substitution string\r\n   <font style=\"color:red;\">AddOutputFilterByType SUBSTITUTE text\/html \r\n   Substitute 's|&lt;\/head&gt;|&lt;style type=\"text\/css\"&gt;@import \"\/status.css\"&lt;\/style&gt;&lt;\/head&gt;|'<\/font>\r\n\r\n&lt;\/Location&gt;\r\n<\/pre>\n<p>Remember to reload or restart your server after you make the relevant configuration changes, or you won&#8217;t see anything happening.<\/p>\n<p>You can now go to your server&#8217;s DocumentRoot and add a file named <code>status.css<\/code> in which you may write whatever CSS code you want to style your server status with. To see the relevant tags used in the original output of the handler inspect the generated html and work in the CSS file only. Feel free to use my <a href=\"\/status.css\">status.css<\/a> file to get started.<\/p>\n<p>Of course you can do more specific substitutions to add classes to various tags and use them to do more advanced styling.<\/p>\n<div id=\"attachment_899\" style=\"width: 772px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-content\/uploads\/2013\/06\/apache-server-status-custom-css.png\"><img aria-describedby=\"caption-attachment-899\" loading=\"lazy\" src=\"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-content\/uploads\/2013\/06\/apache-server-status-custom-css.png\" alt=\"The result of applying the custom CSS to Apache&#039;s default server-status\" width=\"762\" height=\"610\" class=\"size-full wp-image-899\" srcset=\"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-content\/uploads\/2013\/06\/apache-server-status-custom-css.png 762w, https:\/\/www.npcglib.org\/~stathis\/blog\/wp-content\/uploads\/2013\/06\/apache-server-status-custom-css-300x240.png 300w\" sizes=\"(max-width: 762px) 100vw, 762px\" \/><\/a><p id=\"caption-attachment-899\" class=\"wp-caption-text\">The result of applying the custom CSS to Apache&#8217;s default server-status<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Currently, there isn&#8217;t a straight forward way to stylize the output of the Apache-generated server status. The server&#8217;s status is generated by the mod_status module. I assume that this module is already loaded and its properly configured on your setup. The default location on most installations is \/server-status on your web server. You should see [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[48],"tags":[49,56,57],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"description\" content=\"Find out how to customize your apache \/server-status css\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"stathis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#website\",\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/\",\"name\":\"sigmoid\",\"description\":\"..oo..oo..oo..oo..oo..oo..\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-content\/uploads\/2013\/06\/apache-server-status-custom-css.png\",\"contentUrl\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-content\/uploads\/2013\/06\/apache-server-status-custom-css.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#webpage\",\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/\",\"name\":\"apache tip: custom css for your server status - sigmoid\",\"isPartOf\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#primaryimage\"},\"datePublished\":\"2013-06-09T23:44:04+00:00\",\"dateModified\":\"2013-10-19T13:00:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41\"},\"description\":\"Find out how to customize your apache \/server-status css\",\"breadcrumb\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"apache tip: custom css for your server status\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41\",\"name\":\"stathis\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g\",\"caption\":\"stathis\"},\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/author\/stathis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"description":"Find out how to customize your apache \/server-status css","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:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/","twitter_misc":{"Written by":"stathis","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#website","url":"https:\/\/www.npcglib.org\/~stathis\/blog\/","name":"sigmoid","description":"..oo..oo..oo..oo..oo..oo..","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.npcglib.org\/~stathis\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#primaryimage","inLanguage":"en-US","url":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-content\/uploads\/2013\/06\/apache-server-status-custom-css.png","contentUrl":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-content\/uploads\/2013\/06\/apache-server-status-custom-css.png"},{"@type":"WebPage","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#webpage","url":"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/","name":"apache tip: custom css for your server status - sigmoid","isPartOf":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#primaryimage"},"datePublished":"2013-06-09T23:44:04+00:00","dateModified":"2013-10-19T13:00:06+00:00","author":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41"},"description":"Find out how to customize your apache \/server-status css","breadcrumb":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2013\/06\/10\/apache-tip-custom-css-for-your-server-status\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.npcglib.org\/~stathis\/blog\/"},{"@type":"ListItem","position":2,"name":"apache tip: custom css for your server status"}]},{"@type":"Person","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41","name":"stathis","image":{"@type":"ImageObject","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#personlogo","inLanguage":"en-US","url":"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g","contentUrl":"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g","caption":"stathis"},"url":"https:\/\/www.npcglib.org\/~stathis\/blog\/author\/stathis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts\/796"}],"collection":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/comments?post=796"}],"version-history":[{"count":21,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts\/796\/revisions"}],"predecessor-version":[{"id":1223,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts\/796\/revisions\/1223"}],"wp:attachment":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/media?parent=796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/categories?post=796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/tags?post=796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}