Currently set to No Index
Currently set to Follow

How to Install ModSecurity in CentOS

modsecurity-centos

If you’re the proud owner of a dedicated server running CentOS (Seems like most people are favoring the Linux distro these days!) then you owe it to yourself to install a simple utility called ModSecurity. The service is an application firewall that prevents your server from weakness open to exploit in various web applications. It’s not a fool-proof method of tightening your server, but it’s certainly better than nothing—in our eyes, a lot better than nothing.

Thankfully, it’s 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’re fuzzy about either of these aspects, we strongly suggest you perform a quick Google search to educate yourself. They’re basic functions that you’ll need to learn eventually, and knowing how to do each well will benefit you greatly during this tutorial.

RELATED:   Dedicated Server Hosting: How to Tell if Your Getting What You Paid For

If you have both fronts covered, then you’re officially ready to march on, Soldier!

1. Add the Repo: You’ll first need to add the actual ModSecurity repository, as it’s not a stock part of YUM. To do so, type the following into terminal:

cd /etc/yum.repos.d

You’ll then need to create a file called utterramblings.repo

touch utterramblings.repo

Edit the file with “vi” or “nano,” then insert the following bits into the text:

[utterramblings]

name=Jason’s Utter Ramblings Repo

baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/

enabled=1

gpgcheck=1

gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

2.  Install: To finish the process off, just type the following and hope for the best!

yum install mod_security

That’s 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 ModSecurity website for further information or the occasionally helpful bit of tech support.

RELATED:   Secure Shell Security Tips

Likewise, if you’d rather not have that extra YUM repository sitting about, you’re 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’t sound like a problem, then power on, Pilgrim. Otherwise, we’d suggest you leave the file where it is and let it soak. If you’re fuzzy about how to add and edit repositories to CentOS, you can always look at this guide to get a quick reference point.

How to Find a Successful Name For Your New Blog?
How to Find a Successful Name For Your New Blog?

One of the most important decisions you can make to ensure your blog is among the best is to select a name. While there are more than 500 million blogs available...

How-to Start a Blog – Review of the Best 10 Blogging Platforms
How-to Start a Blog – Review of the Best 10 Blogging Platforms

If you want to start a blog as fast as possible, then you need to consider choosing a blogging platform. Thankfully, there are some excellent free and paid blogging platforms...

How Referral Marketing Can Benefit Web Hosts
How Referral Marketing Can Benefit Web Hosts

Even if the niche of web hosts are fully loaded with a lot of companies they are still one of the easiest to promote because you could write your own...

Broken Links: How to Find, Fix, and Benefit from Broken Links
Broken Links: How to Find, Fix, and Benefit from Broken Links

Links are what holds the web together. Essentially, the web is named as such because of the ability for pages and sites to link to other sources and relevant information....

Brand Value & the Most Powerful Brands (with Infographic)
Brand Value & the Most Powerful Brands (with Infographic)

Brand value – everyone wants it, however, only few are able to achieve it. The subject of “brand value” holds a significant position amongst marketers, executives, and entrepreneurs. Let’s discuss...

Reasons why your business should shift to Cloud hosting
Reasons why your business should shift to Cloud hosting

Cloud hosting has been on the rise since its inception. The improvement to your website performance and business efficiency that comes with Cloud hosting is almost tangible.

Why We Love the IT Support Career?
Why We Love the IT Support Career?

In almost all of my posts I was talking about the stressful side of the IT – the long hours, end user issues, migrations, midnight calls and the like. But...

IT Manager: Ways To Show Your Appreciation To Your Team
IT Manager: Ways To Show Your Appreciation To Your Team

Surely your team struggled hard and made things happen. You cannot say “this is what you get paid for” and just leave – you cannot keep your IT staff that...

3 Comments

  • Avatar for Dmitry Dmitry says:

    Most of the time, the issues could be very personal. Thus, it would be hard to create such a troubleshooting guide.

  • Avatar for P.V.Anthony P.V.Anthony says:

    Is there a version for CentOS 6?

    Tried the steps mention above and they did not work on CentOS 6.

  • Avatar for Pierter Pierter says:

    The challenge is not the installation of modsecurity but the configuration and troubleshooting when something stops working. It would have been nice if you had added a howto get started without shooting yourself in your foot guide.

Leave a Reply

Your email address will not be published. Required fields are marked *