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