【参加讨论】d.测试一下php是否能成功运行
[root@netserver php-4.3.3]#echo '<?php phpinfo() ?>' /www/htdocs/test.php
[root@netserver php-4.3.3]#/www/bin/apachectl restart e.让apache在以运行级3、5启动的时候能够自动运行
[root@netserver php-4.3.3]#cp apachectl /etc/init.d/httpd
[root@netserver php-4.3.3]#chmod 755 /etc/init.d/httpd
[root@netserver php-4.3.3]# ln -s /etc/init.d/httpd /etc/rc3.d/s85httpd
[root@netserver php-4.3.3]# ln -s /etc/init.d/httpd /etc/rc3.d/k85httpd
[root@netserver php-4.3.3]# ln -s /etc/init.d/httpd /etc/rc5.d/s85httpd
[root@netserver php-4.3.3]# ln -s /etc/init.d/httpd /etc/rc5.d/k85httpd
[root@netserver php-4.3.3]#cd ../
然后在浏览器输入 http://该机ip地址/test.php 查看关于apache/php的信息
7、安装snort和过滤规则
a. 编译安装snort
[root@netserver ids]#groupadd snort
[root@netserver ids]#useradd -g snort snort
[root@netserver ids]#mkdir /etc/snort
[root@netserver ids]#mkdir /etc/snort/rules
[root@netserver ids]#mkdir /var/log/snort
[root@netserver ids]#tar -xvzf snort-2.0.2.tar.gz
[root@netserver ids]#cd snort-2.0.2
[root@netserver snort-2.0.2]#./configure --with-mysql=/usr/local/mysql --enable-flexresp --with-libpcap-includes=/usr/local/libpcap/include --with-libpcap-libraries=/usr/local/libpcap/lib (此语句请写成一行)
[root@netserver snort-2.0.2]#make
[root@netserver snort-2.0.2]#make install
b. 设置规则,我们这里为了方便,直接使用snort自带的规则
[root@netserver snort-2.0.2]#cp rules/* /etc/snort
[root@netserver snort-2.0.2]#cp etc/.conf /etc/snort
[root@netserver snort-2.0.2]#cp *.conf /etc/snort
c.编辑snort.conf文件
[root@netserver snort-2.0.2]#vi /etc/snort/snort.conf
将以下几行的值改变为所写的:
var rule_path /etc/snort/rules/
output database: log, mysql, user=snort password=(你的密码) dbname=snort host=localhost
d.让snort在以运行级3、5启动的时候能够自动运行
snort. (cp contrib/s99snort /etc/init.d/snort) change the following lines:
[root@netserver snort-2.0.2]#cp contrib/s99snort /etc/init.d/snort
编辑snort文件,修改下面两行
[root@netserver snort-2.0.2]#vi /etc/init.d/snort
config=/etc/snort/snort.conf
snort_gid=snort
[root@netserver snort-2.0.2]#chmod 755 /etc/init.d/snort
[root@netserver snort-2.0.2]#ln -s /etc/init.d/snort /etc/rc3.d/s99snort
[root@netserver snort-2.0.2]#ln -s /etc/init.d/snort /etc/rc3.d/k99snort
[root@netserver snort-2.0.2]#ln -s /etc/init.d/snort /etc/rc5.d/s99snort
[root@netserver snort-2.0.2]#ln -s /etc/init.d/snort /etc/rc5.d/k99snort
e.在mysql中设置snort需要的库
[root@netserver snort-2.0.2]#/usr/local/mysql/bin/mysql
mysql> set password for root@localhost=password('你的root的密码');
>query ok, 0 rows affected (0.25 sec)
mysql> create database snort;
>query ok, 1 row affected (0.01 sec)
mysql> grant insert,select on root.* to snort@localhost;
>query ok, 0 rows affected (0.02 sec)
mysql> set password for snort@localhost=password('你的snort的密码')
>query ok, 0 rows affected (0.25 sec)
mysql> grant create, insert, select, delete, update on snort.* to snort@localhost
>query ok, 0 rows affected (0.02 sec)
mysql> grant create, insert, select, delete, update on snort.* to snort
>query ok, 0 rows affected (0.02 sec)
mysql> exit
>bye