{"id":534,"date":"2009-01-29T16:16:10","date_gmt":"2009-01-30T00:16:10","guid":{"rendered":"http:\/\/www.laurenwood.org\/anyway\/?p=534"},"modified":"2009-01-29T16:16:10","modified_gmt":"2009-01-30T00:16:10","slug":"rotating-apache-logs-on-opensolaris","status":"publish","type":"post","link":"https:\/\/www.laurenwood.org\/anyway\/2009\/01\/rotating-apache-logs-on-opensolaris\/","title":{"rendered":"Rotating Apache Logs on OpenSolaris"},"content":{"rendered":"<p>Since the Apache access logs grow with time, I like to rotate them once a month or so (for minor sites that don\u2019t get much traffic). On Debi\u00adan, you use <code>logrotate<\/code> (I\u2019ve writ\u00adten about set\u00adting it up <a href=\"http:\/\/www.laurenwood.org\/anyway\/2007\/08\/apache-and-logrotate\/\">here<\/a>). On OpenSol\u00adar\u00adis, you use the <code>logadm<\/code> com\u00admand, with the actu\u00adal rota\u00adtion being spe\u00adcified in <em>\/etc\/logadm.conf<\/em>. When you look at that file, it warns you not to edit it by hand, which I found mildly amus\u00ading. Since you can make changes via the <code>logadm<\/code> com\u00admand itself, I figured I\u2019d try that&nbsp;out.&nbsp;<\/p>\n<p>For Apache log files in the usu\u00adal place, <em>\/var\/apache2\/2.2\/logs\/access_log<\/em>, read\u00ading the man pages for logadm gives&nbsp;<\/p>\n<pre><code>logadm -w apache -p 1m -C 24\\ \n-t '\/var\/apache2\/2.2\/old_logs\/access_log.%Y-%m'\\\n-a '\/usr\/apache2\/2.2\/bin\/apachectl graceful'\\\n\/var\/apache2\/2.2\/logs\/access_log<\/code><\/pre>\n<p>Test\u00ading with <code>logadm -p now apache<\/code> seems to work just fine. I\u2019ll know more about how reli\u00adable it is in a&nbsp;month.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since the Apache access logs grow with time, I like to rotate them once a month or so (for minor sites that don\u2019t get much traffic). On Debi\u00adan, you use logro\u00adtate (I\u2019ve writ\u00adten about set\u00adting it up here). On OpenSol\u00adar\u00adis, you use the logadm com\u00admand, with the actu\u00adal rota\u00adtion being spe\u00adcified in \/etc\/logadm.conf. When you \u2026 <a href=\"https:\/\/www.laurenwood.org\/anyway\/2009\/01\/rotating-apache-logs-on-opensolaris\/\" class=\"more-link\">Con\u00adtin\u00adue read\u00ading<span class=\"screen-reader-text\"> \u201cRotat\u00ading Apache Logs on OpenSolaris\u201d<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":""},"categories":[6],"tags":[68,69,70,20],"class_list":["post-534","post","type-post","status-publish","format-standard","hentry","category-technology","tag-apache","tag-logadm","tag-logrotate","tag-opensolaris"],"_links":{"self":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts\/534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":7,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"predecessor-version":[{"id":542,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts\/534\/revisions\/542"}],"wp:attachment":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}