{"id":2577,"date":"2011-10-02T09:31:50","date_gmt":"2011-10-02T13:31:50","guid":{"rendered":"https:\/\/webhostinggeeks.com\/blog\/?p=2577"},"modified":"2023-09-18T08:35:02","modified_gmt":"2023-09-18T12:35:02","slug":"install-modsecurity-in-centos","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/blog\/install-modsecurity-in-centos\/","title":{"rendered":"How to Install ModSecurity in CentOS"},"content":{"rendered":"<p>If you\u2019re the proud owner of a <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-centos-a-beginners-guide-to-centos-linux\/\">CentOS<\/a> (Seems like most people are favoring the Linux distro these days!) then you owe it to yourself to install a simple utility called <a href=\"https:\/\/www.modsecurity.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">ModSecurity<\/a>. The service is an application firewall that prevents your server from weakness open to exploit in various web applications. It\u2019s not a fool-proof method of tightening your server, but it\u2019s certainly better than nothing\u2014in our eyes, a lot better than nothing.<\/p>\n<p>Thankfully, it\u2019s not hard to install, either. You will need to have a basic understanding of the terminal, as well as how to add repositories to YUM, though. If you\u2019re fuzzy about either of these aspects, we strongly suggest you perform a quick Google search to educate yourself. They\u2019re basic functions that you\u2019ll need to learn eventually, and knowing how to do each well will benefit you greatly during this tutorial.<\/p>\n<p>If you have both fronts covered, then you\u2019re officially ready to march on, Soldier! <strong><\/strong><\/p>\n<p><strong>1. Add the Repo<\/strong>: You\u2019ll first need to add the actual ModSecurity repository, as it\u2019s not a stock part of <a href=\"https:\/\/fedoraproject.org\/wiki\/Yum\" target=\"_blank\" rel=\"noopener noreferrer\">YUM<\/a>. To do so, type the following into terminal:<\/p>\n<p>cd \/etc\/yum.repos.d<\/p>\n<p>You\u2019ll then need to create a file called utterramblings.repo<\/p>\n<p>touch utterramblings.repo<\/p>\n<p>Edit the file with \u201cvi\u201d or \u201cnano,\u201d then insert the following bits into the text:<\/p>\n<p>[utterramblings]<\/p>\n<p>name=Jason\u2019s Utter Ramblings Repo<\/p>\n<p>baseurl=http:\/\/www.jasonlitka.com\/media\/EL$releasever\/$basearch\/<\/p>\n<p>enabled=1<\/p>\n<p>gpgcheck=1<\/p>\n<p>gpgkey=http:\/\/www.jasonlitka.com\/media\/RPM-GPG-KEY-jlitka<\/p>\n<p><strong>2.&nbsp; Install:<\/strong> To finish the process off, just type the following and hope for the best!<\/p>\n<p>yum install mod_security<\/p>\n<p>That\u2019s all there is to it! Now your server is slightly safer, and none the worse for the wear! This should be a painless procedure, but if anything should go wrong, you can always check the <a href=\"https:\/\/sourceforge.net\/projects\/mod-security\/\">ModSecurity<\/a> website for further information or the occasionally helpful bit of tech support.<\/p>\n<p>Likewise, if you\u2019d rather not have that extra YUM repository sitting about, you\u2019re free to delete it once installed. However, doing so prevents you from easily obtaining any new updates without first adding the resource back. If that doesn\u2019t sound like a problem, then power on, Pilgrim. Otherwise, we\u2019d suggest you leave the file where it is and let it soak. If you\u2019re fuzzy about how to add and edit repositories to CentOS, you can always look at <a href=\"https:\/\/wiki.centos.org\/AdditionalResources\/Repositories\">this guide<\/a> to get a quick reference point.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019re the proud owner of a CentOS (Seems like most people are favoring the Linux distro these days!) then you owe it to yourself to install a simple utility&#8230;<\/p>\n","protected":false},"author":3,"featured_media":2584,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[9],"tags":[23,94,61,102,2971],"class_list":["post-2577","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security-issues","tag-centos","tag-dedicated-server","tag-linux","tag-security","tag-yum"],"views":118,"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/posts\/2577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/comments?post=2577"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/posts\/2577\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/media\/2584"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/media?parent=2577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/categories?post=2577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/tags?post=2577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}