歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux服務器

Linux系統下搭建SNORT入侵檢測系統

1、安裝apache
 
  tar zxvf apache-(版本號)—— 解壓apache
 
  進入解壓目錄。
 
  /configure ——prefix=/usr/local/apache ——enable-so ——enable-rewrite
 
  make
 
  make install
 
  /usr/local/apache/bin/apachectl start 啟動APACHE
 
  http://XXX.XXX.XXX.XXX(服務器IP地址) 測試APACHE
 
  2、安裝mysql
 
  groupadd mysql
 
  useradd -g mysql mysql
 
  tar zxvf mysql-(版本號) —— 解壓mysql
 
  進入解壓目錄。
 
  /configure ——prefix=/usr/local/mysql ——with-charset=gb2312/gbk
 
  make
 
  make install
 
  進入supportsfiles目錄
 
  cp my_medium.cnf /etc/my.cnf
 
  /usr/local/mysql/bin/mysql_install_db ——user=mysql
 
  chown -R root /usr/local/mysql
 
  chown -R mysql /usr/local/mysql/var
 
  chgrp -R mysql /usr/local/mysql
 
  /usr/local/mysql/share/mysql/bin/mysql.server start 啟動MYSQL
 
  /usr/local/mysql/bin/mysqladmin -u root password XXXX
 
  /usr/local/mysql/bin/mysql -u root -p
 
  password:
 
  mysql>
 
  3、安裝PHP
 
  tar zxvf php-(版本號)
 
  進入解壓目錄
 
   。/configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs \

--with-mysql=/usr/local/mysql \

--with-config_file_path=/usr/local/php \

make

make install

cp php.ini_dist /usr/local/lib/php.ini

vi /usr/local/lib/php.ini

更改365行 off為on

vi /usr/local/apache/conf/httpd.conf

DireltoryIndex 後加index.php

AddType applicontion/X-httpd-php .php

vi /usr/local/apache/htdocs/test/php


phpinfo()

?>


 
  重新啟動APACHE
 
  http://XXX.XXX.XXX.XXX/test.php
 
  4、安裝pcre
 
  tar zxvf pcre-(版本號)
 
  進入解壓目錄
 
  。/configure
 
  make
 
  make install

5、安裝snort
 
  tar zxvf snort-(版本號)
 
  進入解壓目錄
 
  。/configure ——with-mysql=/usr/local/mysql
 
  make
 
  make install
 


  6、安裝snort規則庫
 
  tar zxvf snort rules-(版本號)
 
  生成etc、doc、rules、so.rules四個目錄
 
  mkdir /etc/snort
 
  mkdir /etc/snort/rules
 
  mkdir /var/log/snort
 
  cp -R rules/* /etc/snort/
 
  cp etc/* /etc/snort
 
  vi /etc/snort/snort.conf
 
  46行改為:var HOME_NET XXX.XXX.XXX.0/24
 
  111行改為:var Rules_PATH /etc/snort/rules
 
  764行改為:output database:log,mysql,user=root,password=XXXX(密碼同上),dbname=snort
 
  host=localhost
 
  863——874行去掉#
 
  7、創建snort數據庫。
 
   /mysql -u root -p

mysql>create database snort;

>grant INSERT,SELECT on root .* to snort@localhost

>exit

./mydql -u root -p < /usr/local/src/snort-(版本號)/schemas/create_mysql snort

mysql>use snort

mysql>show tables

 

  8、安裝adodb
 
  tar zxvf adodb-(版本號)
 
  cp adodb /usr/local/apache/htdocs
 
  9、安裝jpgraph
 
  tar zxvf jpgraph-(版本號)
 
  移動解壓目錄到/usr/local/apache/htdocs,並改名為jpgraph
 
  10、安裝acid
 
  tar zxvf acid-(版本號)
 
  移動解壓目錄到/usr/local/apache/htdocs,並改名為acid
 
  vi /acid/acid_conf.php
 
  $DBlib_Path='/usr/local/apache/htdocs/adodb';
 
  $alert_dbname="snort";
 
  $alert_host="localhost";
 
  $alert_port="";
 
  $alert_user="root";
 
  $alert_password="xxxxx(同上)";
 
  $archive_dbname="snort";
 
  $archive_host="localhost";
 
  $archive_port="";
 
  $archive_user="root";
 
  $archive_password="xxxxx(同上)";
 
  $charlLib_path="/usr/local/apache/htdocs/jpgraph/src";
 
  $charl_file_format="png";
 
  11、http://xxx.xxx.xxx.xxx/acid 測試
 
  注: 在安裝前應先將編譯工具安裝

Copyright © Linux教程網 All Rights Reserved