Linux平台配置snort+apache+php+mysql+acid环境

1.配置apache+php+MySQL环境
安装zlib1.1.3
tar -xzvf zlib-1.1.3.tar.tar
cd zlib-1.1.3
./configure; make test
make install
cd .
2.安装MySQL4.0.26
2.1创建mysql组和mysql用户 从系统安全性考虑,应避免以root或超级用户的身份运行Snort,需为Snort创建专用的用户和组
groupadd mysql
useradd -g mysql mysql
修改/root下的.bash_profile的这一行:
PATH=$PATH:$HOME/bin为
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
2.2安装mysql
tar -xzvf mysql-4.0.26.tar.tar
cd mysql-4.0.26
./configure --prefix=/usr/local/mysql
make
make install
cd scripts
./mysql_install_db
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql
cp ../support-files/my-medium.cnf /etc/my.cnf
向/etc/my.cnf中加入一行:
user = mysql (in the [mysqld] section)
向/etc/ld.so.conf中加入两行:
/usr/local/mysql/lib/mysql
/usr/local/lib
载入库,执行
ldconfig -v
2.3测试mysql是否工作
cd /usr/local/mysql/bin/
./mysqld_safe --user=mysql&
ps -ef |grep mysql
看mysql_safe是否工作
2.4设置mysql为自启动
将mysql安装目录下的support-files目录中的
mysql.server文件拷到/etc/init.d目录
cp 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
3.安装Apache2.2.3和PHP4.4.6
tar -xvzf httpd-2.2.3.tar.gz
cd httpd-2.2.3
./configure --prefix=/usr/local/www --enable-so
注:apache根目录为 /usr/local//www
make
make install
安装libpng
tar xzvf libpng-1.2.12.tar.gz
cd libpng-1.2.12
cp scripts/makefile.std makefile长度
make test
make install
cd ..
tar -zxvf php-4.4.6.tar.gz
cd php-4.4.6
./configure --prefix=/usr/local/www/php
--with-apxs2=/usr/local/www/bin/apxs
--with-config-file-path=/usr/local/www/php
--enable-sockets
--with-mysql=/usr/local/mysql
--with-zlib-dir=/usr/local
--with-gd
注意:这些为一行,中间不要有回车
make
make install
cp php.ini-dist /www/php/php.ini
编辑httpd.conf(/www/conf)
加入两行
LoadModule php4_module modules/libphp4.so (The new version of PHP adds it for you)
AddType application/x-httpd-php .php (hit ctrl-w and search for AddType)
DirectoryIndex index.php index.html index.html.var (Search for DirectoryIndex)
httpd.conf中相关内容如下:
# Example:
# LoadModule foo_module modules/mod_foo.so
LoadModule php4_module        modules/libphp4.so
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.php index.html.var
</IfModule>
#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
设置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
测试一下 PHP
cd /etc/init.d
./httpd start
在/www/htdocs下建立文件 test.php
cd /www/htdocs
vi test.php
加入
<?php phpinfo(); ?>
用4.安装 libpcap-0.9.4
tar -zxvf libpcap-0.9.4.tar.gz
cd libpcap-0.9.4
./configure --prefix=/usr/local/snort/libpcap
make
make install

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wyjyzf.html