Question: I was trying to install mod_security for Apache web server via yum. I googled and found the below command to install mod_security.
# yum install mod_security
Unfortunately, the above command did not work and ended up with the below message.
# yum install mod_security No package mod_security available. Error: Nothing to do
Please help me to fix this issue
It means, yum is not able to contact the right repository that contains mod_security package. In order to install mod_security, you should configure yum with EPEL repo.
On CentOS/RHEL version 6.*:
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
On CentOS/RHEL version 5.*:
# rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Once the repo is installed successfully, try yum install as below:
[root@tifac-wh ~]# yum install mod_security Loaded plugins: fastestmirror, security Setting up Install Process Loading mirror speeds from cached hostfile epel/metalink | 3.3 kB 00:00 * base: centos.excellmedia.net * epel: epel.mirror.net.in * extras: centos.excellmedia.net * updates: centos.excellmedia.net epel | 4.3 kB 00:00 epel/primary_db | 5.7 MB 00:00 Resolving Dependencies --> Running transaction check ---> Package mod_security.x86_64 0:2.7.3-3.el6 will be installed
From the above output, you can see yum making use of EPEL repo to find the mod_security package.
Do you want us to fix your Linux errors? Just ask us via Contact Us page.