Chinaunix首页 | 论坛 | 博客
  • 博客访问: 554420
  • 博文数量: 104
  • 博客积分: 4131
  • 博客等级: 上校
  • 技术积分: 1137
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-31 15:05
文章分类

全部博文(104)

文章存档

2011年(13)

2010年(23)

2009年(68)

我的朋友

分类: LINUX

2009-11-02 23:06:09

本来是打算做字符串匹配的,上网查了资料说是snort中有匹配算法,于是想自己装一个试试,真是没想到,一装就3个星期,还是好不容易才搞定的。闲话不说了,下面就详细的介绍一下我的安装步骤,希望对初学者有帮助。
snort安装软件列表:
zlib-1.2.3.tar.gz
libpcap-1.0.0.tar.gz
libxml2-2.6.19.tar.gz
libpng-1.2.40.tar.gz
gd-2.0.33.tar.gz
jpegsrc.v7.tar.gz
mysql-5.0.22.tar.gz
DBD-mysql-3.0008.tar.gz
httpd-2.2.14.tar.gz
php-5.2.9.tar[1].bz2
pcre-8.00.tar.gz
snort-2.8.3.1.tar.gz
snortrules-snapshot-2[1].8.tar.gz
snortrules-snapshot-CURRENT[1].tar.gz
jpgraph-3.0.6.tar.bz2
adodb498.tgz
acid-0.9.6b23.tar.gz
把所有软件放入/usr/local/tarballs文件夹下
具体安装步骤:
1.安装zlib
# cd /usr/local/tarballs
# tar -zxvf zlib-1.2.3.tar.gz
# cd zlib-1.2.3
# ./configure
# make
# make install
# cd ..
这里必须安装高于1.2.1版本的zlib,否则无法安装gd
2.安装libpcap
# tar -zxvf libpcap-1.0.0.tar.gz
# cd libpcap-1.0.0
# ./configure
# make
# make install
# cd ..
3.安装libxml2
# tar -zxvf libxml2-2.6.19.tar.gz
# cd libxml2-2.6.19
# ./configure
# make
# make install
# cd ..
4.安装libpng
# tar -zxvf libpng-1.2.40.tar.gz
# cd libpng-1.2.40
# ./configure
# make
# make install
cd ..
5.安装gd
# tar -zxvf gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure
# make
# make install
# cd ..
6.安装jpeg
# tar -zxvf jpegsrc.v7.tar.gz
# cd jpeg-7
# ./configure
# make
# make install
# cd ..
7.安装mysql
# groupadd mysql
# useradd -g mysql mysql
# tar -zxvf mysql-5.0.22.tar.gz
# cd mysql-5.0.22
# ./configure --prefix=/usr/local/mysql --with-charset=gb2312
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
# cd /usr/local/mysql
# bin/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql var
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &
# gedit /etc/ld.so.conf
在文件中加入两行:/usr/local/mysql/lib/mysql /usr/local/lib
# ldconfig
8.安装DBD-mysql
# cd /usr/local/tarballs
# tar -zxvf DBD-mysql-3.0008.tar.gz
# cd DBD-mysql-3.0008
# export LANG=C
# perl Makefile.PL \
# --libs="-L/usr/local/mysql/lib/mysql -lmysqlclient -lz" \
# --cflags=-I/usr/local/mysql/include/mysql \
# --testhost=127.0.0.1 \
# --mysql_config=/usr/local/mysql/bin/mysql_config
# make
# make install
9.设置mysql自启动
# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
# chmod 755 /etc/init.d/mysql
# cd /etc/rc3.d
# ln -s /etc/init.d/mysql S85mysql
# ln -s /etc/init.d/mysql K85mysql
# cd /etc/rc5.d
# ln -s /etc/init.d/mysql S85mysql
# ln -s /etc/init.d/mysql K85mysql
10.安装Apache
# mkdir /www
# cd /usr/local/tarballs
# tar -zxvf httpd-2.2.14.tar.gz
# cd httpd-2.2.14
# ./configure --prefix=/www  --enable-so
# make
# make install
11.安装php
# cd ..
# mkdir /www/php
# tar -jxvf php-5.2.9.tar[1].bz2
# cd php-5.2.9
# ./configure \
# --prefix=/www/php \
# --with-apxs2=/www/bin/apxs \
# --with-libxml-dir=/usr/local/lib \
# --with-zlib \
# --with-zlib-dir=/usr/local/lib \
# --with-gd \
# --with-png-dir=/usr/local/tarballs/libpng-1.2.40 \
# --with-jpeg-dir=/usr/local/tarballs/jpeg-7 \
# --with-mysql=/usr/local/mysql \
# --with-mysqli=/usr/local/mysql/bin/mysql_config \
# --enable-mbstring \
# --enable-soap \
# --enable-sockets
# make
# make install
# cp php.ini-dist /www/php/php.ini
# gedit /usr/local/apache/conf/httpd.conf
加入AddType application/x-httpd-php .php
12.设置Apache自启动
# cp /www/bin/apachectl /etc/init.d/httpd
# cd /etc/rc3.d
# ln -s /etc/init.d/httpd S85httpd
# ln -s /etc/init.d/httpd K85httpd
# cd /etc/rc5.d
# ln -s /etc/init.d/httpd S85httpd
# ln -s /etc/init.d/httpd K85httpd
13.测试Apache和php
# /etc/init.d/httpd start
打开浏览器,输入
如出现it works,则Apache正常
在/www/htdocs下建立文件test.php
# gedit /www/htdocs/test.php
写入:
phpinfo();
?>
打开浏览器,输入test.php,出现php信息,则说明PHP成功
 
阅读(5956) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~