centos5.5 x86_64
ossec-hids-2.7-beta1
10.10.10.240 ossec server
10.10.10.141 ossec client1
[root@logserver src]# tar -xf ossec-hids-2.7-beta-1.tar.gz
[root@logserver src]# cd ossec-hids-2.7-beta1/
[root@logserver ossec-hids-2.7-beta1]# cd src
[root@logserver src]# make setdb
Info: Compiled with MySQL support
[root@logserver ossec-hids-2.7-beta1]# ./install.sh
[root@logserver ossec-hids-2.7-beta1]# /var/ossec/bin/ossec-control enable database
[root@logserver ossec-hids-2.7-beta1]# mysql -u root -p
mysql> create database ossec;
Query OK, 1 row affected (0.04 sec)
mysql> grant INSERT,SELECT,UPDATE,CREATE,DELETE,EXECUTE on ossec.* to ossecuser@ identified by 'ossecpass';
Query OK, 0 rows affected (0.10 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
[root@logserver ossec-hids-2.7-beta1]# cd contrib/
[root@logserver contrib]# vim ossec2mysql.conf
# PARAMS USED BY OSSEC2BASED
dbhost=localhost
database=ossecuser
debug=5
dbport=3306
dbpasswd=ossecpass
dbuser=ossec
daemonize=0
sensor=centralserver
hids_inter>
[root@logserver contrib]# mysql -u ossecuser -p < /usr/local/src/ossec-hids-2.7-beta1/contrib/ossec2mysql.sql
<database_output> <hostname>10.10.10.137</hostname> <username>ossecuser</username> <password>ossecpass</password> <database>ossec</database> <type>mysql</type> </database_output> </ossec_config> [root@logserver etc]# /var/ossec/bin/ossec-control restart
tar xf ossec-hids-2.7-beta-1.tar.gz
/usr/local/ossec/bin/manage_agents
三、添加ossec client到ossec server /usr/local/ossec/bin/manage_agents
/usr/local/ossec/bin/manage_agents
/usr/local/ossec/bin/ossec-control start
Starting OSSEC HIDS v2.7-beta1 (by Trend Micro Inc.)...
Started ossec-execd...
Started ossec-agentd...
Started ossec-logcollector...
Started ossec-syscheckd...
Completed.
You have new mail in /var/spool/mail/root
[root@redmine src]# netstat -antup|grep ossec
udp 0 0 10.10.10.141:35928 10.10.10.240:1514 ESTABLISHED 28558/ossec-agentd
[root@db src]# tar xf ossec-wui-0.3.tar.gz
[root@db src]# cd ossec-wui-0.3
[root@db ossec-wui-0.3]# ls
CONTRIB css htaccess_def.txt img index.php js lib LICENSE ossec_conf.php README README.search setup.sh site
[root@db ossec-wui-0.3]# cp -Rf * /usr/local/ossec/
[root@db ossec-wui-0.3]# cd /usr/local/ossec/
[root@db ossec]# ./setup.sh
[root@db ossec]# chgrp apache tmp/
[root@db ossec]# chmod 770 -R tmp/
[root@db ossec]#cat /etc/group
[root@db ossec]# yum install -y php.x86_64 php-cli.x86_64 php-devel.x86_64 httpd
[root@db ~]# cat /etc/httpd/conf.d/vdoc.conf
Alias /ossec/ "/usr/local/ossec/"
<Directory "/usr/local/ossec/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "OSSEC AUTH"
AuthType Basic
AuthUserFile /usr/local/ossec/.htpasswd
Require valid-user
ossec预览
本文转自 珏石头 51CTO博客,原文链接:http://blog.51cto.com/gavinshaw/1020540,如需转载请自行联系原作者