2008年3月11日,php
1、了解所需软件下载并建立软件安装目录(个人习惯方便管理)
#mkdir -p /data/soft/apache20
#mkdir /data/soft/mysql50
#mkdir /data/soft/php5
#mkdir /data/soft/proftpd
#mkdir /data/www
#mkdir /data/dba
2、安装apache
#tar jxvf httpd-2.0.59.tar.bz2
#cd httpd-2.0.59
#./configure --prefix=/data/soft/apache20 --enable-so
#make ; make install
3、安装mysql
#pw groupadd mysql -g 500
#pw useradd -n mysql -u 500 -g mysql -d /data/soft/mysql50 -m -s /sbin/nologin
#tar zxvf mysql-5.0.37.tar.gz
#cd mysql-5.0.37
#./configure --prefix=/data/soft/mysql50 --with-charset=gbk
#make ; make install
#cp support-files/my-medium.cnf /etc/my.cnf
#./scripts/mysql_install_db --user=mysql
# chown -R root /data/soft/mysql50
# chown -R root /data/soft/mysql50/bin
# chown -R root /data/soft/mysql50/var
# chown -R root /data/soft/mysql50/var/mysql
# chown -R root /data/soft/mysql50/var/mysql/*
# chgrp -R mysql /data/soft/mysql50
# chgrp -R mysql /data/soft/mysql50/bin
# chgrp -R mysql /data/soft/mysql50/var
# chgrp -R mysql /data/soft/mysql50/var/mysql
# chgrp -R mysql /data/soft/mysql50/var/mysql/*
# chmod 777 /data/soft/mysql50/var
# chmod 777 /data/soft/mysql50/var/mysql
# chmod 777 /data/soft/mysql50/var/mysql/*
#/data/soft/mysql50/bin/mysqld_safe --user=mysql &
#/data/soft/mysql50/bin/mysqladmin -u root password 'new-password'
#mkdir -p /data/soft/apache20
#mkdir /data/soft/mysql50
#mkdir /data/soft/php5
#mkdir /data/soft/proftpd
#mkdir /data/www
#mkdir /data/dba
2、安装apache
#tar jxvf httpd-2.0.59.tar.bz2
#cd httpd-2.0.59
#./configure --prefix=/data/soft/apache20 --enable-so
#make ; make install
3、安装mysql
#pw groupadd mysql -g 500
#pw useradd -n mysql -u 500 -g mysql -d /data/soft/mysql50 -m -s /sbin/nologin
#tar zxvf mysql-5.0.37.tar.gz
#cd mysql-5.0.37
#./configure --prefix=/data/soft/mysql50 --with-charset=gbk
#make ; make install
#cp support-files/my-medium.cnf /etc/my.cnf
#./scripts/mysql_install_db --user=mysql
# chown -R root /data/soft/mysql50
# chown -R root /data/soft/mysql50/bin
# chown -R root /data/soft/mysql50/var
# chown -R root /data/soft/mysql50/var/mysql
# chown -R root /data/soft/mysql50/var/mysql/*
# chgrp -R mysql /data/soft/mysql50
# chgrp -R mysql /data/soft/mysql50/bin
# chgrp -R mysql /data/soft/mysql50/var
# chgrp -R mysql /data/soft/mysql50/var/mysql
# chgrp -R mysql /data/soft/mysql50/var/mysql/*
# chmod 777 /data/soft/mysql50/var
# chmod 777 /data/soft/mysql50/var/mysql
# chmod 777 /data/soft/mysql50/var/mysql/*
#/data/soft/mysql50/bin/mysqld_safe --user=mysql &
#/data/soft/mysql50/bin/mysqladmin -u root password 'new-password'
2008年2月22日,php
要使apache服务器做对同一IP地址的连接限制,需要mod_limitipconn来实现。一般需要手动编译。不过模块作者也提供了一些编译好的模块,根据自己的apache版本可以直接使用。
1。编译方式:
tar zxvf mod_limitipconn-0.XX.tar.gz
cd mod_limitipconn-0.XX
make apxs=/usr/local/apache/bin/apxs -----这里要按你自己的路径设置
make install apxs=/usr/local/apache/bin/apxs -----这里要按你自己的路径设置
2.rpm安装方式:
直接下载mod_limitipconn-0.xx.rpm
rpm -Uhv mod_limitipconn-0.xx.rpm
然后确认产生的mod_limitipconn.so文件在apache服务器模块目录里。
3。编辑httpd.conf文件:
ExtendedStatus On
LoadModule limitipconn_module modules/mod_limitipconn.so < IfModule mod_limitipconn.c >
< Location / > # 所有虚拟主机的/目录
MaxConnPerIP 3 # 每IP只允许3个并发连接
NoIPLimit image/* # 对图片不做IP限制
< /Location>
< Location /mp3 > # 所有主机的/mp3目录
MaxConnPerIP 1 # 每IP只允许一个连接请求
OnlyIPLimit audio/mpeg video # 该限制只对视频和音频格式的文件
< /Location >
< /IfModule>
>>>>>>
1。编译方式:
tar zxvf mod_limitipconn-0.XX.tar.gz
cd mod_limitipconn-0.XX
make apxs=/usr/local/apache/bin/apxs -----这里要按你自己的路径设置
make install apxs=/usr/local/apache/bin/apxs -----这里要按你自己的路径设置
2.rpm安装方式:
直接下载mod_limitipconn-0.xx.rpm
rpm -Uhv mod_limitipconn-0.xx.rpm
然后确认产生的mod_limitipconn.so文件在apache服务器模块目录里。
3。编辑httpd.conf文件:
ExtendedStatus On
LoadModule limitipconn_module modules/mod_limitipconn.so < IfModule mod_limitipconn.c >
< Location / > # 所有虚拟主机的/目录
MaxConnPerIP 3 # 每IP只允许3个并发连接
NoIPLimit image/* # 对图片不做IP限制
< /Location>
< Location /mp3 > # 所有主机的/mp3目录
MaxConnPerIP 1 # 每IP只允许一个连接请求
OnlyIPLimit audio/mpeg video # 该限制只对视频和音频格式的文件
< /Location >
< /IfModule>
>>>>>>
2008年2月8日,php
mod_limitipconn.c 是一个非官方的apache模块,可以用来作为WEB 文件的下载限制,但是它是使用ExtendedStatus On 形式,工作在应用层。当同一个IP的连接到达限制的时候,apache对get 请求发送:
HTTP/1.1 503 Service Temporarily Unavailable
从而使用户不能下载,但并不能阻止这种攻击,仍旧允许连接的。不过这个东东对
网管来说还是很有用的,特别是下载站的网管。简单介绍一下安装(动态模块方式
HTTP/1.1 503 Service Temporarily Unavailable
从而使用户不能下载,但并不能阻止这种攻击,仍旧允许连接的。不过这个东东对
网管来说还是很有用的,特别是下载站的网管。简单介绍一下安装(动态模块方式
2008年2月7日,php
好久没有收集apache的文章了。今天在冰剑博客看到这篇,觉得不错。
<?php
$user = ""; //数据库用户名
$password = "";//数据库密码
$db_name = "i";//数据库名
$link = mysql_connect("localhost:3306",$user,$password);
mysql_select_db("$db_name",$link);
echo "<p>正在清空数据库,请稍等....<br>";
$result=mysql_query("SHOW tables",$link);
while ($currow=mysql_fetch_array($result)) {
mysql_query("drop TABLE IF EXISTS $currow[0]");
echo $currow[0]."<br>";
}
echo "<br>恭喜你清理MYSQL成功<br>";
?>
$user = ""; //数据库用户名
$password = "";//数据库密码
$db_name = "i";//数据库名
$link = mysql_connect("localhost:3306",$user,$password);
mysql_select_db("$db_name",$link);
echo "<p>正在清空数据库,请稍等....<br>";
$result=mysql_query("SHOW tables",$link);
while ($currow=mysql_fetch_array($result)) {
mysql_query("drop TABLE IF EXISTS $currow[0]");
echo $currow[0]."<br>";
}
echo "<br>恭喜你清理MYSQL成功<br>";
?>
2007年12月31日,php
vi http.conf
ErrorLog logs/error.log
#
# LogLevel: Control the number of messages logged to the error.log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access.log common
在前面加“#”号应该就可以了。
ErrorLog logs/error.log
#
# LogLevel: Control the number of messages logged to the error.log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access.log common
在前面加“#”号应该就可以了。




