Solved

check if mod_evasive is installed

Posted on 2008-10-16
13
794 Views
Last Modified: 2012-05-05
hi,

I installed mod_evasive but its seem to work,
how can I check if it installed in my sever?
0
Comment
Question by:uk1900
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
13 Comments
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 22729304
I'm not sure if I understand the question, but can't you simply modprobe it? It will not be loaded again if already loaded, and you will get an error if it's not installed.
0
 

Author Comment

by:uk1900
ID: 22734675
hi,
I wrote this line in SSH :
 /sbin/modprobe -v mod_evasive20.
 and I didnt get any error,

I guess the problem is about the way I added the configuration  to httpd.conf
<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 6
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600
</IfModule>

I can not edit httpd.conf directly! how normaly u do that?
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 22735609
You can do a modprobe with no error - you must therefore have been able to become root. How then can't you edit httpd.conf?
I don't run httpd myself so can't really help with the config details.

You can test the success / failuer of a command (e.g. modprobe) in a script:

modprobe mod_evasive20
result=$?
if [ result];then
echo "mod_evasive20 is installed"
else
echo "mod_evasive20. NOT installed"
fi

You have the "result" variable to check later for further action, if required
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:uk1900
ID: 22735948
I can not edit httpd.conf  becasue the system doesnt allow me to
yes I can open httpd.conf but when I click on submit the entire file is ruined and the apache wont start!


modprobe mod_evasive20
result=$?
if [ result];then
echo "mod_evasive20 is installed"
else
echo "mod_evasive20. NOT installed"
fi

Open in new window

0
 

Author Comment

by:uk1900
ID: 22735955
I didnt get your code snippet!

any way I know mod_evasive is installed ,but I still dont know how to includde the configuration
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 22739200
What editor are you using to try to edit httpd.conf? vi does not have a submit button.
0
 

Author Comment

by:uk1900
ID: 22742747
I try to update the the file (/etc/httpd/conf/httpd.conf) using the control panel in Virtuozzo:
http://xs432.xs.to/xs432/08425/temp439.png

is this the right file I have to uodate, and what is the proper way to do that?
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 22747522
That control panel editor looks fine. Are you saying that if you so much as invoke it and submit ten things go haywire?
The displayed file is all comments. Is that what the real file looks like? (I.e. in a Terminal window, does it match output from "cat /etc/httpd/conf/httpd.conf"?).
If there is a mismatch, use a text editor (such as vi) to edit the real file. Be sure to copy it to a backup location first.
0
 

Author Comment

by:uk1900
ID: 22888064
hi duncan_roe,

I didnt understand your code in the Code Snippet !

modprobe mod_evasive20
result=$?
if [ result];then
echo "mod_evasive20 is installed"
else
echo "mod_evasive20. NOT installed"
fi

Open in new window

0
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points
ID: 22889759
$? is a special bash variable which holds the exit code of the preceding command. If the code is zero, the command completed successfully (exit(0)), otherwise it did not.
There is a typo - sorry about that - the second line should be "if  [  $result  ]; then". 2 mistakes actually - missed "$"  before "result" and missed space before "]"
Clearer now?
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
lunix and unix command 21 150
how to configure linux OS using Ubuntu 7 77
Samba Question 11 132
SSH setup on ASA 5505 17 113
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question