4、然后安装LibPcap
LibPcap可以调用tcpdump,将我们局网内的包都抓下来:
[root@netserver ids]# tar -xvzf libpcap-0.7.2.tar.gz
[root@netserver ids]# cd libpcap-0.7.2
[root@netserver libpcap-0.7.2]#./configure
[root@netserver libpcap-0.7.2]# make
[root@netserver libpcap-0.7.2]# make install
[root@netserver libpcap-0.7.2]# cd ..
5、安装MySQL数据库:
如果是默认RPM安装的MySQL,snort编译能通过,但是使用的时候存在问题,所以我们自己下源代码编译安装
A.创建MySQL组和用户
[root@netserver ids]#groupadd mysql
[root@netserver ids]#useradd -g mysql mysql
b.编辑/root目录下的.bash_profile文件,将MySQL的路径添加进去
[root@netserver ids]#echo 'PATH=$PATH:$HOME/bin:/usr/local/mysql/bin' >> /root/.bash_profile
c.编译安装MySQL
[root@netserver ids]#tar -xvzf mysql-4.0.15a.tar.gz
[root@netserver mysql-4.0.15a]#cd mysql-4.0.15a
[root@netserver mysql-4.0.15a]#./configure --prefix=/usr/local/mysql
[root@netserver mysql-4.0.15a]#make
[root@netserver mysql-4.0.15a]#make install
[root@netserver mysql-4.0.15a]#scripts/mysql_install_db
[root@netserver mysql-4.0.15a]#chown -R root /usr/local/mysql
[root@netserver mysql-4.0.15a]#chown -R mysql /usr/local/mysql/var
[root@netserver mysql-4.0.15a]#chgrp -R mysql /usr/local/mysql
[root@netserver mysql-4.0.15a]#cp support- files/my-medium.cnf /etc/my.cnf
[root@netserver mysql-4.0.15a]#echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
[root@netserver mysql-4.0.15a]#echo "/usr/local/lib " >> /etc/ld.so.conf
[root@netserver mysql-4.0.15a]#ldconfig -v
接下来我们测试一下
[root@netserver mysql-4.0.15a]#/usr/local/mysql/bin/mysqld_safe --user=mysql &
如果没有错误,用命令ps看看是否mysql已经运行了。
[root@netserver mysql-4.0.15a]#ps -ef |grep mysql 如果看到返回
root 1181 1 0 Oct11 ? 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/netserver.pid
mysql 1215 1181 0 Oct11 ? 00:01:16 [mysqld]
root 19384 19306 0 11:59 pts/0 00:00:00 grep mysql