2010年2月7日星期日

Centos上跑最少的服務

架設standalone server大多數有特殊要求 所以要針對這些要求來customise.

我需要的:

[root@alfa ~]# chkconfig --list |grep 3:on
acpid              0:off    1:off    2:on    3:on    4:on    5:on    6:off
auditd             0:off    1:off    2:on    3:on    4:on    5:on    6:off
crond              0:off    1:off    2:on    3:on    4:on    5:on    6:off
haldaemon          0:off    1:off    2:off    3:on    4:on    5:on    6:off
iptables           0:off    1:off    2:on    3:on    4:on    5:on    6:off
irqbalance         0:off    1:off    2:on    3:on    4:on    5:on    6:off
kudzu              0:off    1:off    2:off    3:on    4:on    5:on    6:off
messagebus         0:off    1:off    2:off    3:on    4:on    5:on    6:off
microcode_ctl      0:off    1:off    2:on    3:on    4:on    5:on    6:off
network            0:off    1:off    2:on    3:on    4:on    5:on    6:off
sshd               0:off    1:off    2:on    3:on    4:on    5:on    6:off
syslog             0:off    1:off    2:on    3:on    4:on    5:on    6:off

我跑的指令:

chkconfig anacron off
chkconfig apmd off
chkconfig atd off
chkconfig autofs off
chkconfig cpuspeed off
chkconfig cups off
chkconfig cups-config-daemon off
chkconfig gpm off
chkconfig isdn off
chkconfig netfs off
chkconfig nfslock off
chkconfig openibd off
chkconfig pcmcia off
chkconfig portmap off
chkconfig rawdevices off
chkconfig readahead_early off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig smartd off
chkconfig xfs off
chkconfig ip6tables off
chkconfig avahi-daemon off
chkconfig firstboot off
chkconfig yum-updatesd off
chkconfig sendmail off
chkconfig mcstrans off
chkconfig pcscd off
chkconfig bluetooth off
chkconfig hidd off
chkconfig xinetd off
chkconfig mdmonitor off
chkconfig sendmail off
chkconfig restorecond off
This can be included in the post installation script section for mass kickstart installation.

PS. included service details.

NetworkManager, NetworkManagerDispatcher

NetworkManager is daemon meant to automate switching between network connections. Many laptop users who switch between Wireless WiFi connections and/or Ethernet connections may find this useful. Most stationary computers should have this disabled. Some DHCP users may require this.

acpid

Advanced Configuration and Power Interface daemon which controls and allows interfacing to power management and certain input devices. It is recommended to be enabled for all laptops, and most desktops. Some servers may not require acpi. Common things supported are the "Power Switch", "Battery Monitor", "Laptop Lid Switch", "Laptop Display Brightness", "Hibernate", "Suspend", etc.

anacron, atd, cron

These are schedulers with each having slightly different purposes. It is recommended you keep the general purpose scheduler cron enabled, especially if you keep your computer running for long periods of time. If you are running a server look into which schedulers you require. Most likely atd and anacron should be disabled for desktops/laptops. Please note that some sheduled tasks such as cleaning /tmp or /var may require anacron.

apmd

Is used by some laptops and older hardware. If your computer supports acpi, then apmd should be disabled. The acpi service will override apm if acpi is supported.

autofs

This mounts removable disks (such as USB harddrives) on demand. It is recommended to keep this enabled if you use removable media.

avahi-daemon, avahi-dnsconfd

Avahi is an implementation of zeroconf and is useful for detecting devices and services on local network without a DNS server. This is also the same as mDNS. Most likely this is unnecessary unless you have compatible devices/services. I have this disabled.

bluetooth, hcid, hidd, sdpd, dund, pand

Bluetooth is for portable local wireless devices (NOT wifi,802.11). Some laptops come with bluetooth support. There are bluetooth mice, headsets and cell phone accessories. Most people do not have bluetooth support or devices, and should disable this. Other services with bluetooth: hcid manages all devices, hidd provides support for input devices (keyboard, mouse), dund supports dialup networking over bluetooth, pand allows connections to ethernet networks over bluetooth.

capi

For users with ISDN hardware only. Should be disabled for most users.

cpuspeed

This throttles your CPU runtime frequency to save power. Many modern laptop CPU's support this feature and now many desktops also support this. Most people should enable only if they are users of Pentium-M, Centrino, AMD PowerNow, Transmetta, Intel SpeedStep, Athlon-64, Athlon-X2, Intel Core 2 hardware. Disable this if you want your CPU to remain at a fixed state.

cron

See anacron.

cupsd, cups-config-daemon

Used for printing. These should be enabled only if you have CUPS compatible printer that works in Fedora.

dc_client, dc_server

Distcache is for distributed session caching. It is primarily for SSL/TLS servers. Apache can use this. Most desktop users should have these disabled.

dhcdbd

This basically an interface for the DBUS system to control DHCP on your computer. It can be left to the default disabled state.

diskdump, netdump

Diskdump is a mechanism to help debug kernel crashes. It save a "dump" which can be later analyzed. Netdump does something similar over the network. Unless you are diagnosing a problem, these should be left as disabled.

dund

See bluetooth.

firstboot

This service is specific to Fedora's installation process meant to perform certain tasks that should only be executed once upon booting after installation. Even though it verifies it has been run before (using /etc/sysconfig/firstboot), it can be disabled.

gpm

This is the console mouse pointer (no graphics). If you do not use the text console (CTRL-ALT-F1,F2..) then disable this. However I leave this enabled for runlevel 3 and disabled for runlevel 5.

hidd

See bluetooth.

hplip, hpiod, hpssd

HPLIP is a service to support HP printers in Linux, including Inkjet, DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printers. This supported by HP through HP Linux Printing Project. HPLIP should be enabled only if you have a supported compatible printer.

iptables

This is the standard Linux software firewall. This is required if you are directly connected to internet (cable, DSL, T1). It is not required if you use a hardware firewall (D-Link, Netgear, Linksys, etc) but it is highly recommended.

ip6tables

If you do not know whether or not you are using IPv6, then most likely you are not. This services is the firewall for IPv6 communication. Most users can disable this. Read the following to disable IPv6 support in Fedora.

irda, irattach

IrDA support infrared communications between devices (laptops, PDA's, mobile phones, calculators, etc). This should be disabled for most users.

irqbalance

This service is to increase performance across processors on a multiprocessor system. Since most people do not have multiple processors, it should be disabled. However I do not know how it affects multi-core CPU's or hyperthreaded CPU's (?). There should be no problems on single CPU systems that do not use this.

isdn

This is another form of internet connect service/hardware. Unless you have an ISDN modem, disable this.
kudzu

This runs the hardware probe, and optionally configures changed hardware. If you swap hardware or need to detect/re-detect hardware this can be left enabled. However most desktop or servers can disable this and run it only when necessary.

lm_sensors

This monitors motherboard sensor values or specific hardware (commonly used with laptops). It is useful for watching realtime values for PC health, etc. This is also popular with GKrellM users. More information on lm_sensors homepage. It is recommended to disable this unless you have a need.

mcstrans

This is required if you are using SELinux. By default, Fedora Core will ship with SELinux enabled.

mdmonitor

Is useful for monitoring Software RAID or LVM information. It is not a critical service and may be disabled.

mdmpd

This is used for monitoring Multi-Path devices which are storage devices that can be accessed by more than 1 controller or method. This should be disabled.

messagebus

This is an IPC (Interprocess Communication) service for Linux. Specifically this communicates with dbus, a critical component. It is highly recommended to leave this enabled.

netdump

See diskdump.

netplugd

Netplugd can monitor network interfaces and executes commands when their state changes. This can be left to default disabled.

netfs

This is used for automatic mounting of any shared network file space such as NFS, Samba, etc on bootup. Useful if you connect to another server or filesharing on your local network. Most single desktop/laptop users should have this disabled.

nfs, nfslock

This the standard network file sharing for Unix/Linux/BSD style operating systems. Unless you require to share data in this manner, disable this.

ntpd

This automatically updates the system time from the internet. Mentioned in the installation process. If you have an active ("always-on") internet connection it is recommended you enable this, but it is not required.

pand

See bluetooth.

pcscd

Provides support for Smart Cards and Smart Card Readers. This are small chip like devices that are embedded in certain credit cards, identification cards, etc. Unless you have such a reader, this should be disabled.

portmap

This is complementary service to NFS (file sharing) and/or NIS (authentication). Unless you use those services you should disable this.

readahead_early, readahead_later

This services is to improve startup performance by preloading certain applications into memory. If you wish to startup faster leave this enabled.

restorecond

Is used to monitor and restore proper file contexts for SELinux. This is nNOT required but highly recommended if you use SELinux.

rpcgssd, rpcidmapd, rpcsvcgssd

Used for NFS v4. Unless you require or use NFS v4, these should be disabled.

sendmail

Unless you run a server or you like to transfer or support a locally shared IMAP or POP3 service, most people do NOT need a mail transport agent. If you check your mail on the web (hotmail/yahoo/gmail) or you use a mail program such as Thunderbird, Kmail, Evolution, etc. then you should disable this.

smartd

The SMART Disk Monitoring Daemon can be used to monitor and predict disk failure or problems on hard disk that support this. Most desktop users may not need this unless there is possible problems, but is it recommend to be left enabled (especially for servers).

smb

The SAMBA daemon is required to share files from Linux to Windows. This should be enabled only if you have windows computers that require file access to Linux. There is information on configuring Samba for FC6.

sshd

SSH allows other users to log into or run applications on your computer from another computer on your network or remotely. This is a potential security issue. This is not needed if you have no other computers or no need to login from a remote location (work, school, etc.). Most likely this should be disabled.

yum-updatesd

The YUM Update notifier daemon provides notification of updates which are available to be installed to your computer. If you do NOT have an active ("always-on") internet connection leave this disabled. Some updates are for security and many are for bug fixes and or newer software versions. Please understand that continuous updating with yum may lead to many problems.

xinetd

(This may not be installed by default.) This is a special service. It can launch multiple services based on a request to a specific port. For example: telnet is typically connected to port 23. If there is a request for telnet access that xinetd detects on port 23, then only will the telnet daemon be executed. For convenience this can be left to enabled. Run system-config-services and go to On Demand Services -or- run chkconfig --list and look for the xinetd output to show which services are connected to xinetd.

2010年2月4日星期四

在Karmic之下設定eclipse+pydev環境

Karmic版本的eclipse-pydev package被拿掉了
所以:
sudo apt-get install eclipse
然後
Add PyDev information under Help/Install New Software/add http://pydev.org/updates, and let it install.

2010年2月2日星期二

雲端第一人 Axa Cheng

雲端運算其實就是網路運算,將眾多伺服器聯合起來,形成強大的運算能力,在台灣雲端運算是新科技,據我所知台灣雲端第一人就是Axa,多年的雲端資料中心營運經驗,堪稱史上最強之系統專員。

雲端運算並不是最近才提出的新概念,早在1999年就有人提出類似雲端的商業模式,但因當時仍盛行用戶端運算,並未形成風潮。直到2004年 Google在網路服務應用上的成功,才讓大家看到雲端運算的未來。

因為大量依賴遠端伺服器的運算,必須將許多資料交給服務供應商,也使得雲端運算必須面臨許多安全問題。例如如何保障客戶資料的安全、提供不中斷的服務等。

2010年1月29日星期五

雲端科技

雲端科技是什麼
大家都問 什麼是雲端運算 雲端科技
其實 很久以前就有雲端科技 多數人都使用過webmail 這就是雲端科技
當你的資料已經不在你的電腦 而存在雲端(網路上) 那就已經符合雲端科技的基本概念

雲端科技的比喻
作個簡單的比喻
當你都吃外食 家裡就不用買冰箱/刀叉/餐具等 只要走到超商/餐廳/夜市 就可以得到食物
當你用雲端科技 家裡就不用買電腦 只要去到任何有網路的地方 你便能存取你的資料

雲端的優點
為什麼要使用雲端科技的產品
第一 方便 - 當你的資料在網路上 只要透過網路 便能存取
第二 穩定 - 只要雲端的機器不當機 資料永遠不需要備份
第三 共享 - 雲端上與其他使用者的collaboratoin是peer to peer無法勝任的
第四 省錢 - 三五年前的laptop只要安裝了簡易的作業系統(linux都能過快速的上網使用 不用在買80G 100G的硬碟 不用在買新的顯示卡 不用在升級
第五 更多 暫時想不出來

我老了 很多事情都記不住

小時候沒有好好讀書 只會到處玩
沒有好好使用頭腦 現在步入中年才知道腦袋好用 卻已經來不及
只好使用google的blogger來幫助我的記憶
雲端運算 果真是21世紀科技最佳產物

2010年1月27日星期三

pppoe and tcp checksum error

http://plasma-gate.weizmann.ac.il/Linux/maillists/03/09/msg00067.html
這個問題很詭異 文中提起clampmss設錯會與firewall有衝突
我的iptables都還沒設定好 便出現此錯誤
修正過後就正常了

[root@strength ~]# cat /etc/sysconfig/network-scripts/ifcfg-ppp0
#CLAMPMSS=1412
CLAMPMSS=no

相當詭異

2010年1月26日星期二

Apache mod_expires quick performance tune up

ExpiresActive On
ExpiresByType text/css "access plus 1 days"
ExpiresByType image/gif "access plus 1 days"
ExpiresByType application/x-shockwave-flash "access plus 1 days"

遇到經常存取的網站 出現大量的圖檔/swf檔/css的存取次數 可以用來節省硬碟讀取數
google apache expires performance