[非原創]MySQL的php備份語法

來源:  http://davidwalsh.name/backup-mysql-database-php

 

backup_tables('localhost','username','password','blog');

/* backup the db OR just a table */
function backup_tables($host,$user,$pass,$name,$tables = '*')
{

	$link = mysql_connect($host,$user,$pass);
	mysql_select_db($name,$link);

	//get all of the tables
	if($tables == '*')
	{
		$tables = array();
		$result = mysql_query('SHOW TABLES');
		while($row = mysql_fetch_row($result))
		{
			$tables[] = $row[0];
		}
	}
	else
	{
		$tables = is_array($tables) ? $tables : explode(',',$tables);
	}

	//cycle through
	foreach($tables as $table)
	{
		$result = mysql_query('SELECT * FROM '.$table);
		$num_fields = mysql_num_fields($result);

		$return.= 'DROP TABLE '.$table.';';
		$row2 = mysql_fetch_row(mysql_query('SHOW CREATE TABLE '.$table));
		$return.= "\n\n".$row2[1].";\n\n";

		for ($i = 0; $i < $num_fields; $i++) 
		{
			while($row = mysql_fetch_row($result))
			{
				$return.= 'INSERT INTO '.$table.' VALUES(';
				for($j=0; $j<$num_fields; $j++) 
				{
					$row[$j] = addslashes($row[$j]);
					$row[$j] = ereg_replace("\n","\\n",$row[$j]);
					if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }
					if ($j<($num_fields-1)) { $return.= ','; }
				}
				$return.= ");\n";
			}
		}
		$return.="\n\n\n";
	}

	//save file
	$handle = fopen('db-backup-'.time().'-'.(md5(implode(',',$tables))).'.sql','w+');
	fwrite($handle,$return);
	fclose($handle);
}

[非原創]XP VISTA下的管理網路密碼 WIN7 在哪設呢?

http://social.technet.microsoft.com/Forums/zh-TW/0830dc3d-274b-4af8-8e1e-98328003edcb/xp-vista-win7-?forum=windows7cht

 

從Windows 7 開始,已經被另外整合到 [認證管理員] 裡了。
在[開始] -> [控制台] -> [使用者帳戶和家庭安全] -> [認證管理員]。

過去在XP/Vista可執行的指令「control userpasswords2」,
其實仍然可以使用,只是變成要在 [命令提示字元] 裡執行,
但最後管理網路密碼的視窗頁面,
同樣是呼叫 [認證管理員] 。

debian rsyncd 安裝

參考資料

http://www.linuxawy.org/node/12

rsync is a great tool for synchronizing 2 directories (or files) either one of them is remote and the other is local, or 2 local folders (it doesn’t support synchronizing 2 remote servers, yet). the power of rsync comes from that it doesn’t transfer anything unless it detects that it’s changes since last run. moreover, it transfer the changes in files only (unless you specified otherwise), and it can even compress files before sending which makes it ideal for continuous backups and mirroring.

to use rsync, you have 2 options. either to start rsync daemon which handles the connections, or use it through ssh tunnel. each way has its positives and negatives. rsync daemon is indeed faster in intiating connections cause it doesn’t exchange keys or encrypt data, which makes its load on the server is less too. the overhead of keeping the daemon alive is so small that you can simply ignore. the ssh tunnel doesn’t require a special configuration on the server side, but you must have ssh access to the server, which means that you can’t grant anonymouse access to your data. the main positive of ssh tunnel is that data is sent through the secure tunnel and can’t be sniffed.

  1. to connect through ssh tunnel: first, you’ll need to install rsync:
    apt-get install rsync
    then you are ready, just issue the command directly
    rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/
    remember to check the permissions for ssh user on the remote server. (the remote server must have rsync installed too).
  2. to connect through rsync server:
    1. install rsync:
      apt-get install rsync
    2. create “/etc/rsyncd.conf” and put the following in it:
      max connections = 1
      log file = /var/log/rsync.log
      timeout = 300
      [cache]
      comment = Cache of Mongrels
      path = /usr/local/cache
      read only = no
      list = yes
      uid = nobody
      gid = nogroup
      #auth users = mongrel
      list = yes
      hosts allow = 127.0.0.0/8 192.168.0.0/24
      #secrets file = /etc/rsyncd.secrets

      note that the first few lines are global (for all modules) and the other one is specital for the public module.
      comment the last two lines to grant anonymouse access, note that you can still limit by ip/netmask

    3. create ”/etc/rsyncd.secret”, and put the usernames and passwords for the ones who can access rsync, in the form of username:password , note that passwords are saved here as clear text. so don’t forget to chmod it to 400 to keep the passwords somehow safe
    4. make rsync to start as daemon:
      edit ”/etc/inetd.conf” and put the following line in the end:
      rsync stream tcp nowait root /usr/bin/rsync rsync –daemon
    5. voila, you are done, test your settings by typing:
      rsync rsync://your_ip_or_domain_name/
      this should list the modules
      rsync rsync://your_ip_or_domain_name/public
      this shuold list the files in your ‘public’ modules
      rsync -avz rsync://your_ip_or_domain_name/public
      synchronozing should start the transfer now.
      don’t forget to check the rsync man page to check what flags do you really need.

XenServer – 新增儲存裝置 – 硬碟

1、在安裝好設備後,開機執行 fdisk -l 應該可以看到目前的狀況
# fdisk -l
Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 523 4194304 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 523 1045 4194304 83 Linux
/dev/sda3 1045 243201 1945123393 8e Linux LVM

Disk /dev/sdb: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

2、先建立分割 /dev/sdb,在分割後重新開機
# fdisk /dev/sdb
/dev/sdb1 1 121578 976567252+ 8e Linux LVM

3、建立 PV
pvcreate /dev/sdb1

4、查詢目前 VG 資訊並將 /dev/sdb1加入
# vgscan
Reading all physical volumes. This may take a while…
Found volume group “VG_XenStorage-f528bb39-bdf3-53a2-2a1a-553bb21e886e” using metadata type lvm2

#vgextend VG_XenStorage-f528bb39-bdf3-53a2-2a1a-553bb21e886e /dev/sdb1

5、最後重新開機後就可以在 XenCenter 的 Storage 應該可以看到硬體空間有變動

PS:如果不想加入既有的 VG ,則可以另外建立一個 Storage,如下
1、分割磁碟
# fdisk /dev/sdb
/dev/sdb2 1 121578 976567252+ 8e Linux LVM

2、查詢UUID
ls -l /dev/disk/by-path

3、掛載分割區到系統
#xe sr-create type=lvm content-type=user device-config:device=/dev/disk/by-path/pci-0000:00:1f.2-scsi-1:0:1:0-part3 name-label=”Disk 2″
92a4c7b7-56f5-d598-fa5e-cb1ecaa9c6ef

PS:最後到 XenCentor 的 storage 就可以看到分割區已經掛載

squid利用delay_pools來限制上網速度

其實squid是可以限制速度的

可用delay_pool參數

詳細可參考官方資料 http://wiki.squid-cache.org/Features/DelayPools

Feature: Delay Pools

  • Goal: To provide a way to limit the bandwidth of certain requests based on any list of criteria.
  • Status: Completed
  • Version: 2.2+
  • Developer: David Luyer

 

 

Delay Pools

by David Luyer.

To enable delay pools features in Squid configure with –enable-delay-pools before compilation.

 

Terminology for this FAQ entry:

pool
a collection of bucket groups as appropriate to a given class
bucket group
a group of buckets within a pool, such as the per-host bucket group, the per-network bucket group or the aggregate bucket group (the aggregate bucket group is actually a single bucket)
bucket
an individual delay bucket represents a traffic allocation which is replenished at a given rate (up to a given limit) and causes traffic to be delayed when empty
class
the class of a delay pool determines how the delay is applied, ie, whether the different client IPs are treated separately or as a group (or both)
class 1
a class 1 delay pool contains a single unified bucket which is used for all requests from hosts subject to the pool
class 2
a class 2 delay pool contains one unified bucket and 255 buckets, one for each host on an 8-bit network (IPv4 class C)
class 3
contains 255 buckets for the subnets in a 16-bit network, and individual buckets for every host on these networks (IPv4 class B )
class 4
as class 3 but in addition have per authenticated user buckets, one per user.
class 5
custom class based on tag values returned by external_acl_type helpers in http_access. One bucket per used tag value.

Delay pools allows you to limit traffic for clients or client groups, with various features:

  • can specify peer hosts which aren’t affected by delay pools, ie, local peering or other ‘free’ traffic (with theno-delay peer option).
  • delay behavior is selected by ACLs (low and high priority traffic, staff vs students or student vs authenticated student or so on).
  • each group of users has a number of buckets, a bucket has an amount coming into it in a second and a maximum amount it can grow to; when it reaches zero, objects reads are deferred until one of the object’s clients has some traffic allowance.
  • any number of pools can be configured with a given class and any set of limits within the pools can be disabled, for example you might only want to use the aggregate and per-host bucket groups of class 3, not the per-network one.

This allows options such as creating a number of class 1 delay pools and allowing a certain amount of bandwidth to given object types (by using URL regular expressions or similar), and many other uses I’m sure I haven’t even though of beyond the original fair balancing of a relatively small traffic allocation across a large number of users.

 

There are some limitations of delay pools:

  • delay pools are incompatible with slow aborts; quick abort should be set fairly low to prevent objects being retrieved at full speed once there are no clients requesting them (as the traffic allocation is based on the current clients, and when there are no clients attached to the object there is no way to determine the traffic allocation).
  • delay pools only limits the actual data transferred and is not inclusive of overheads such as TCP overheads, ICP, DNS, ICMP pings, etc.
  • it is possible for one connection or a small number of connections to take all the bandwidth from a given bucket and the other connections to be starved completely, which can be a major problem if there are a number of large objects being transferred and the parameters are set in a way that a few large objects will cause all clients to be starved (potentially fixed by a currently experimental patch).
  • in Squid 3.1 the class-based pools do not work yet with IPv6 addressed clients.
  • In squid older than 3.1 the delay pool bucket is limited to 32-bits and thus has a rather low MB cap on both bucket content and refill rate. The bucket size is now raised to 64-bit ‘unlimited’ values, but refill rate remains low.

 

How can I limit Squid’s total bandwidth to, say, 512 Kbps?

 

delay_pools 1
delay_class 1 1
delay_access 1 allow all
delay_parameters 1 64000/64000          # 512 kbits == 64 kbytes per second

The 1 second buffer (max = restore = 64kbytes/sec) is because a limit is requested, and no responsiveness to a burst is requested. If you want it to be able to respond to a burst, increase the aggregate_max to a larger value, and traffic bursts will be handled. It is recommended that the maximum is at least twice the restore value – if there is only a single object being downloaded, sometimes the download rate will fall below the requested throughput as the bucket is not empty when it comes to be replenished.

 

How to limit a single connection to 128 Kbps?

You can not limit a single HTTP request’s connection speed. You can limit individual hosts to some bandwidth rate. To limit a specific host, define an acl for that host and use the example above. To limit a group of hosts, then you must use a delay pool of class 2 or 3. For example:

 

acl only128kusers src 192.168.1.0/24
delay_pools 1
delay_class 1 3
delay_access 1 allow only128kusers
delay_access 1 deny all
delay_parameters 1 64000/64000 -1/-1 16000/64000

For an explanation of these tags please see the configuration file.

The above gives a solution where a cache is given a total of 512kbits to operate in, and each IP address gets only 128kbits out of that pool.

 

How do you personally use delay pools?

We have six local cache peers, all with the options ‘proxy-only no-delay’ since they are fast machines connected via a fast ethernet and microwave (ATM) network.

For our local access we use a dstdomain ACL, and for delay pool exceptions we use a dst ACL as well since the delay pool ACL processing is done using “fast lookups”, which means (among other things) it won’t wait for a DNS lookup if it would need one.

Our proxy has two virtual interfaces, one which requires student authentication to connect from machines where a department is not paying for traffic, and one which uses delay pools. Also, users of the main Unix system are allowed to choose slow or fast traffic, but must pay for any traffic they do using the fast cache. Ident lookups are disabled for accesses through the slow cache since they aren’t needed. Slow accesses are delayed using a class 3 delay pool to give fairness between departments as well as between users. We recognize users of Lynx on the main host are grouped together in one delay bucket but they are mostly viewing text pages anyway, so this isn’t considered a serious problem. If it was we could take those hosts into a class 1 delay pool and give it a larger allocation.

I prefer using a slow restore rate and a large maximum rate to give preference to people who are looking at web pages as their individual bucket fills while they are reading, and those downloading large objects are disadvantaged. This depends on which clients you believe are more important. Also, one individual 8 bit network (a residential college) have paid extra to get more bandwidth.

The relevant parts of my configuration file are (IP addresses, etc, all changed):

 

# ACL definitions
# Local network definitions, domains a.net, b.net
acl LOCAL-NET dstdomain a.net b.net
# Local network; nets 64 - 127.  Also nearby network class A, 10.
acl LOCAL-IP dst 192.168.64.0/18 10.0.0.0/8
# Virtual i/f used for slow access
acl virtual_slowcache myip 192.168.100.13
# All permitted slow access, nets 96 - 127
acl slownets src 192.168.96.0/19
# Special 'fast' slow access, net 123
acl fast_slow src 192.168.123.0/24
# User hosts
acl my_user_hosts src 192.168.100.2/31
# Don't need ident lookups for billing on (free) slow cache
ident_lookup_access allow my_user_hosts !virtual_slowcache
ident_lookup_access deny all
# Security access checks
http_access [...]
# These people get in for slow cache access
http_access allow virtual_slowcache slownets
http_access deny virtual_slowcache
# Access checks for main cache
http_access [...]
# Delay definitions (read config file for clarification)
delay_pools 2
delay_initial_bucket_level 50
delay_class 1 3
delay_access 1 allow virtual_slowcache !LOCAL-NET !LOCAL-IP !fast_slow
delay_access 1 deny all
delay_parameters 1 8192/131072 1024/65536 256/32768
delay_class 2 2
delay_access 2 allow virtual_slowcache !LOCAL-NET !LOCAL-IP fast_slow
delay_access 2 deny all
delay_parameters 2 2048/65536 512/32768

The same code is also used by a some of departments using class 2 delay pools to give them more flexibility in giving different performance to different labs or students.

 

Where else can I find out about delay pools?

This is also pretty well documented in the configuration file, with examples. Squid install with a squid.conf.documented or squid.conf.default file. If you no longer have a documented config file the latest version is provided on the squid-cache.org website.

 


 

[轉帖] 接案的攻防 ~ 不輕易報價

來源 http://www.programmer-club.com/showsametitlen/caseexp/1590.html

2006/2/16 下午 09:38:50

我不是什麼高手, 只是在此分享一些報價的心得…

這年頭, 什麼都能騙, 怎麼都不奇怪. 想接案, 撇開專業技術, 首先要學會報價. 我承認, 為了學會報價, 我著實吃了不少苦頭, 白費許多心力, 但慘痛的經驗終究還是值得的。

狀況一 :
當客戶說 「我們SA/SD已經 90% ,就剩下 Coding , 因為人手不夠, 所以要外包」,「如果是由我們的工程師來做,2W就能完成」

我回想以前接過的客戶電話, 應該有 50%都是類似的說法。這種客戶, 不用報價,理由是:

1) 客戶一開始擺明就是要廉價
2) 客戶自己做2W就能完成, 真是太簡單了, 把人手擠出來, schedue協調一下, 給工程師專心做2W就能解決, 何必外包. 會講 2W , 只是想表示難度不高, 可短期間完成, 應該很便宜。
3) 客戶說 SA/SD已經 90%, 那麼 10%呢? 這意味 “Change” 的風險很高. 光這一點, 講2W完成就有些自相矛盾。

其實這種客戶, 別說是報價, 最好是列入灰名單, 別一廂情願以為合作會有好結果。等對方下次提出一個 “合理” 的狀況再說。

狀況二:
「我們有一個案子, 是做銀行的XX系統, 如有興趣, 來我們公司詳談」

兩年前的我, 只要時間能安排, 一定去拜訪。 每次去談, 對方都會想要我當場報價, 有的還會問我要如何做, 該考量哪些問題… 回公司後, 我還會用心的寫一份簡式的計劃書 + 報價(初估) , 然後就沒下文。Run了 5 ,6次後, 我才發覺不對。

客戶不用花半毛錢, 就能得到 計劃書 + 報價 , 甚至是免費的諮詢, 但不等於給我承作。沒錯, 客戶可以有選擇權, 但我為何卻要選擇先”投資”呢? 值得嗎? 我相信見人見智, 但我選擇應該要學會用最經濟的手段得到80分的效益。至少, 隨隨便便就出門, 利潤也就隨隨便便的流失。

後來我學會在電話中先作過濾, 例如:

1) 先問預算
這是很基本的, 想外包, 怎可能會沒預算? 尤其, 客戶說 Unlimit, 或就是不肯說的, 我認為十之八九都
有鬼。雖然站在客戶立場, 一開始就講出預算, 好像就露了底牌。 但經驗告訴我, 真正想發案的客戶,
其實都會講預算, 除非是我沒主動問。

2) 問希望的時程
基本上, 只要是那種擺明就是要廠商 “趕工” 的case, 最好不要接.

3) 確定這是個 “賺錢”的系統
我說的 “賺錢”不是指接案者能賺多少錢, 而是承作的這套系統是否真正為客戶賺錢。若客戶其實是
統包, 一開始就擺明他們也是賠錢, 沒賺多少, 那麼不要猶豫, 不要理他。如果客戶就是系統的End
User, 簡單的套出該系統可能供獻給客戶的效益, 通常這種案子的成交價會容易皆大歡喜。

4) 確認客戶的 “動機”
有的客戶其實是有工程師, 甚至是一整個team, 卻又為何要發包? 不要懷疑, 尤其客戶本身也是在
承作IT系統專案開發的, 這類客戶的發包動機有些其實很不單純。騙報價, 騙計劃書, 騙技術… 有的
甚至是硬ㄠ不給錢!!

 


 

2006/2/17 下午 04:49:11

寫的真好!!

我也有小心得分享..

要接案前, 要先有不接的準備. 有這樣子的心態, 在談判時, 較不會落入求客戶給我工作的情勢. 只有不落入這種情勢, 才能有主導權.

不要接賺錢辛苦的公司及公司規模太小的案子. 接這些公司的案子, 總價低, 收錢難度高. 最重要的是: 他們沒辦法介紹後續的工作給你…

另外, 不要太積極的去追你認為有機會的客戶… 接case跟賣產品不太一樣. 產品是賣愈多愈好. 接case同時只能接一個, 要接就要接好case. 如果客戶跟你連絡後, 突然沒有下文… 千萬不要打電話去問. 因為問了後會形成以下後果: 1. 你在求他給你case.. 2. 價格很難開的好. 3. 通常還是接不到. 如果, 你真的是他們的最佳人選, 他們會回來找你的. 如果不是, 何苦強求自己呢?

大眾需求的軟體(ex: 會計, 進銷存), 千萬不要接, 而且要鼓勵客戶去買其他人做的產品. 因為你接了後, 1. 價格面客戶不會滿意的. 2. 品質面, 要如何跟現成開發了好幾年的產品拚呢?

最後, SOHO要能永續經營, 必需要走高價位… 2年接1案就可活的價位才是合理價位. 1. 只有這種價位, 你才能提供好的服務給客戶. 2. 這種價位會跟一般公司開的價格差不多. 沒有比較貴, 但省下的公司營運成本, 我們能提供更好的品質與服務. 3. 不要去做耳熟能詳的東西…

 


2006/2/17 下午 05:16:45

Cancer說的沒錯, 這就是「騙報價」的動機。所以, 我通常採取狀況二的攻防手段, 明快判斷客戶的動機為何。

接下來繼續..
狀況三.
「我們有個專案想委外, 有需求文件可以先寄給你參考, 看完後請報價….」

鮮少有客戶會主動給需求文件給接案者做為報價的參考, 但別太高興, 根據我的經驗, 這種case有 80%是轉包的, 這種客戶講好聽是統包商, 講難聽就是蟑螂。當我接到客戶的電話
一定養成習慣的問清楚

“對方公司寶號” 及 “請問您貴姓, 聯絡電話”

等收到文件, 會做下列處置:

1) 從文件找線索, 找出來源.
如果是Word/Excel, 我開啟檔案第一件事就是看 「摘要資訊」。Why? 因為就是
有這種電腦白癡, 以為把End-user給的RFP內文的”關鍵詞”去頭去尾加Replace就
神不知鬼不覺! 其實, 我看過多數會認真寫RFP的End-user, 均會習慣把專案名稱,
公司, 作者等訊息填在「摘要資訊」。另外, 如果是 Word檔, 還可以check 「追蹤
修訂」, 看看白癡蟑螂會不會笨到忘記這個 “Friendly”的功能可能給自己洩了底.
如果很幸運地, 被我找到關鍵詞, 例如: 專案名, 公司, 作者等.. 我會利用Google
用力搜。

2) 善用官方資源, 查客戶的底細
下列官方網址相當不錯用

http://210.69.121.50/~doc/ce/cesc1110.html

我會查看客戶公司的 資本額, 成立多久的公司, 負責人, 股東成員。有時候, 我在
接聽客戶電話的同時, 就會進這官網 “同步” 查詢該客戶公司。此外, 也同樣會利用
Google, 用公司名稱搜尋, 用負責人名稱搜尋, 用股東成員名稱搜尋… 為何我要這
麼 “仔細”查? 理由如下:

a. 商場爾虞我詐
b. 評估客戶的 “財力” , 這對報價是很有助力
c. 可以防範若干已經是家喻戶曉的ㄠ客
d. 嚇嚇客戶, 讓他知道, 我是有做過 “功課” , dont play me!
e. 曾經就有個白癡蟑螂, 被我透過前述的方法, 得知其實是政府某單位的IT系統的
標案, 而且有預算, 還沒結標. 呵呵, 該標案預算是 2佰多, 該蟑螂竟然說他預算
約 1 佰多, 而且還要我給計劃書. 這就是「騙計劃書」的動機之一 ! 最後, 我告訴
他, 我們公司可以替客戶寫投標書, 但最便宜的一份也要 NTD 10萬. 對方就謝謝
再聯絡。

3) 仔細看文件內容, 有幾個項目必須特別注意 ,這是一般技術腦袋的接案者最常忽略
的:
a. 是”承攬” 還是 “委託” , 這攸關 “系統責任” 問題
b. 文件的解釋權? 有些甲方很ㄠ, 會特別寫解釋權在甲方, 就是他怎樣說就是怎樣
c. 著作權界定
d. 如果保固維護, server level
e. 有無罰責, 押金
f. 如何payment?
g. 如何驗收?
h. 有無競業禁止條款

其實還有好多, 我只是挑出我認為 “技術人” 最常乎略的環節.

4) expert judgment
平常就要廣結良緣, 這時候就挺有幫助的, 可以藉此打聽專案. 這業界真的很小, 有些
時候隨便打聽, 正好是該案的RFP作者是我同學, 已經綁標了, 呵呵

最後最後, 當然還是要給客戶一個答覆, 這時候, 仍然不能報價, 因為, 還是不能 “肯定” 對方
是玩真的還是玩假的. 我喜歡把這過程形容像是在釣魚, 釣魚是要有耐心的. 對魚要有耐心,
對湖水要有耐心, 對氣候環境要有耐心…

 

httpd.conf 設定檔參考

httpd.conf 檔的設定

I. 全域環境變數設定

ServerType

語法:ServerType <(inetd)/(standalone)>
預設:ServerType standalone

ServerType 用來指定系統該以何種型態去啟動伺服器。型態可以是其中之一:

* inetd:伺服器將由系統程序 inetd 執行;啟動伺服器使用的命令加在 /etc/inetd.conf 檔案裡。
* standalone:伺服器將會以伺服程式〈daemon〉方式來執行;啟動伺服器使用的命令加在系統啟動指令稿裡〈/etc/rc.d/rc.local 或 /etc/rc.d/init.d/httpd 裡〉。

inetd 在這兩個選項裡比較少使用。因為接收到每個 http 連線就要重頭開始執行另一份新的伺服器程式拷貝;連線結束後,這支程式就會結束,所以每次連線要付出的代價很高,相對的使用者等待時間會加長。但是因為安全上的理由,某些管理者喜歡這個選項。
standalone 是 ServerType 最普遍的設定,因為它是最有效率的執行方式。伺服器程式只啟動一次,而且服務所有的連線。如果我們想要利用 Apache Server 來服務一個忙碌的站臺,standalone 大概將會是唯一的選擇。

例:

ServerType standalone

-> 指定 apache 以 daemon 方式來執行

ServerRoot

語法:ServerRoot <目錄名稱>
預設:ServerRoot “/usr/local/apache”

ServerRoot 用於設定 Apache Server 所安裝的絕對路徑,所有網站相關的襠案都存放在此目錄中。其它配置檔的相對路徑是相對於這個路徑。

例:

ServerRoot “/usr/local/apache”

-> 指定 apache server 安裝的根目錄為 /usr/local/apache 目錄

PidFile

語法:PidFile <檔案名稱>
預設:PidFile /usr/local/apache/logs/httpd.pid

PidFile 用來設定伺服器記錄它的程式之程序號碼所使用的檔案。這樣就不必用 ps 指令來尋找它的程序號碼。而 PidFile 的功能只能使用在 ServerType 為 standalone 的模式。
我們可以藉由傳送 SIGHUP〈kill -1〉信號到列在 PidFile 檔案裡的程序號碼來達成關閉或重新再打開錯誤記錄與傳輸記錄以及重新讀取配置檔等。

例:

PidFile /usr/local/apache/logs/httpd.pid

-> 指定 apache 執行時要存放記錄 PID 檔案的路徑與檔名

TimeOut

語法:TimeOut <數字>
預設:TimeOut 300

TimeOut 用來設定伺服器接收一個請求以及完成一個請求最長的等待時間〈以秒為單位〉,如果在此時間內沒有回應則終止服務。所以當接收或傳送一個資料時所花的時間超過 TimeOut 所規定的時間時,伺服器便將會中斷該連線。如果網路速度較慢,則此 Timeout 時間可以設長一些。

例:

TimeOut 500

-> 指定 apache 接收或傳送的等待時間

KeepAlive

語法:KeepAlive <(On/Off)>
預設:KeepAlive On

KeepAlive 用於設定伺服器要不要開啟連續請求的功能,On 是開啟,Off 是關閉。

例:

KeepAlive On

-> 指定 apache 開啟連續請求功能

MaxKeepAliveRequests

語法:MaxKeepAliveRequests <個數>
預設:MaxKeepAliveRequests 100

MaxKeepAliveRequests 用於設定伺服器所能接受之最大連續請求量,如果連續請求超過這個此數限制則 Server 會自動拒絕請求連線。若設定為 0 則表示不做限制。

例:

MaxKeepAliveRequests 0

-> 指定 apache 不限制所能接收之連線數量

KeepAliveTimeout

語法:KeepAliveTimeout <秒數>
預設:KeepAliveTimeout 15

KeepAliveTimeout 用於設定使用者 ‘連續’ 請求等待的時間上限,如果使用者連續請求的時間超過此數,則終止此請求服務。

例:

KeepAliveTimeou 15

-> 指定 apache 等待使用者連續請求的時間,在接到使用者請求開始,15 秒內若沒收到新請求訊息,即中斷該連線

MinSpareServers / MaxSpareServers

語法:MinSpareServers <數量> / MaxSpareServers <數量>
預設:MinSpareServers 5 / MaxSpareServers 10

MinSpareServers 用於設定最小閒置 (idle) 子伺服程序數量,而 MaxSpareServers 用於設定最大閒置 (idle) 子伺服程序數量。閒置子伺服程序是目前沒有處理要求的程序。如果有多於 MaxSpareServers 的子程序,那麼父程序會終止超過此數量的子程序。如果有小於 MinSpareServers 的子程序,那麼父程序會產生超過此數量的子程序。通常不會將 MaxSpareServers 設很大,只有在非常忙碌的站臺上才有調整這個選項的需要。

例:

MinSpareServers 5

-> 設定最少閒置等待服務的伺服程序數量為 5 個

MaxSpareServers 10

-> 設定最大閒置等待服務的伺服程序數量為 10 個

StartServers

語法:StartServers <數量>
預設:StartServers 5

StartServers 用於設定啟動時所要建立的子伺服程序數量。因為程序的數量是依據負載動態控制的,通常不需要調整這個參數。

例:

StartServers 5

-> 設定啟動 apache 時要建立 5 個伺服程序

MaxClients

語法:MaxClients <數量>
預設:MaxClients 150

MaxClients 用於設定同時能夠提供給使用者的最大服務請求數目。

例:

MaxClients 150

-> 設定 apache 在同一時間內最大能服務 150 個連線請求

II. Server 主要變數設定

Port

語法:Port <數字>
預設:Port 80

Port 設定伺服器用來監聽連線的網路埠號。參數<數字>是 0 到 65535 的一個數目;某些埠號(特別是低於 1024 的)是保留給特殊的協定。請參閱 /etc/services 裡定義的一些埠的列表,而標準的 http 協定則使用 80 埠號。Port 80 是 Unix 中的一個特別埠。所有低於 1024 的埠號都是保留給系統使用的,一般使用者 (non-root) 不能使用它們;取而代之的是他們可以使用較高的埠號。要使用 80 埠你必須以 root 帳號啟動伺服器。如果你不能使用 80 埠,選擇任何其它沒有使用到的埠。非 root 使用者必須選擇高於 1023 的埠號,像是 8000 。

例:

Port 8000

-> 設定 apache 的連線埠號為 8000

User

語法:User [username / #uid]
預設:User nobody

User 用來設定伺服器程式的執行者是誰。一般是 nobody,也可以是已註冊的使用者,若用 user id 則要先加上 # 號。這個執行者應該不能有存取外界所不能看到的檔案的權限,而且這個執行者應該不能執行對 httpd 要求而言沒有意義的程式碼。建議特別為執行這個伺服器設立新的使用者。

例:

User apache

-> 設定 apache 程式以 apache 使用者身份來執行

Group

語法:Group [groupname / #gid]
預設:Group nogroup

Group 用於設定 httpd 這程式的執行者所屬的群組,一般是 nogroup,此 group 必須要存在於 /etc/group 中。相同於 User 指令,這個群組應該不能有存取外界所不能看到的檔案的權限,而且應該不能執行對 httpd 要求而言沒有意義的程式碼。建議特別為執行這個伺服器設立新的群組。

例:

Group apache

-> 設定 apache 程式以 apache 群組的身份來執行

ServerAdmin

語法:ServerAdmin <電子郵件地址>
預設:ServerAdmin root@localhost

ServerAdmin 用於設定此站台管理者的電子郵件地址,當伺服器發生錯誤時,會傳送這些錯誤訊息給此電子郵件地址。

例:

ServerAdmin chanel@armani.com

-> 當 apache 發生錯誤時,會傳送這些訊息給 chanel@armani.com 這個 E-mail 的管理者

ServerName

語法:ServerName <主機名稱>

ServerName 用於設定該伺服器的名稱,此名稱必須是已經向伺服器本身所在網域的 DNS 註冊。若沒有一個登記的 DNS name,則改為 IP 位址。

例:

ServerName www.prada.com

-> 設定 apache 主機的名稱為 www.prada.com

DocumentRoot

語法:DocumentRoot <目錄名稱>
預設:DocumentRoot “/usr/local/apache/htdocs”

DocumentRoot 用於設定伺服器文件或其它資料所在的根目錄位置。伺服器會把連線請求的 URL 附加到根文件目錄 (document root) 來組合到達文件的路徑。

例:

DocumentRoot “/usr/local/apache/htdocs”

-> 指定文件的根目錄為 /usr/local/apache/htdocs 目錄,若使用者輸入 http://myserver/doc.html,最對映到系統中的 /usr/local/apache/htdocs/doc.html 檔。

Directory

語法:<Directory [目錄絕對路徑]> … </Directory>

Directory 指令區間內的參數是用於設定目錄的相關屬性或控制目錄的權限。使用方法需配合 Order 或 Options 指令。

Order

語法:Order [allow/deny/allow,deny]

Order 用於設定何人可以從這個 Server 取得控制目錄的權限。

例:

Oeder allow,deny
allow from nchc.gov.tw <– 所有來自 nchc.gov.tw 的 user 都可以取得控制權

Options

語法:Options <參數>

Options 指令配合 <Directory [目錄絕對路徑]> … </Directory> 來控制該目錄的屬性,
指令後面的 <參數> 表示可以開啟的屬性種類,所代表的值可以包括:

1. All:此目錄除 MultiViews 外,所有屬性都開啟。
2. MultiViews:允許 MultiViews 內容。
3. Indexes:若該目錄被以 http 的方式讀取,而該目錄中並不存在 index.htm 或 index.html 等索引檔,則會自動將該目錄的檔案資訊轉化成為 HTML 格式傳回給瀏覽器。
4. IncludesNOEXEC:開放 SSI (Server-side include) 的權限,但是會關閉 CGI 程式中 #exec 與 #include 的宣告。
5. Includes:開放 SSI 的權限。
6. FollowSymLinks:准許以符號連結到其他目錄。
7. ExecCGI:允許執行 CGI 程式。
8. SymLinksfOwnerMath:允許符號連結到的目錄與原始目錄的所有人不同。

例:

<Directory /> <– 設定為根目錄
Options FollowSymLinks <– 此目錄允許透過 symbolic links 存取
AllowOverride None <– 此目錄的權限不受.htaccess 檔影響
</Directory>

<Directory “/usr/local/apache/htdocs”>
Options Indexes FollowSymLinks <– 只開啟 Indexes 及 FollowSymLinks 功能
AllowOverride None <– 此目錄的權限不受.htaccess 檔影響
Order allow,deny
Allow from all <– 所有的 user 都可以存取得控制權
<Directory>

UserDir

語法:UserDir <目錄名稱>
預設:UserDir public_html

UserDir 用來指定供使用者放置個人網頁時,該放在自家〈home〉目錄裡的那一個目錄中才能讓人瀏覽。若以 http://myserver/~username 作為開始的一個 URL 連線請求將會被轉換成以 home-dir/public_html 作為開始的檔案名稱,其中 home-dir 是 username 這個使用者的自家目錄。

例:

UserDir public_html

-> 設定使用者必須把自己的網頁放在自家目錄的 public_html 目錄下才能供人瀏覽。對 http://myserver/~user/dir/file.html 的請求將傳回 http://myserver/home/user/public_html/dir/file.html 這個檔案。

DirectoryIndex

語法:DirectoryIndex <檔名1> <檔名2>…
預設:DirectoryIndex index.html

DirectoryIndex 用於設定當使用者端藉由指定沒有以檔案做結尾的目錄名稱請求該目錄的索引時所要找尋的來源列表。參數 [檔名1] 是在伺服器上相對於請求之目錄的文件;它通常是目錄裡某個檔案的名稱。可以有好幾個檔名,伺服器會回傳它所找到的文件。

例:

DirectoryIndex index.html

-> 對於 http://myserver/docs/ 的請求若該來源設定的檔案存在的話會回傳 http://myserver/docs/index.html。

DefaultType

語法:DefaultType <MIME 種類>
預設:DefaultType text/plain

DefaultType 用於設定當伺服器無法辨識檔案類型,要把它當作何種的 MIME 格式。

例:

DefaultType text/plain

-> 將無法分辨的一律當成明文文字格式

HostNameLookups

語法:HostNameLookups <On/Off>
預設:HostNameLookups Off

HostNameLookups 用於設定要不要把自動搜尋 HostName 的功能打開,設定為 On 時,則會記錄進入此網站使用者的主機名稱。設為 Off,則僅記錄使用者主機的 IP。

例:

HostNameLookups Off

-> 關掉自動反查 IP 功能

ErrorLog

語法:ErrorLog <檔案名稱>
預設:ErrorLog /usr/local/apache/logs/error_log

ErrorLog 設定錯誤記錄檔案名稱,伺服器將會把其遭遇的每個錯誤記錄到這個檔案。如果檔案名稱不是以 / 開始的話那麼它就會被假設為相對於 ServerRoot 的路徑。

例:

ErrorLog /usr/local/apache/logs/error_log

-> 當 apache 發生錯誤時,會把訊息記錄到 /usr/local/apache/logs 目錄下的 error_log 檔中

LogLevel

語法:LogLevel <debug/info/notice/warm/error/crit/alert/emerg>
預設:LogLevel warm

LogLevel 用於設定 error_log 中記錄的錯誤訊息種類,建議值是 warm,參數越往右邊所記錄的資訊越簡略。

例:

LogLevel debug

-> 設定 apache 的記錄錯誤方式為除錯模式〈debug〉

Alias

語法:Alias <虛擬目錄> <實際目錄>

Alias 指令用於設定實際目錄至虛擬目錄之別名,可將原本很長的路徑簡化。

例:

Alias /doc /usr/local/apache/htdocs/manual/doc/

-> 原本需要用 http://localhost/manual/doc 才能連到的網頁,現在僅需使用 http://localhost/doc 即可。

[轉]漫談火星塞

http://www.epochtimes.com/b5/5/8/23/n1028451.htm

一般人認為,火星塞在引擎總成方面只是個配角,其實大錯特錯,火星塞內部可蘊藏了不簡單的高深學問。

它不但可點燃你愛車的動力心臟,而且內部的結構設計更是精密細緻。隨著汽車科技進步,火星塞的使用材質更是日新月異,如果能為愛車選用一套優良的火星塞,不但可使引擎健健康康,同時還能將動力輸出發揮到極限。

內燃機引擎運作原理中,「進、壓、爆、排」這四個動作程序缺一不可,缺了其中一項,引擎就無法啟動發揮動能,而體積小巧的火星塞,則擔任點火爆炸的重要工作。火星塞(Spark Plug)也可稱為「火花塞」,英文字面上的意思即是「塞子」,換言之,就是將引擎的燃燒室塞住完全密合,並使高壓電通過火星塞本體,電流從電極間跳過,產生強熱火花,點燃汽缸內壓縮混合的氣體進行電性點火爆炸,產生動能推動引擎。

因此火星塞的工作,必須能夠承受幾十個大氣壓的壓縮與50kg/cm爆炸壓力、2萬-3萬伏特以上的高電壓及超過攝氏2000度的燃燒溫度,最後還必須面對內燃機引擎每分鐘接近幾千轉的運作,並接受汽油或燃燒氣體產生的化學腐蝕摧殘。所以火星塞的整體設計與材質,必需經長時間的實驗測試及精挑細選,可說是集一切科技精華於一身。

火星塞在進行爆炸點火時,產生副產物「碳」,如果附著在兩個電極上,火花會轉變得比較薄弱,或者會在電極前端外部發生短路現象,而不會使火花跳躍。

因此火星塞本身必須維持在一定範圍的溫度,才不至因不完全燃燒而發生積碳,或附著大量油漬的情形發生。所以,如果能讓火星塞正常運作及擁有較長的壽命,「溫度」指數的控制,扮演了極重要的角色。

而熱值則代表引擎燃燒室的溫度表現,熱值正式一點的名稱為「熱度範圍」,是指火星塞將陶瓷絕緣體到電極間的高熱傳導至火星塞外端,再由外部鋼體傳到引擎汽缸蓋和水套冷卻系統的能力。當引擎在慢車空轉時,火星塞電極間的溫度可能只有攝氏400度。而車輛高速行駛時,電極間的溫度便升至將近攝氏650度。車輛重踩油門時,電極間的溫度更可能升到攝氏815度以上。

如果電極間的溫度太低,油料燃燒後容易積存一些物質在火星塞的電極及絕緣體上,使火星塞放電不良甚至不點火。可是電極間的溫度升高可將這些積存物燒掉,不會越積越多。但溫度過高又會使電極容易受到燃燒物質的腐蝕,且電極本身跳火的耗損也比較快。更嚴重的情形是,燃燒不在火星塞電極點火,而被絕緣體本身的高溫引燃,使燃燒溫度大幅升高,將活塞頂部或火星塞電極熔解。

火星塞的種類可分為兩大類,一為「冷卻型」火星塞、一為「易熱型」火星塞。
簡單來說,「冷卻型」火星塞的絕緣體導熱較快,「易熱型」火星塞的絕緣體導熱較慢;最理想的火星塞,是在車輛輕負荷低速行駛時為「易熱型」火星塞,高負荷全油門行駛時變成「冷卻型」火星塞。但火星塞的熱度範圍不能隨意變動,所以只好依駕駛人的用車習慣,選用適當的熱值範圍。如果你經常行駛於市區,可選用「易熱型」火星塞,若經常在高速狀態下行駛,最好選用「冷卻型」火星塞。

火星塞仍會依車輛的性能與用途,有著不同設計與材質變化,而且每個火星塞本體上也都標有英文字母與數字,表示它的性能與型式,每家廠商都不相同。高壓縮比、高輸出力、易產生高熱量的引擎,都是採用耐熱度較高的「冷卻型」製品;相對的,如小排氣量、低轉速及低輸出的引擎,均為「易熱型」火星塞設定。

另外,現今市售車種火星塞直徑大小,可分為兩大種類,一種為直徑15.8mm,另一種則為19mm,且電極的間隙會因每一家車廠的設計而有所不同,因此在購買及換裝火星塞時必須非常小心注意。

所以每一家火星塞製造商,都會根據各種不同的狀況進行設計。不過多數火星塞發生故障的原因,大部分是其他引擎機件的不順、維修不良或使用錯誤與操控方法不正確所致。假使在良好行車狀態下,正確的使用一般車輛,只要使用的火星塞規格相同,應該就不會有重大的問題發生。

火星塞的構造大致可分為三部分,即絕緣瓷體、屬於導電材質的中央電極及鋼體,僅數公分的本體,卻非常地精密結實。

中央電極大多由銅製成,因銅的散熱及導電性佳,不論是高速還是低速,都有良好的適應性,而連接於正電終端螺絲帽,以及傳送點火線圈的中央電極,則利用陶瓷製的絕緣體包覆而成,可防止飛弧及漏電的發生,鋼體部分的金屬部件,採電鍍上防鏽性強的鉛金屬,或鎳鉻合金製成。扎實精密的構造,絲毫不輸給其他引擎的零件組成。

維修火星塞的工具,首先就是「火星塞套筒」,當然也有一部分的老式車種,不須要套筒扳手便可以拆卸火星塞。現今多數的車種都以DOHC 16氣門為主流,而火星塞則是安裝於二支凸輪軸與氣門包圍的狹窄深處,如果沒有內藏磁鐵的磁性專用套統扣住火星塞終端螺絲帽,根本無法安裝或拆取。

此外,引擎導線是否為直接點火型式,現今多數車種都改為直接點火,如果是直接點火型式,就必須另外準備一支可拆起直接點火導線的工具,方能拆起火星塞。在拆起火星塞前,使用刷子清理一下氣缸蓋週圍,避免異物進入燃燒室。拆起後,以間隙調整工具,進行間隙測定,並觀察火星塞的情況,在視情況好壞進行更換或清潔。上述這些工具配件,都可在汽車精品百貨及賣場選購,準備一整套,以備不時之需。

還有一點非常重要,切忌將火星塞旋的太緊,太緊容易傷害氣缸蓋上的螺紋,尤其是鋁質的氣缸蓋。安裝時先用手握著火星塞套筒,將火星塞旋緊,之後再用套筒扳手旋緊1/4圈就足夠了。如果火星塞沒有裝墊圈,而是有錐形的安裝座型式,因火星塞鋼體直接觸碰汽缸本體,所以手扭緊後只能用扳手再旋進1/16圈,才不至造成缸體的傷害。

只要注意上述幾個重點,車主便可隨時查看火星塞的工作狀況,為愛車的健康做最準確判斷。

當火星塞出現問題及損耗時,大概也是表示你的愛車出現一些麻煩,因此別輕忽火星塞的表現,它可是和車輛的狀況息息相關;然而,車主該如何判別火星塞的狀況來診斷愛車呢?

火星塞的選擇除了可維持原廠的設定外,也可依照自己的行車狀況去選擇。當火星塞經過長時間的使用後,若火星塞點火電極部位呈深咖啡色,這是正常燃燒狀態,但是並不代表永遠不更換火星塞,因為火星塞是消耗品,在規定的里程數內必須更換,避免影響火星塞的工作效能。

如果火星塞呈白色,表示燃燒室溫度過高,點火部絕緣體表面會跑出斑點的情況,這可能是散熱系統散熱不良,使溫度上升至870℃以上,讓火星塞過早點火,造成異常燃燒,有時也會損傷活塞。

有些火星塞在拆起時,在電極部分有燻黑的碳垢且呈濕潤感,這表示引擎有較嚴重的積碳,表示混合氣過濃,或是行車時習慣長時間空轉或低轉速,此時需要更換火星塞型號,選擇較熱型。

如果火星塞有嚴重的黑色積碳與黏稠感,此時你要注意了!這是引擎汽缸真圓度失圓的警訊,代表你的愛車得進廠大修了。所以平時多觀察及注意這些小細節,愛車才會健康,否則代價可能是讓你的荷包大失血!

熄火原因解決方法

熄火的原因解決方法

一、油路問題

1.油箱空氣孔塞住
常在跑長程或高速時容易發生
油箱蓋附近有一個讓空氣進去的地方.
塞住後就無法正常供油,導致熄火
(就像開罐頭要開兩個洞一進一出那樣)
過一段時間空氣慢慢吸進去,又恢復正常
若騎到一半熄火,打開油箱蓋後,車即可再度上路
處理方法:可以向車行老板借空氣噴槍來清潔油箱蓋,或附進的空氣入口
p.s.舊型FUZZY的油箱蓋似乎較容易積塵土,一般顧路多為此原因FUZZY車主可多留意

2.汽油濾芯不潔
會造成無法啟動或行進間熄火
汽油濾芯髒了以至於供油不順,被異物塞住時就會熄火
處理方法:可以清洗(用噴槍及柴油or溶劑)

3.油箱內有水或異物
下雨天特別有可能
會造成無法啟動或行進間熄火
偶爾發得起來,但一摧油就熄火
處理方法:清理油箱、化油器及汽油濾芯

4.油管鬆脫或曲折
會造成無法啟動或行進間熄火
車能偶爾發動但一摧油就熄火
處裡方法:將油管接好並整理至適當長度

5.沒油
有時候只是沒油而已,什麼問題也沒有
不要太相信你的油表
遇到車發不動的時候記得一定先檢查汽油存量
處理方法:加油…

二、進排氣問題

1.空氣濾清器不潔
進氣量不足及油氣濃度過高
可能無法啟動或行進間熄火
處理方法:空氣濾清器清理或換新

2.使用非原廠或改裝空氣濾清器
進氣量大,若混合比沒有配合調整
常常造成回油時熄火
處理方法:會改就要會調整

3.進氣歧管鬆動或破裂
這種情況會聽到奇怪的進氣聲
處理方法鎖緊或換新

4.排氣管積碳過於嚴重
在二行程車比較有可能發生
有這種情形的車高轉一定不順,極速會比正常低很多,狂操後易過熱
但若不是在狂操後過熱的情況下,
要積碳很嚴重才有可能造成平時容易熄火
處理方法:清理或換新排氣管

三、點火問題

1.防盜器故障
防盜器常有繼電器故障、線路接觸不良、
電力不足造成錯誤、甚至控制晶片故障的情形
有裝防盜器的車要檢查點火問題最好是先把這東東拆了再說
處理方法:我討厭防盜器
2.火星塞故障
火星塞積碳或老化也容易熄火甚至顧路
處理方法:清理或換新..建議直接換新

3.高壓線接觸不良或漏電
下雨天容易發生
接觸不良或漏電會導至短路而點火不良
若是這種情形會有漏電啪啪啪的聲音
通常是火星塞接頭端的問題
處理方法:把接頭往線壓順時針轉就可以了

4.其它線路接觸不良或斷路
若是斷路的話則根本無法點火
處理方法:查線

5.點火線圈(高壓線圈)掛了
下雨天容易發生
拆下火星塞,確定火星塞是好的,或乾脆換一顆新的來試
一端搭鐵,按起動馬達.
(注意不要被電到,不會死翹翹但會有點痛)
觀察點火狀況.若不會跳電,查線後若無斷路就可能是這問題了
處理方法:換新

6.發電機故障
車子有電不代表發電機可以正常供應火星塞點火
一方面發電機全掛的話電瓶的電還能讓車稱一陣子
另一方面現在的車點火和電瓶的發電是獨立的
上面幾項都檢查過了,還是不能點火,就有可能是這邊的問題
處理方法:換新

7.電瓶供電不良(限部份車種)
有些老車(比如說Kawasaki的瓦斯車)
點火的電力來源是由電瓶供應,一但電瓶沒電或供電不良
就沒辦法點火了
處理方法:檢查充放電線路視情況修理

四、化油器問題

1.怠速過低
slow低很容易熄火.易熄火及難發是必然的
處理方法:順時針旋轉怠速螺絲便可提高怠速

2.混合比太濃
拆下火星塞看看:棕色是剛剛好,若顏色太黑,就是混合比太濃(A/F比太低)
耗油多,車熱了之後一不加油就容易熄火
處理方法:慢慢調吧!

3.混合比太稀
拆下火星塞看看:棕色是剛剛好,若顏色太白,就是混合比太稀(A/F比太高)
引擎無力、過熱以及造成熄火,注意喔!這樣是很容易”縮”去的.
處理方法:慢慢調吧!

4.自動阻風門故障
自動阻風門本身或電路若故障
就會一直開著關不起來
造成混合比過高
處理方法:查線或更換

五、潤滑問題

1.機油油量不足或品質不良造成過熱
處理方法:添加或更換機油

六、引擎問題

1.汽缸吸入異物
處理方法:拆吧…

2.缸壓不足
缸壓不足的車本來就難發
高負載時也易過熱造成熄火
處理方法:搪缸

3.縮缸
引擎過熱造成,造成過熱原因有很多,可參考上列幾項
有時縮缸後休息一陣車還是可以繼續上路,視嚴重程度而定
處理方法:視過熱原因來處理.
注意!光搪缸只能修好氣缸部份
一定得找出過熱原因,否則搪缸後仍會再度縮缸