分类:
2008-06-30 16:00:05
安装一些支持库
tar -zxvf zlib-
cd zlib-
./configure
make
make install
cd ..
tar -zxvf libpcap-
cd libpcap-
./configure
make
make install
cd ..
安装MYSQL
# groupadd mysql
# useradd -g mysql -d /usr/local/mysql/data -M mysql
# tar -zxvf mysql-
# cd mysql-
./configure --prefix=/usr/local/mysql \ 指定安装目录
> --sysconfdir=/etc \ 配置文件的路径
> --localstatedir=/usr/local/mysql/data \ 数据库存放的路径
> --enable-assembler \ 使用一些字符函数的汇编版本
> --with-mysqld-ldflags=-all-static \ 以纯静态方式编译服务端
> --with-charset=gb2312 \ 添加gb2312字符支持
> --with-extra-charsets=all 添加所有字符支持
# make
# make install
# /usr/local/mysql/bin/mysql_install_db
# chown -R mysql:mysql /usr/local/mysql/data
# cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
[root@fedora snort]# /usr/local/mysql/bin/mysqladmin -u root password 'gzidc'
Linux下执行程序时发生错误: cannot restore segment prot after reloc: Permission denied
原来这是SELinux搞的鬼,解决办法有两个:
1. 使用chcon 命令 示例: chcon -t texrel_shlib_t /usr/local/rsi/idl_6.1/bin/bin.linux.x86/*.so
2. 禁止掉SELinux 更改/etc/sysconfig/selinux 文件的内容为 SELINUX=disabled
这个问题参考了以下链接
安装Apache
tar -zvxf httpd-
cd httpd-
./configure --prefix=/usr/local/apache --enable-so
make
make install
安装PHP
tar zxvf php-5.2.tar.gz
cd php-5.2
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php5/etc --enable-sockets --with-mysql=/usr/local/mysql --with-zlib --with-gd
make
make install
cp ./php.ini-dist /usr/local/php5/etc/php.ini
修改httpd.conf
#vi /usr/local/apache/conf/httpd.conf
加载php模块,去掉注释“#”,如没有此行,请加上。
LoadModule php5_module modules/libphp5.so
加上此两行
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
# /usr/local/apache/bin/apachctl start
安装Snort
[root@fedora src]# mkdir /usr/local/snort
[root@fedora src]# mkdir /var/log/snort
[root@fedora src]# tar -zxvf snort-
[root@fedora src]# cd snort-
./configure --prefix=/usr/local/snort --with-mysql=/usr/local/mysql/
make
make install
cd /usr/local/snort
[root@fedora snort]# tar -zxvf snortrules-snapshot-CURRENT.tar.gz
[root@fedora snort]# cp /usr/local/src/snort-
[root@fedora snort]# cp /usr/local/src/snort-
修改snort.conf
var HOME_NET
var RULE_PATH ./rules 修改为 var RULE_PATH /usr/local/snort/rules
改变记录日志数据库:
output database: log, mysql, user=root password=your_password dbname=snort host=localhost
cd /usr/local/src/snort-
[root@fedora schemas]# /usr/local/mysql/bin/mysqladmin -u root -p create snort
[root@fedora schemas]# /usr/local/mysql/bin/mysqladmin -u root -p create snort_archive
[root@fedora schemas]# /usr/local/mysql/bin/mysql -u root -p snort < create_mysql
[root@fedora schemas]# /usr/local/mysql/bin/mysql -u root -p snort_archive < create_mysql
安装ADODB
[root@fedora schemas]# cd /usr/local/
# tar zxvf adodb
安裝BASE
#cd /usr/local/src/snortinstall
#cp base-
#cd /usr/local/apache2/htdocs
#tar –xvzf base-
#rm –rf base-
#mv base-
接下来这些步骤不必做,如果您做了,安装base时,一样必须将base_conf.php移开。不过将设定值记好,等一下用浏览器安装
base時用得着。
cp base_conf.php.dist base_conf.php
edit the “base_conf.php” file and insert the following perimeters
$BASE_urlpath = "/base";
$DBlib_path = "/usr/local/adodb ";
$DBtype = "mysql";
$alert_dbname = "snort";
$alert_host = "localhost";
$alert_port = "";
$alert_user = "root";
$alert_password = "password_of_root_mysql";
/* Archive DB connection parameters */
$archive_exists = 0; # Set this to 1 if you have an archive DBcd /var/www/html/base/
# /usr/local/php5/bin/pear install Image_Color-
# /usr/local/php5/bin/pear install Image_Canvas-
# /usr/local/php5/bin/pear install Numbers_Roman-
# /usr/local/php5/bin/pear install Numbers_Words-
# /usr/local/php5/bin/pear install Image_Graph-
运行snort
# /usr/local/snort/bin/snort -dev -c /usr/local/snort/snort.conf
查看mysql运行的进程
mysql> show processlist;