天空之城
網路硬碟
Windows筆記本Linux筆記本
主站 子網
Yahoo!奇摩
翻譯
午安! 16點 38分
會員系統
親愛的 訪客 您好!
登入會員註冊會員
member-3
系統設定
設定網頁背景
設定網頁模組
設定網頁皮膚
天空之城遊客中心
system-3
系統公告
1.修改--網頁選單,強化站內外啟動路徑判別...(09/10/07)
2.公告--請勿將phpspy等間諜軟體上傳至伺服器...(09/09/07)
3.修正--安全防護,禁止用戶上傳或存放php檔案...(09/09/07)
notice-3
新進會員
1.阿浩
2.僑依164/73
3.阿弥陀佛
4.锐意无限
5.阿伟
newmember-3
連結說明 連結此頁:http://www.skycity.com.tw/link?linkpage=teach-linux

Linux 教學

鳥哥的 Linux 私房菜 柏青哥的 SuSE Linux Study-Area 朱孝國的筆記本

Linux 討論

Fedora 台灣愛用者社群 Ubuntu 正體中文站 fedora中文愛好者 新聞區 | Linux 台灣
Android SDK 教學 孫傳雄談科技

Linux 文件

100個最佳Linux站點 重設遺忘的LINUX密碼 掛載vmware的虛擬硬碟 Perl電子書
鳥哥的Linux私房菜電子書 設定自動重開機 XML 電子書 簡易的 Shell Scripts

Linux 下載

Fedora 專案 「官方網站」 RPM Search 「套件」 RPM find 「套件」 中國Linux公社 「自由軟件」

Fedora 安裝流程整理

【01】添加資料庫來源 【02】更新核心版本 【03】安裝更新程式 【04】設定伺服器
【05】常用應用程式 【06】其他應用程式 【07】支援windows軟體 【08】支援windows遊戲
【09】安裝虛擬機器 【10】網頁程式 【11】安裝無線網路卡 【12】安裝防毒軟體
【13】桌面美化 【14】中文輸入 【15】開放使用者權限 【16】系統優化
【17】安全防護 【18】登入模式 【19】資料救援 【20】

Linux Fedora 10 & 11 安裝流程整理

【01】添加資料庫來源和設定yum,提高更新下載速度

添加livna源
網站:http://rpm.livna.org/rlowiki/
[root]# rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
[root]# rpm -ivh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
添加freshrpms源(支持apt和yum)....只支援到FC9
網站:http://www.freshrpms.net
讓yum選擇最快的mirror
[root]# yum install yum-fastestmirror -y
更新源連線失敗,中斷。
在/etc/yum.repos.d/目錄下,刪除無法連線的更新源.repo

【02】安裝顯示卡驅動程式,並更新核心版本

安裝nVIDIA顯示卡驅動程式,會連帶更新核心(需先安裝livna源)
確認顯卡類型
#/sbin/lspci | grep VGA

如果是GeForce 6 或更新
[root]# yum install xorg-x11-drv-nvidia
如果是GeForce 5(FX 系列)
[root]# yum install kmod-nvidia-173xx
如果是GeForce 2~GeForce 4
[root]# yum install kmod-nvidia-96xx

安裝完後重新啟動
[root]# reboot

確認顯示卡驅動程式
[root]# glxinfo | grep rendering
direct rendering: Yes

確認顯示卡驅動程式正確安裝
[root]# lsmod | grep nvidia
有nvidia ************ ** 出現。

解決畫面解析度過低
系統-管理-顯示
顯示設定-硬體-螢幕類型-設定-Generic LCD Display-LCD Panel 1024x768-確定[登出後生效]
安裝桌面特效管理選單
[root]# yum install fusion-icon
更新核心
安裝kernel
[root]# yum install kernel
安裝kernel-devel(要安裝虛擬機器時才需要)
[root]# yum install kernel-devel
重新啟動電腦
[root]# reboot

【03】安裝圖形介面更新程式

安裝圖形界面的yum
[root]# yum install yumex
安裝Synaptic圖形化介面的apt套件更新管理程式
[root]# yum install synaptic

【04】設定伺服器

安裝網頁http伺服器
[root]# yum install httpd mysql-server php php-devel php-mysql

安裝php加速器
[root]# yum install php-eaccelerator

變更網頁根目錄
/etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html" ===> DocumentRoot "/skycity" ...修改網頁路徑
設定 SELinux 的 httpd_sys_content_t 屬性,網頁才能被存取
[root]# chcon -R -h -t httpd_sys_content_t /skycity

設定網頁
/etc/httpd/conf/httpd.conf
AddDefaultCharset UTF-8 ===> #AddDefaultCharset UTF-8 ...取消網頁為萬國碼的預設
Timeout 30 ...連線超過30秒失敗就重試
KeepAlive On ...開啟 KeepAlive
MaxKeepAliveRequests 1000 ...設定同一時間可容許的連線數量
KeepAliveTimeout 3 ...自動關閉連線

設定php變數
/etc/php.ini
register_globals = Off ==> register_globals = On
register_long_arrays = Off ==> register_long_arrays = On
register_argc_argv = Off ==> register_argc_argv = On

顯示php錯誤訊息,偵錯時使用,平常關閉
/etc/php.ini
display_errors = Off ==> display_errors = On

提高上傳檔案限制
/etc/php.ini
max_execution_time = 86400 //最大執行時間,預設為30秒
memory_limit = 384M //記憶體限制,預設為8M
post_max_size = 1024M //POST的資料量限制,預設為8M
file_uploads = On //上傳檔案功能,預設為On
upload_max_filesize = 1024M //上傳檔案的最大限制,預設為2M

設定開機自動啟動
[root]# service httpd restart
[root]# service mysqld restart
[root]# chkconfig httpd on
[root]# chkconfig mysqld on

建立mysql密碼
[root]# mysqladmin -h localhost -u root password 12345678
增加虛擬主機:[支援多網域]
啟用虛擬主機
/etc/httpd/conf/httpd.conf
#NameVirtualHost *:80 ==> NameVirtualHost *:80

增加網域資料,未設定的網域以第一組為預設伺服器

<VirtualHost *:80>
ServerAdmin webmaster@skycity.com.tw
DocumentRoot /skycity
ServerName skycity.com.tw
ErrorLog logs/skycity.com.tw-error_log
CustomLog logs/skycity.com.tw-access_log common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@skycity.com.tw
DocumentRoot /games
ServerName game.sky-city.com.tw
ErrorLog logs/game.sky-city.com.tw-error_log
CustomLog logs/game.sky-city.com.tw-access_log common
</VirtualHost>

重新啟動伺服器後生效
[root]# service httpd restart
啟用個人網頁
/etc/httpd/conf/httpd.conf
UserDir disable ===> #UserDir disable
#UserDir public_html ===> UserDir public_html

403 Forbidden 權限不足
修改 /home/userdir 權限 711
修改 /home/userdir/public_html 權限 755

重新啟動伺服器後生效
[root]# service httpd restart
安裝加密網頁https伺服器
[root]# yum install mod_ssl
[root]# service httpd restart

修改預設的網頁路徑
/etc/httpd/conf.d/ssl.conf
#DocumentRoot "/var/www/html" ===> DocumentRoot "/var/www/html"...修改網頁預設路徑
#ServerName www.example.com:443 ===> ServerName *:443...監聽所有位置

修改憑證相關資料路徑及檔名
/etc/httpd/conf.d/ssl.conf
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key ===> public key
SSLCertificateFile /etc/pki/tls/certs/localhost.crt ===> 憑證檔案

建立 public key
[root]# cd /etc/pki/tls/private
[root]# openssl genrsa -out localhost.key 1024

建立憑證檔案
[root]# cd /etc/pki/tls/certs
[root]# openssl req -new -x509 -days 7305 -key ../private/localhost.key -out localhost.crt

輸入憑證資料
國碼:TW
國家:Taiwan
城市:Taipei
公司:SkyCity inc.
部門:SkyCity
網域:www.skycity.com.tw
電郵:service@skycity.com.tw
安裝vsftp伺服器
[root]# yum install vsftpd

如果允許匿名登入
/etc/vsftpd/vsftpd.conf
anonymous_enable=YES
anon_root=自訂目錄
安裝proftp伺服器
[root]# yum install proftpd

安裝GProFTPD圖像式管理ProFTPt程式
網站:http://linux.softpedia.com/progDownload/GProFTPD-Download-56.html
下載:gproftpd-8.3.2-0.1.rhfc7.nr.i386.rpm

第一次登入畫面選yes
如果允許匿名登入
Username: anonymous
Password: 任意輸入
Group: ftp
Require password: 密碼檢查...取消
+Add directory 自訂路徑及權限
安裝Samba伺服器
[root]# yum install samba samba-client samba-common system-config-samba
系統-管理-Samba
[root]# smbpasswd -a user_name(新增帳號密碼.同時也是家目錄名稱) [root]# setsebool -P samba_enable_home_dirs on (可以看到家目錄,可是無法進入自己的家目錄)
開機後自動啟動網路芳鄰
[root]# chkconfig smb on
[root]# chkconfig nmb on

關閉SELinux
直接修改SELinux設定檔 /etc/sysconfig/selinux,將SELINUX設成disabled,再重新開機就可以了。
SELINUX=enforcing ===> SELINUX=disabled
安裝bind伺服器
[root]# yum install bind
修改 /etc/named.conf 開放外部的查詢
	listen-on port 53 { 127.0.0.1; }; ===> listen-on port 53 { any; };
	allow-query     { localhost; }; ===> allow-query    { any; };
	allow-transfer { none; };
	forwarders {
		139.175.55.244 ;
		168.95.1.1 ;
		139.175.252.16 ;
		168.95.1.2 ;
		168.95.192.1 ;
		} ;

正解:
編輯 /etc/named.conf 檔案末端,加入託管的網域正解
zone "skycity.com.tw" {type master;file "named.skycity.com.tw";};
zone "sky-city.com.tw" {type master;file "named.sky-city.com.tw";};
建立正解檔案 /var/named/named.skycity.com.tw
$TTL 600
@	IN SOA	@ rname.invalid. (
					0	; serial
					28800	; refresh
					3600	; retry
					864000	; expire
					10800 )	; minimum
	NS	@
	A	123.204.62.176
//設定郵件伺服器
	MX 10	mail
//設定子網域IP位置
www  IN A 123.204.62.176 ==> www.skycity.com.tw  = 123.204.62.176
mail IN A 123.204.62.176 ==> mail.skycity.com.tw = 123.204.62.176
//增加子網域別名
dns IN CNAME skycity.com.tw. ==> dns.skycity.com.tw = skycity.com.tw
shop IN CNAME www         ==> shop.skycity.com.tw = www.skycity.com.tw
game IN CNAME www         ==> game.skycity.com.tw = www.skycity.com.tw
修改檔案群組權限 named 可讀取 [重要]
[root]# chgrp named /var/named/named.skycity.com.tw

反解:主要運用在郵件伺服器.需先向ISP提出IP反查聲請,設定才有意義,一般用途可略過不設定
申請固定IP網域反解:
Hinet:Hinet IP反解聲請
Seednet:Seednet IP反解聲請
DNS檢測:TWNIC

編輯 /etc/named.conf 檔案末端,加入託管的網域名稱反解
zone "62.204.123.in-addr.arpa" {type master;file "named.123.204.62";};
zone "187.204.123.in-addr.arpa" {type master;file "named.123.204.187";};
建立反解檔案 /var/named/named.123.204.62
$TTL 600
@	IN SOA	@ rname.invalid. (
					0	; serial
					28800	; refresh
					3600	; retry
					864000	; expire
					10800 )	; minimum
	IN	NS	skycity.com.tw. ==> 123.204.62 區段內有使用到的網域名稱
	IN	NS  www.skycity.com.tw. ==> 123.204.62
176	IN	PTR	skycity.com.tw. ==> 123.204.62.176 = skycity.com.tw
176	IN	PTR www.skycity.com.tw. ==> 123.204.62.176 = www.skycity.com.tw
修改檔案群組權限 named 可讀取 [重要]
[root]# chgrp named /var/named/named.123.204.62

重新啟動伺服器讓設定生效
[root]# chkconfig named on
[root]# service named restart
安裝iSCSI伺服器
教學:iSCSI:Linux 上應用 iSCSI 技術

安裝服務
[root]# yum install iscsitarget

開啟防火牆,修改 /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3260 -j ACCEPT

重新載入防火牆
[root]# service iptables restart

開啟共享資源,修改設定 /etc/ietd.conf
Lun 0 Path=/dev/sda2,Type=fileio ===>共享磁碟
Lun 0 Path=/root/test.iso,Type=fileio ===>使用檔案模擬磁碟

如果使用檔案模擬磁碟時,用dd建立iso檔
dd if=/dev/zero of=/root/data.iso count=1 seek=10485760

啟動iSCSI服務,完成
[root]# service iscsi-target restart

安裝用戶端 for windows
網站:Microsoft Storage Technologies - iSCSI
下載:Initiator-2.08-build3825-x86fre.exe

連線伺服器: Discovery - Add - IP位置
啟動磁碟: Targets - Log On

安裝用戶端 for Linux
[root]# yum install iscsi-Initiator
安裝郵件伺服器-sendmail 設定(外寄郵件設定)
教學:Mail Server 相關設定方法

啟動 smtp 的認證功能
/etc/mail/sendmail.mc
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
改為
TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN') dnl
define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN') dnl

開放 smtp 的服務範圍,預設只對本機(127.0.0.1)做服務
/etc/mail/sendmail.mc
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') ===> 前面加上 dnl

設定防堵垃圾信的黑名單參考(sendmail.mc)
/etc/mail/sendmail.mc 檔案最後方 MAILER(smtp)dnl 前加入
FEATURE(`dnsbl',`relays.ordb.org',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://relays.ordb.org/')dnl
FEATURE(`dnsbl',`dnsbl.sorbs.net',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://dnsbl.sorbs.net/')dnl
FEATURE(`dnsbl',`sbl.spamhaus.org',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://sbl.spamhaus.org/')dnl
FEATURE(`dnsbl',`xbl.spamhaus.org',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://xbl.spamhaus.org/')dnl
FEATURE(`dnsbl',`DNSBL.SORBS.NET',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://DNSBL.SORBS.NET/')dnl
FEATURE(`dnsbl',`blackholes.mail-abuse.org',`550 5.7.1 Mail from $& {client_addr} rejected based on external blacklist - See also http://blackholes.mail-abuse.org/')dnl
FEATURE(`dnsbl',`dialups.mail-abuse.org',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://dialups.mail-abues.org/')dnl
FEATURE(`dnsbl',`relays.mail-abuse.org',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://relays.mail-abuse.org/')dnl
FEATURE(`dnsbl',`dul.maps.vix.com',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://dul.maps.vix.com/')dnl
FEATURE(`dnsbl',`dynablock.njabl.org',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://dynablock.njabl.org/')dnl
FEATURE(`dnsbl',`dsbl.dnsbl.net.au',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://dnsbl.dnsbl.net.au/')dnl
FEATURE(`dnsbl',`ipwhois.rfc- ignorant.org',`550 5.7.1 Mail from $& {client_addr} rejected based on external blacklist - See also http://www.ordb.org/')dnl
FEATURE(`dnsbl',`bl.spamcop.net',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://bl.spamcop.net/')dnl
FEATURE(`dnsbl',`list.dsbl.org',`550 5.7.1 Mail from $&{client_addr} rejected based on external blacklist - See also http://list.dsbl.org/')dnl

安裝套件才可使用m4產生新的 sendmail.cf
[root]# yum install sendmail-cf sendmail-devel -y

使用 m4 產生新的 sendmail 設定檔:
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.bak
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

設定服務範圍(relay 設定誰可以使用這項服務)[非必須]
/etc/mail/access
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
加入
skycity.com.tw RELAY

修改完之後將 access 轉成 access.db
makemap hash /etc/mail/access < /etc/mail/access

可用來收件的主機名稱
vi /etc/mail/local-host-names
skycity.com.tw

重新啟動 sendmail:
service sendmail restart
測試服務:
telnet 127.0.0.1 25
開機自動啟動 sendmail:
chkconfig sendmail on
安裝郵件伺服器-POP、IMAP 設定(內送郵件設定)
教學:Mail Server 相關設定方法

安裝IMAP:
[root]# yum install dovecotot

啟動POP3協定:[非必須]
/etc/dovecot.conf
#protocols = imap imaps pop3 pop3s
改為
protocols = imap imaps pop3 pop3s
若不啟動ssl則改為
protocols = imap pop3

重新啟動 IMAP:
service dovecot restart
測試服務:
telnet 127.0.0.1 110
開機自動啟動 dovecot:
chkconfig dovecot on
設定郵件伺服器
讓寄給 root 的信都轉給skycity帳號
/etc/aliases
加入 root: skycity
將 aliases 轉成 /etc/aliases.db
newaliases

設定郵件伺服器名稱,可以收下 User@skycity.com.tw 格式的信件
/etc/mail/local-host-names
加入 skycity.com.tw
垃圾信過濾軟體spamassassin
[root]# yum install spamassassin

啟動服務
[root]# service spamassassin restart
[root]# chkconfig spamassassin on

開啟 openwebmail 垃圾信過濾:
/var/www/cgi-bin/openwebmail/etc/openwebmail.conf
spamcheck_pipe /usr/bin/spamc -c -x -t60 -u @@@USERNAME@@@ ==> 新增
learnspam_pipe /usr/bin/sa-learn --spam ==> 新增
learnham_pipe /usr/bin/sa-learn --ham ==> 新增
enable_spamcheck no ==> enable_spamcheck yes
enable_learnspam no ==> enable_learnspam yes
spamcheck_source_allowed all
default_spamcheck_source all ==> 新增
安裝Webmin伺服器管理程式
網站:http://www.webmin.com/
教學:Webmin 教學動畫三部曲

【05】常用應用程式

調整自動對時
系統-管理-日期和時間-網路時間通訊協定(NTP)

v啟用網路時間通訊協定(E)

NTP 伺服器:
clock.stdtime.gov.tw
tick.stdtime.gov.tw
time.stdtime.gov.tw
tock.stdtime.gov.tw
watch.stdtime.gov.tw

v在啟動服務前,同步系統時間(y)
安裝Firefox網頁瀏覽程式
[root]# yum install firefox

讓firefox支持flash插件[32位元]
網站:http://get.adobe.com/flashplayer/
下載:flash-plugin-10.0.15.3-release.i386.rpm

讓firefox支持flash插件[64位元]
教學:在Fedora10安裝Adobe Flash Player 64-bit
下載:flashplayer_square_p2_64bit_linux_092710.tar.gz
官網:http://labs.adobe.com/technologies/flashplayer10

[root]# wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p2_64bit_linux_092710.tar.gz
[root]# tar zxvf flashplayer_square_p2_64bit_linux_092710.tar.gz
[root]# mkdir ~/.mozilla/plugins
[root]# cp libflashplayer.so ~/.mozilla/plugins/libflashplayer.so

修正無法正確顯示中文
[root]# rm /etc/fonts/conf.d/49-sansserif.conf
安裝Thunderbird郵件程式
[root]# yum install thunderbird
使用totem播放MP3
[root]# yum install gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly gstreamer-ffmpeg
安裝RealPlayer 11多媒體播放程式
網站:http://www.real.com/linux
下載:RealPlayer11GOLD.bin
[root]# chmod +x RealPlayer11GOLD.bin
[root]# ./RealPlayer11GOLD.bin

缺部份套件,無法啟動,先安裝RealPlayer10自動下載缺少的套件
下載:RealPlayer-10.0.5.756-1.1.i586
安裝xine多媒體播放程式
[root]# yum install xine xine-lib-moles xine-plugin
安裝mplayer影片播放程式
[root]# yum install mplayer mplayer-gui mplayerplug-in

安裝mencoder解碼程式
[root]# yum install mencoder

解決錯誤訊息: cannot prepare subtitle font
[user]# rm /etc/mplayer/mplayer.conf
[user]# cp /usr/share/fonts/zh_CN/TrueType/zysong.ttf ~/.mplayer/subfont.ttf
安裝k3b燒錄軟體
[root]# yum install k3b
安裝Pidgin(Gaim)網路即時通
[root]# yum install pidgin
安裝Skype網路電話
教學:Fedora 10 下安裝 Skype 即時通訊軟件

建立Skype資料源
[root]# gedit /etc/yum.repos.d/skype.repo

複製以下代碼保存到skype.repo
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
enabled=1
gpgkey=http://www.skype.com/products/skype/linux/rpm-public-key.asc
gpgcheck=0

安裝Skype
[root]# yum install skype
安裝MultiGet文件下載器(flashget)
[root]# yum install multiget
安裝Java的支援...FC11已安裝
網站:http://www.java.com/zh_TW/download/manual.jsp
下載:jre-6u18-linux-i586-rpm.bin
下載:jre-6u18-linux-x64-rpm.bin
[root]# sh ./jre-6u18-linux-x64-rpm.bin
安裝AdobeReader閱讀pdf的支援
網站:http://www.adobe.com/products/acrobat/readstep2.html
下載:AdobeReader_cht-8.1.1-1.i486.rpm
安裝GnoCHM閱讀chm的支援
[root]# yum install gnochm
安裝OpenOffice辦公軟體
程式(依需要安裝)
openoffice.org-draw  Draw 繪製流程圖與標誌(隱藏)
openoffice.org-math  Math 編輯公式與方程式(隱藏)
openoffice.org-calc  工作表 == Execl
openoffice.org-writer  文字處理器 == Word
openoffice.org-impress  簡報 == PowerPoint
openoffice.org-base  資料庫開發
模組
openoffice.org-emailmerge
openoffice.org-graphicfilter
openoffice.org-javafilter
openoffice.org-xsltfilter
安裝FileZilla程式(圖型模式ftp用戶端程式)
[root]# yum install filezilla
安裝vnc遠端桌面程式(vnc用戶端程式)
[root]# yum install vnc
安裝RAR解壓縮程式
網站:http://www.rar.com.tw/order_01.html
下載:rarlinux-3.9.1.tar.gz
下載:rarlinux-x64-3.9.1.tar.gz
[root]# tar zxvf rarlinux-x64-3.9.1.tar.gz
[root]# cd rar
[root]# make

【06】其他應用程式

安裝xmms播放MP3程式(winamp)
[root]# yum install xmms xmms-mp3 xmms-skins
安裝ogle影片播放程式-簡易DVD player
[root]# yum install ogle ogle-devel ogle_gui
安裝amarok多媒體播放程式 for kde
[root]# yum install amarok
安裝audacious多媒體播放程式
[root]# yum install audacious
安裝brasero燒錄軟體
[root]# yum install brasero
安裝MSN即時通
[root]# yum install amsn
安裝QQ即時通
[root]# yum install eva
安裝驢子P2P下載軟體
[root]# yum install amule
安裝BT下載器
[root]# yum install bittorrent bittorrent-gui
安裝Downloader for X 下載器
[root]# yum install d4x
安裝xchm閱讀chm的支援
[root]# yum install xchm
安裝gftp程式(圖型模式ftp用戶端程式)
[root]# yum install gftp
安裝vnc遠端桌面程式(vnc被控端程式)
[root]# yum install vino

【07】支援windows軟體

安裝wine可執行windows程式
[root]# yum install wine

第一次啟動wine作業環境初始化
[root]# wineboot

若執行程式後,鍵盤無法使用
先將右上方輸入法...滑鼠右鍵...離開,重新執行程式
安裝Wine Gecko IE engine網頁瀏覽器
[root]# wine iexplore
安裝ie6.0網頁瀏覽器
安裝cabextract (必要套件-解壓縮(extract) CAB 檔案)
網站:http://www.cabextract.org.uk
下載:cabextract-1.2-1.i386.rpm

安裝IEs4Linux 2.0.5
網站:http://www.tatanka.com.br/ies4linux/page/Installation
下載:ies4linux-latest.tar.gz
[root]# wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
[root]# tar zxvf ies4linux-latest.tar.gz
[root]# cd ies4linux-*
[root]# ./ies4linux

加入應用程式選單
系統...偏好設定...個人...外觀與感覺...Main Menu...應用程式...網際網路...新增項目(W)
名稱: Internet Explorer 6.0(自訂)
指令: ie6
圖片: ~/.ies4linux/ies4linux.svg
安裝Java支援
網站:http://java.sun.com/javase/downloads/index.jsp
下載:jre-1_5_0_11-windows-i586-p.exe
放置到~/.ies4linux/ie6/drive_c/下執行
[root]# cd ~/.ies4linux/ie6/drive_c
[root]# WINEPREFIX=~/.ies4linux/ie6 wine jre-1_5_0_11-windows-i586-p.exe
加入windows的新細明體
目錄:C:\WINDOWS\Fonts\MingLiU.ttc
下載:MingLiU.ttc
放置到/usr/share/fonts/chinese/TrueType/MingLiU.ttc

加入預設字體 & 字體大小 (預設=AR PL New Sung=文鼎PL新宋)
~/.wine/drive_c/Windows/win.ini
[Desktop]
IconTitleFaceName=新細明體
menufontsize=13
messagefontsize=13
statusfontsize=13
IconTitleSize=13
wine notepad 中文顯示
edit===> font ===> 最後兩項分別為...新細明體&新明體
wine 中文輸入
[root]# yum install gcin

系統預設SCIM不支援wine無法使用中文輸入,需變更為gcin等輸入法
系統...偏好設定...個人...輸入法...使用自訂的輸入法(c)...登出生效
加快啟動的速度,避免wine啟動時搜尋原本就不存在的字型檔案
修改 /usr/share/X11/locale/zh_TW.UTF-8/XLC_LOCALE ,將下列文字的前方都加上#
# fs2 class (Chinese Han Character (Traditional))
# fs2 {
# charset {
# name BIG5-0:GLGR
# }
# font {
# primary BIG5-0:GLGR
# substitute BIG5-0:GLGR
# }
#}
windows程式安裝工具 for wine(不容易連線)
安裝必要套件
[root]# yum install orange gnome-python2-rsvg

Wine-Doors 0.1.1
網站:http://www.wine-doors.org/wordpress/?page_id=3
下載:wine-doors-0.1.1.tar.gz
[root]# wget http://www.wine-doors.org/releases/wine-doors-0.1.1.tar.gz
[root]# tar -zxvf wine-doors-0.1.1.tar.gz
[root]# cd wine-doors-0.1.1
[root]# python setup.py install
Navicat for MySQL v8.0.29 for Linux
網站:http://www.navicat.com/cht
下載:navicat8_mysql_en.tar.gz
序號:NAVJ-TUJN-ZYEZ-LDTV
[user]# tar zxvf navicat8_mysql_en.tar.gz
[user]# cd navicat8_mysql_en.tar.gz
[user]# ./start_navicat

【08】支援windows遊戲

安裝cedega 6.0.2 all linux 可執行windows遊戲
種子:myBittorrent.com
下載:cedega.6.0.2_all_linux.zip

解壓縮cedega.6.0.2_all_linux.zip
主程式 cedega-small-6.0.2-1.i386.rpm
更新檔 cedega-engine-6.0.2-local-update.i386.cpkg
安裝cedega 6.0可執行windows遊戲
網站:http://linuxdesktop.cn/2007/05/16/cedega6-download
下載:cedega.6.0.tar.bz2

解壓縮cedega.6.0.tar.bz2
主程式 cedega-small_6.0_all.deb
更新檔 cedega-engine-6.0-local-update.i386.cpkg

安裝 rpm-build 打包套件
[root]# yum install rpm-build
建立打包套件的環境
[root]# yum install fedora-rpmdevtools
[root]# fedora-buildrpmtree

安裝alien轉換程式,可將debian格式轉成rpm封裝
網站:http://ftp.debian.org/debian/pool/main/a/alien/
下載:alien_8.69.tar.gz
[root]# wget http://ftp.debian.org/debian/pool/main/a/alien/alien_8.69.tar.gz
[root]# tar -zxvf alien_8.69.tar.gz
[root]# cd alien
[root]# perl Makefile.PL; make; make install

將deb轉成rpm
wget http://linuxdesktop.cn/wp-content/uploads/2007/05/cedega.6.0.tar.bz2
tar -jxvf cedega.6.0.tar.bz2
alien -r cedega-small_6.0_all.deb

轉成rpm封裝
檔案:cedega-small-6.0-2.noarch.rpm

安裝並忽略相依的套件
rpm -ivh --nodeps cedega-small-6.0-2.noarch.rpm

更新cedega.6.0
應用程式---美工繪圖or遊戲---TransGaming Cedega
取消 Check for Updates
點擊 Install Local Package
選擇 cedega-engine-6.0-local-update.i386.cpkg

啟動程式
新增項目 Tools->Game Folders->Add
設定資料 Tools->Shortcuts->add
Name Folders 自訂程式名稱
Path to Program 程式完整路徑
GDDB Profile 選擇要執行遊戲

【09】安裝虛擬機器

安裝 VirtualBox 虛擬機器,可安裝其他作業系統
網站:http://www.virtualbox.org/wiki/Downloads
下載:VirtualBox-2.1.2_41885_fedora9-1.i386.rpm For Fedora 9 & 10 i386
下載:VirtualBox-2.1.2_41885_fedora9-1.x86_64.rpm For Fedora 9 & 10 x86_64
下載:VirtualBox-3.0.4_50677_fedora11-1.i586.rpm For Fedora 11 i386
下載:VirtualBox-3.0.4_50677_fedora11-1.x86_64.rpm For Fedora 11 x86_64

安裝dkms套件,執行設定
[root]# yum install dkms
[root]# sudo /etc/init.d/vboxdrv setup

建立使用權限:
系統...管理...使用者與群組...將使用VirtualBox的使用者中的群組加入vboxusers...重新開機

每當系統更新核心版本後,會無法啟動,需重新執行設定
[user]# sudo /etc/init.d/vboxdrv setup
安裝 VMware Workstation 6.0.2 虛擬機器,可安裝其他作業系統
網站:http://www.vmware.com/download/ws
下載:VMware-workstation-6.0.2-59824.i386.rpm
序號:YVDFH-56AF7-DANDC-4WTZ7

安裝C編譯器
[root]# yum install gcc

安裝kernel-devel
[root]# yum install kernel-devel

執行VMware安裝
[root]# /etc/vmware/installer.sh
.....全部都按 [enter] ....

實體記憶體 - 虛擬電腦記憶體 = linux 系統保留 386mb 以上
(256mb 執行VMware 記憶體不足,全畫面正常,視窗化切換較容易會當)
*.vmx 虛擬電腦
*.vmdk~*s011.vmdk 虛擬硬碟

每當系統更新核心版本後,會無法啟動,需重新執行設定
[user]# sudo /usr/bin/vmware-config.pl
安裝 VMware Workstation 6.5
網站:http://www.vmware.com/download/ws
教學:Fedora Core Linux 9 中安装VMware Tools-6.5.0
下載:VMware-Workstation-6.5.0-118166.i386.rpm
序號:0HTM9-QMZ8V-W2Q6E-4QDQA

下載:VMware-Workstation-6.5.0-118166.x86_64.rpm
序號:TVHWT-2WG82-P5NAF-4WVNY

執行VMware安裝
[root]# rpm -ivh VMware-Workstation-6.5.0-118166.x86_64.rpm

解決缺檔無法執行
教學:http://communities.vmware.com/message/1066582
下載:vmware-build-modules
[root]# sh ./vmware-build-modules
安裝 VMware Workstation 7.0
網站:http://www.vmware.com/download/ws
下載:VMware-Workstation-Full-7.0.0-203739.i386.bundle
序號:GV7MK-4PZ8M-H70JY-CFQQT-Y6AFF

下載:VMware-Workstation-Full-7.0.0-203739.x86_64.bundle
序號:VF3W8-88YEH-H759P-84YEZ-QU8AA

執行VMware安裝
[root]# ./VMware-Workstation-Full-7.0.0-203739.x86_64.bundle
反安裝移除 VMware Workstation
[root]# /usr/lib/vmware-installer/1.1/vmware-installer -u vmware-workstation
安裝 QEMU 虛擬機器,可安裝其他作業系統
網站:http://fabrice.bellard.free.fr/qemu/
維基:http://zh.wikipedia.org/w/index.php?title=QEMU&variant=zh-tw
[root]# yum install qemu dkms-kqemu

建立虛擬磁碟c.img 容量10G
[root]# qemu-img create -f qcow c.img 10G
光碟開機:(掛載光碟片 & 硬碟c.img & 記憶體256 & 由D磁碟開機
[root]# qemu -cdrom /dev/cdrom -hda c.img -m 256 -soundhw sb16 -boot d
影像檔開機:
[root]# qemu -cdrom winxp.iso -hda c.img -m 256 -soundhw sb16 -boot d
虛擬磁碟開機:
[root]# qemu -hda c.img -m 256 -soundhw sb16

安裝KQEMU圖形管理介面 KDE GUI For QEMU
網站:http://kqemu.sourceforge.net/
下載:kqemu-0.3Alpha.tgz
[root]# yum install kommander
[root]# tar -zxvf kqemu-0.3Alpha.tgz
[root]# kmdr-executor kqemu.kmdr

【10】網頁程式

安裝 phpMyAdmin UTF8版
網站:http://www.phpmyadmin.net
下載:phpMyAdmin-2.11.2.1-all-languages-utf-8-only.zip
解壓縮到網頁路徑下

安裝編碼模組
[root]# yum install php-mbstring php-mcrypt

執行網頁上"安裝程序"建立設定檔
Servers---Add
Authentication type (驗證類型)===>cookie
phpMyAdmin control user (管理員帳號)===>root
phpMyAdmin control user password (管理員密碼)===>12345678
phpMyAdmin database for advanced features (資料庫)===>phpmyadmin
Session name for signon auth(cookie名稱)===>skycity
Add---完成

將建立好的設定擋下載放入phpMyAdmin目錄
Configuration---Download---config.inc.php


錯誤訊息:Wrong permissions on configuration file, should not be world writable!
[root]# chmod 755 config.inc.php

畫面下方顯示:沒有找到PHP 外掛mbstring,而您現在好像在使用多字符字集。
[root]# yum install php-mbstring
[root]# service httpd restart

畫面下方顯示:缺少 mcrypt 外掛。請檢查 PHP 設定
[root]# yum install php-mcrypt
[root]# service httpd restart
安裝 phpMyAdmin UTF8版
網站:http://www.phpmyadmin.net
下載:phpMyAdmin-3.1.1-all-languages.zip
安裝 OpenWebMail
教學:http://openwebmail.org

下載安裝:
[root]# cd /etc/yum.repos.d
[root]# lftpget http://openwebmail.org/openwebmail/download/redhat/rpm/release/openwebmail.repo
[root]# yum install openwebmail

第一次執行:
[root]# /var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init

重新啟動網頁伺服器:
[root]# service httpd restart

網頁啟動:
http://www.skycity.com.tw/cgi-bin/openwebmail/openwebmail.pl
http://www.skycity.com.tw/webmail

系統預設值:
修改 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf
domainnames skycity.com.tw (預設網域)
default_language auto (預設語言)
default_iconset Cool3D.Chinese.Traditional (預設圖示)

客制化openwebmail功能:
修改 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf
enable_pop3 no (關閉user收取外部信箱功能)
enable_strictpwd no (密碼一定要有英數字)
passwd_minlen 5 (密碼最短長度)
enable_userfolders no (禁止user建立新的信件夾)
enable_spellcheck no (關閉拼字檢查功能)
enable_advsearch no (關閉進階搜尋功能)
enable_calenda no (關閉行事曆功能)
enable_webdisk no (關閉網路硬碟功能)
enable_userfilter no (關閉user自訂規則功能)

郵件過濾:Open WebMail 進階說明
修改 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf
default_filter_badaddrformat yes //過濾寄件人地址格式不正確的信件
default_filter_fakedsmtp yes //過濾偽造來源端的信件
default_filter_fakedfrom yes //過濾偽造寄件人地址的信件
default_filter_fakedexecontenttype yes //過濾偽造 EXE 附件型態的信件

建立使用者帳號
useradd -s /sbin/nologin mailadmin
設定使用者密碼
echo "skycity" | passwd --stdin mailadmin
刪除使用者帳號
userdel -r mailadmin

安裝 bandwidthd 紀錄各IP流量
下載安裝:
[root]# yum install bandwidthd
[root]# service bandwidthd start
[root]# service httpd restart
[root]# chkconfig bandwidthd on

設定偵測流量IP的位置或區段:
vi /etc/bandwidthd.conf
subnet 123.204.62.176 255.255.255.255

網頁啟動:
http://www.skycity.com.tw/bandwidthd
安裝 MRTG 繪製流量圖
教學:鳥哥 MRTG 流量偵測法

下載安裝:
[root]# yum install mrtg net-snmp

設定 snmpd:
[root]# echo 'rocommunity public' > /etc/snmp/snmpd.conf
啟動 snmpd:
[root]# service snmpd restart
[root]# chkconfig snmpd on

建立 MRTG 網頁目錄:
mkdir /skycity/mrtg
mkdir /skycity/mrtg/image

設定MRTG:
vi /etc/mrtg/mrtg.cfg
HtmlDir: /skycity/mrtg
ImageDir: /skycity/mrtg/image
LogDir: /var/lib/mrtg
ThreshDir: /var/lib/mrtg
Target[skycity.com.tw]: 2:public@127.0.0.1
MaxBytes[skycity.com.tw]: 1250000
Title[skycity.com.tw]: Traffic Analysis
PageTop[skycity.com.tw]: <H1>Stats for our Ethernet</H1>

第一次執行,產生圖檔:
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

製作首頁:
[root]# indexmaker --output=/skycity/mrtg/index.html /etc/mrtg/mrtg.cfg
[root]# cp /skycity/mrtg/skycity.com.tw.html /skycity/mrtg/index.html

出現錯誤訊息:
Use of uninitialized value $first in hash element at /usr/bin/indexmaker line 353
vi /usr/bin/indexmaker
my $first = $order[0];
改為
my $first = 127.0.0.1;

設定五分鐘偵測一次:
[root]# vi /etc/crontab
*/5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

網頁出現錯誤訊息,預設只能由本機查看,不開放外網瀏覽
You don't have permission to access /mrtg/ on this server.
vi /etc/httpd/conf.d/mrtg.conf
用#註解掉所有內容

修改伺服器時間,出現錯誤訊息:
Rateup WARNING: /usr/bin/rateup could not read the primary log file for skycity.com.tw
刪除 /var/lib/mrtg 目錄下的log及old檔案

不定時,出現錯誤訊息:
Rateup WARNING: /usr/bin/rateup could not read the primary log file for skycity.com.tw
設定五分鐘偵測一次,並忽略錯誤訊息
[root]# vi /etc/crontab
*/5 * * * * (LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg) > /dev/null 2>&1

重新啟動網頁伺服器:
[root]# service httpd restart

網頁啟動:
http://www.skycity.com.tw/mrtg
安裝購物車osCommerce 2.2 ms2 UTF8版
網站:http://www.kmd.com.tw/File/details.php?file=673
下載:osc22ms2update051113.zip
解壓縮到網頁路徑下,修改權限為777

修正無法進入後台錯誤
/catalog/admin/includes/classes/upload.php
$this = null; ===>改為 $this == null;

解決phpMyAdmin資料庫內容,中文顯示亂碼
修改phpMyAdmin/libraries/select_lang.lib.php
找到 @global array MySQL charsets map
'utf-8' = 'utf-8', ===>改為 'utf-8' = 'latin1',

由網頁執行安裝
http://localhost/catalog/install/

登入帳號 admin@localhost
登入密碼 admin

網頁標題顯示商品名稱
套件:http://www.kmd.com.tw/File/details.php?file=447
下載:show_products_name_in_title.rar

點選商品小圖示,彈出視窗顯示較多資訊
套件:http://www.kmd.com.tw/File/details.php?file=567
下載:more_info_in_popup_image.rar
修改 content="text/html; charset=iso-8859-1" ===> content="text/html; charset=utf-8"
安裝購物車ECSHOP v2.7
網站:http://ecshop.tw/download/
下載:ECShop_V2.7.0_UTF8_Release0720.zip
解壓縮到網頁路徑下,修改權限為777

由網頁執行安裝
http://localhost/自訂目錄/install
安裝iconv字碼轉換(無法使用時安裝)
網站:http://www.gnu.org/software/libiconv/
下載:libiconv-1.12.tar.gz

安裝C編譯器
[root]# yum install gcc

安裝iconv字碼轉換
[root]# tar zxvf libiconv-1.12.tar.gz
[root]# cd libiconv-1.12
[root]# ./configure --prefix=/usr/local
[root]# make
[root]# make install

範例:iconv.php
<?
$a = "轉換字碼";
$a=iconv("UTF-8", "Big5", $a);
echo "[UTF-8] - [Big5]= $a <br>\n";
$a=iconv("big5", "UTF-8", $a);
echo "[Big5] - [UTF-8]= $a <br>\n";
?>
安裝ImageMagick圖檔轉換程式
教學:利用imagemagick來作縮圖

安裝ImageMagick圖檔轉換程式,支援GIF.JPG.PNG.BMP轉檔
[root]# yum install ImageMagick

$exec_str="/usr/bin/convert -geometry ".$size." ".$big_image." ".$small_image;
exec($exec_str);

1.生成縮圖
a.指定大小
# convert -sample 80x40 input.jpg output.jpg
b.利用比例
# convert -sample 25%x25% input.jpg output.jpg

2.旋轉圖形
利用cotate參數,+90表順時針旋轉90度,而-90則表逆時針轉90度
# convert -rotate 90 input.jpg output.jpg

3.轉換格式
以附檔名為準,如下例就是將jpg轉換成png的用法
# convert input.jpg output.png

4.一次使用多種命令
# convert -sample 25%x25% -spread 4 \ -charcoal 4 input.jpg output.jpg

螢幕抓圖
[user]# import 檔名
轉換圖像格式
[user]# convert -geometry 寬x高 來源 目標
顯示圖片
[user]# display 檔名
使用API閘道傳送表單資料
教學:利用API介面傳送簡訊

範例:send_post.rar
<?
//POST 表單內資料
$msg = "test=send_post&data=12345678";
$num = strlen($msg);

//建立POST表單資料
$MSGData = "";
$MSGData .= "POST /index.php HTTP/1.1\r\n";
$MSGData .= "Host: www.skycity.com.tw\r\n";
$MSGData .= "Content-Length: ".$num."\r\n";
$MSGData .= "Content-Type: application/x-www-form-urlencoded\r\n";
$MSGData .= "Connection: Close\r\n\r\n";
$MSGData .= $msg."\r\n";

// 打開 API 閘道
$fp = fsockopen ("www.skycity.com.tw", 80);

//開始傳送
if ($fp){fputs ($fp, $MSGData);}

// 關閉閘道
fclose ($fp);
?>
執行用戶端外部程式
ActiveX 元件來源 http://flyff.omg.com.tw/activex/omg.cab
classid 物件編號 clsid:10060452-a92b-4427-8e06-46904b8a3678

ActiveXobj.LocalMachinePath = 'SOFTWARE\\...\\...\\App Path' 讀取登入檔中的機碼,並放入ActiveXobj.strKeyText變數中
ActiveXobj.strKeyText = 檔案開始執行時,所在的目錄位置,可自訂或由登入檔中載入;此參數省略時,預設位置為C:\
ActiveXobj.ExePath = 檔案名稱路徑
ActiveXobj.DoExecute() ==> 執行檔案

範例:執行用戶端外部程式.rar
<object id="ActiveXobj" classid="clsid:10060452-a92b-4427-8e06-46904b8a3678" codebase="omg.cab" width=0 height=0>

<script type='text/javascript'>
function startGame()
{
ActiveXobj.strKeyText = '';
ActiveXobj.ExePath = ActiveXobj.strKeyText + 'ping 168.95.1.1 /t';
ActiveXobj.DoExecute();
}
startGame();
</script>
播放FLV檔案
網站:JW FLV MEDIA PLAYER 4.290
教學:語法教學說明

範例:playflv.rar
使用Javascript:
<script type="text/javascript">
var so = new SWFObject('playflv.swf','mpl','470','320','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=http://content.bitsontherun.com/videos/3ta6fhJQ.flv&autostart=true');
so.write('player');
</script>

使用embed:
<embed
src="playflv.swf"
width="470"
height="320"
bgcolor="undefined"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="file=http://content.bitsontherun.com/videos/3ta6fhJQ.flv&autostart=true"
/>
會員帳號=虛擬目錄
範例:virtual.zip

自定錯誤頁
/etc/httpd/conf/httpd.conf
搜尋 # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
改為 ErrorDocument 404 /web/virtual.php <==自設為檔案所在網址
顯示即時通狀態圖示
網站:取得 MSN 使用者編號
語法:
<a href="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee= 使用者編號 @apps.messenger.live.com&mkt=zh-tw" target="_blank">
<img src="http://messenger.services.live.com/users/ 使用者編號 @apps.messenger.live.com/presenceimage?mkt=zh-tw" border="0" alt="MSN即時通"></a>

網站:Yahoo!奇摩即時通訊 - 顯示線上狀態
語法:
<a href="http://edit.yahoo.com/config/send_webmesg?.target= Yahoo帳號 &.src=pg" target="_blank">
<img src="http://opi.yahoo.com/online?u= Yahoo帳號 &m=g&t=5&l=tw" border="0" alt="Yahoo!即時通"></a>

網站:獲取 Skype 按鈕
語法:
<a href="skype: Skype帳號 ?chat">
<img src="http://mystatus.skype.com/smallicon/ Skype帳號 " border="0" alt="Skype在線狀態"></a>
php探针:iProber v0.024
官網:http://depoch.net/download.htm
下載:iProber.zip
PhpSpy2008:web後門
官網:http://www.4ngel.net/project/phpspy.htm
下載:phpspy_2008.rar
數字中文文字轉圖形
範例:text2image.zip
Call to undefined function imagecreatetruecolor() imageCreate() 的解決辦法
[root]# yum install php-gd
[root]# service httpd restart

備註: 檔案限定使用ANSI格式編輯,請勿使用utf-8

【11】安裝無線網路卡

安裝ndiswrapper,用windowns版本驅動程式,安裝無線網路卡
[root]# yum install kmod-ndiswrapper

確認usb介面是否有偵測到無線網路卡
[root]# lsusb
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 003: ID 0ace:1201 ZyDAS 802.11b WiFi
Bus 001 Device 001: ID 0000:0000

安裝windowns驅動程式
[root]# ndiswrapper -i ZD1201U.INF
installing zd1201u ...

確認無線網路卡是否已安裝成功
[root]# ndiswrapper -l
zd1201u : driver installed
    device (0ACE:1201) present (alternate driver: zd1201)

將裝置寫入模組
[root]# ndiswrapper -m
adding "alias wlan0 ndiswrapper" to /etc/modprobe.d/ndiswrapper ...

重新開機
[root]# reboot

啟動服務 wpa_supplicant 網路設定內硬體才會出現USB WLAN,該服務平時不需要啟動
[root]# service wpa_supplicant start

系統...管理...網路...新增網路裝置...無線網路連線...USB WLAN(wlan0)
設定無線網路資料...設定完成...啟用...重新開機

【12】安裝防毒軟體

安裝Avira AntiVir PersonalEdition Classic
網站:http://www.free-av.com/antivirus/allinonen.html
下載:antivir-workstation-pers.tar.gz
[root]# tar zxvf antivir-workstation-pers.tar.gz
[root]# cd antivir-workstation-*
[root]# ./install

Do you agree to the license terms? [n] y ===>版權說明
Enter the path to your key file: [hbedv.key] ===>按[ENTER] key在資料夾
Would you like to install the internet update daemon? [n] y ===>安裝線上更新軟體
Would you like to create a link in /usr/sbin for avupdater ? [y] y ===>建立捷徑
Would you like the internet update daemon to start automatically? [y] y===>自動線上更新
How should AvGuard be installed? [n] n ===>安裝即時守護者(AvGuard) 需要編輯核心
Would you like to install the GUI (+ SMC support)? [y] n ===>圖形化介面,無法使用
Would you like to configure the AntiVir updater now? [y] y ===>設定更新環境
Would you like email notification about updates? [n]
Would you like the updater to log to a custom file? [y]
? [/var/log/avupdater.log]
How often should AntiVir check for updates? [2] 2 ===>多久檢查更新 [2小時] or [一天] or [關閉]
Does this machine use an HTTP proxy server? [n] n ===>是否有使用代理伺服器
Save configuration settings? [y] y ===>設定完成,存檔
Would you like to apply the new configuration? [y] y ===>設定生效

要在使用者(非root)下使用AntiVir,需將使用者加入antivir的群組中

antivir --update [手動更新]
/usr/lib/AntiVir/configantivir ===>[設定自動更新]
/usr/lib/AntiVir/avupdater start ===>[啟動更新服務]
/usr/lib/AntiVir/avupdater stop ===>[停止更新服務]
/usr/lib/AntiVir/avupdater status ===>[查詢掃毒版本]
antivir-gui ===> 圖形化介面AntiVir-GUI與Java 1.5不相容,無法使用

key可以在http://www.avira.com/en/products/test_licence.html填寫資料後取得
安裝Clam AntiVirus
網站:www.clamav.net
[root]# yum install clamav clamav-update

指令: clamscan 路徑 ==> 掃毒
指令: freshclam ==> 線上更新

設定線上更新 /etc/freshclam.conf
Example ==> #Example

開啟 Openwebmail 的防毒功能:
/var/www/cgi-bin/openwebmail/etc/openwebmail.conf
enable_viruscheck no ==> enable_viruscheck yes
viruscheck_pipe /usr/bin/clamdscan --disable-summary --stdout -
viruscheck_source_allowed all
default_viruscheck_source all ==> 新增

【13】桌面美化

GNOME上的是gDesklets
[root]# yum install gdesklets
KDE上的是SuperKaramba
[root]# yum install superkaramba
安裝 桌面程式套件
網站:http://gdesklets.de/index.php?q=desklet/browse
執行 gDesklets...檔案...安裝套件..下載的套件...開啟
下載 GNOME 佈景主題
網站:http://compiz-themes.orgCompiz Themes
網站:http://art.gnome.orgArtwork & Themes
網站:http://www.gnome-look.orgGnome Themes
網站:http://www.kde-look.orgKDE Themes
網站:http://www.xfce-look.orgXfce Themes
網站:http://www.skinbase.orgWallpapers and Skins

Icon (圖示) 解到 ~/.icons
Desktop Theme (佈景主題)、Application (界面控制)、Window Border (視窗邊框) 解到 ~/.themes

系統...偏好設定...外觀與感覺...佈景主題
如果套件是完整的 "佈景主題", 會顯示在佈景主題清單中, 直接點選該佈景主題即可立即套用
如果套件是 "圖示" 或 "界面控制" 或 "視窗邊框", 可點選 "佈景主題詳細設定" 各別套用

加入開機啟動程序
系統...偏好設定...個人...作業階段...初始啟動程式...新增(N)...
名稱:gDesklets(自訂)
指令:gdesklets

【14】中文輸入

安裝gcin輸入
[root]# yum install gcin

加入嘸蝦米輸入法:
[root]# /usr/share/gcin/script/noseeing-inst

加入其它輸入法:
網站: http://cle.linux.org.tw/

教學說明:
[root]# gedit /usr/share/doc/gcin-*/README
安裝ibus輸入
[root]# yum install ibus*-*
變更輸入法
系統...偏好設定...個人...輸入法...使用自訂的輸入法(c)...登出生效

【15】開放使用者權限

切換為root帳號
[user]# su -l
加入使用sudo權限
[root]# chmod 777 /etc/sudoers
[root]# gedit /etc/sudoers
[root]# chmod 440 /etc/sudoers

/etc/sudoers
## Allows people in group wheel to run all commands(加入使用者)
# %wheel ALL=(ALL)ALL ===>使用者帳號 ALL=(ALL) ALL
## Same thing without a password(不詢問密碼)
# %users ALL=(ALL) NOPASSWD: ALL ===>使用者帳號 ALL=(ALL) NOPASSWD: ALL
加入使用掛載裝置權限
修改 /etc/fstab 開機自動掛載

掛載新的硬碟:
列出所有的磁碟碟代號
[root]# fdisk -l
建立掛載點目錄
[root]# mkdir /mnt/sdb2
修改 /etc/fstab 使用裝置代碼掛載
/dev/sdb2 /mnt/sdb2 ext3 defaults 2 2
修改 /etc/fstab 使用以存在的磁碟LABEL掛載
LABEL=/skycity /skycity ext3 defaults 2 2

掛載光碟機:
建立掛載點目錄
[root]# mkdir /media/dvd
修改 /etc/fstab 使用裝置代碼掛載
/dev/scd0 /media/dvd auto users,noauto,exec,iocharset=utf8 0 0

掛載隨身碟:
建立掛載點目錄
[root]# mkdir /media/usbdisk
修改 /etc/fstab 使用裝置代碼掛載
/dev/sdc1 /media/usbdisk auto users,noauto,exec,iocharset=utf8 0 0

掛載軟碟機:
建立掛載點目錄
[root]# mkdir /media/disk
修改 /etc/fstab 使用裝置代碼掛載
/dev/fd0 /media/disk auto users,noauto,exec,iocharset=utf8 0 0

將裝置重新掛載測試,若掛載出現錯誤,重開機後,會導致無法啟動。
[root]# mount -a

輸入資料錯誤導致無法開機,進入單人維護模式,解除 / 的read only 的狀態,才可修改檔案
[filesystem]# mount -n -o remount,rw /
[filesystem]# vi /etc/fstab
加入掛載NTFS支援
[root]# yum install ntfs-3g
FC10 用root登入圖形化桌面
[root]# gedit /etc/pam.d/gdm
auth required pam_succeed_if.so user != root quiet ===> 加註解#
新增使用者
網站:鳥哥的 Linux 私房菜 -- Linux 帳號管理

建立帳號&家的目錄:
[root]# useradd 帳號

建立密碼:
[root]# echo "密碼" | passwd --stdin 帳號

刪除帳號&家的目錄:
[root]# userdel -r 帳號

【16】系統優化

打開系統--》管理--》系統設定--》服務 或者 serviceconf 或者 ntsysv 或者 setup
ConsoleKit
Fedota 7的新功能Fedora - Fast User Switchin,如果你想要使用這個新功能就開著,反之關掉吧。
NetworkManager, NetworkManagerDispatcher
自動在多種網絡連接中進行轉換,如果你的電腦有Wireless WiFi 和 Ethernet,開著它吧, Fedora能自動為你選擇最好的可用連接。若只用一個網絡連接設置的,還是關掉吧。
anacron, atd, crond
這是一些調試程序的後台服務,一般的桌面用戶可以把anacron, atd關了,如果你打算常時間開機,那就把crond打開。
auditd
用於存放內核生成的系統審查記錄,這些記錄會被一些程序使用。特別是對於SELinux用戶來說,還是開著吧。
autofs
自動掛載隨身碟,沒什麼說的,開著。
avahi-daemon, avahi-dnsconfd
主要用於Zero Configuration Networking ,關吧,一般無用。
bluetooth, hcid, hidd, sdpd, dund
藍牙相關,無藍牙者,可以關。
btseed, bttrack
BT相關,無法用BT的,可以關了
capi
ISDN硬件支持,大部分用戶可以關了
cpuspeed
CPU速度調整,如果你用的是Pentium-M, Centrino, AMD PowerNow, Transmetta,ntel SpeedStep,
Athlon-64, Athlon-X2, Intel Core 2開著吧;如果不是還是關了吧,開著也無用。
cupsd
CUPS打印機支持,沒有打印機或者是其他類型打印機的,可以關了
dhcdbd
D-BUS系統網絡接口,主要為你提供網絡連接設置,強烈建議開著,除非你用固定IP上網。
dkms_autoinstaller
自動化重新編譯模組的服務,當核心升級後驅動程式模組將會自動重新編譯.
dnsmasq
DNS快取伺服器,不架DNS者可關
dund
藍牙相關,無者關
firstboot
Fedora安裝完之後的那個用戶嚮導,一般可以關了
gpm
Text console(CTRL-ALT-F1,F2..)鼠標支持,如果你不經常用Text console,可以關了
haldaemon
HAL(Hardware Abstraction Layer)服務,開著吧
hidd
藍牙相關,無者關
hplip, hpiod, hpssd
HPLIP打印機支持,如果你有開著吧。
httpd
Apache HTTP網頁伺服器器, 如果你不開發網頁,關吧
ip6tables
如果你不用 IPv6,關了
iptables
防火牆,沒什麼說的,開著
irda
紅外線設備支持,無者關
irqbalance
多核CPU支持, 無著關
isdn
ISDN modem支持, 無者關
jexec
如果你安裝java 1.6 就會有這個,讓你可以雙擊運行 *.jar 文件。不想要就關
kudzu
Fedora硬碟偵測服務,當你更換或添加硬碟的時候可以使用,平時可以關了
lirc
紅外線遙控器支持, 無者關
mcstrans
主要用於SELinux,如果你不用SELinux,可以關了
mdmonitor
RAID支持, 無者關
messagebus
Linux ICP 服務, 強列建議開著。
mysqld
mysql 伺服器,沒用到的可關
netfs
如果你需要網絡共享文件,那就開著
netplugd
對大部分用戶基本無用,關
network
沒什麼說的。開著;除非你不上網
nfs, nfslock
文件共享支持,不需要的可以關了
nscd
NIS, NIS+, LDAP, or hesiod服務密碼控制, 沒有這些服務的可以關了
ntpd
網絡時間同步,和windows的那個差不多,不需要的可以關了
nvidia 或者 nvidia-96XX 或者 nvidia-97XX
livna的nvidia顯卡驅動,開
pand
藍牙相關,無者關
pcscd
智能卡支持,無者關
proftpd
proftpd FTP伺服器,沒用到的可以關
psacct
監視系統資源及用戶使用狀況,一般用戶可以關(ac命令顯示用戶連接時間的統計,lastcomm命令顯示系統執行的命令
qemu
如果有安裝qemu就會有這個,讓你可以雙擊運行 *.exe 文件。不想要就關
rdisc
rdisc 路由器探索通訊協定(RDISC),一般用戶可以關
readahead_early, readahead_later
開機內存載入優化, 開著吧
restorecond
SELinux用於監控文件, 不用SELinux的可以關了
rpcbind
RPC服務,一般可以關閉
rpcgssd, rpcidmapd, rpcsvcgssd
NFS支持,不用NFS的可以關閉
sendmail
郵件傳送代理,如果你用Webmail 或者 Thunderbird, Kmail之類的來收發郵件。可以關了
setroubleshoot
SELinux Troubleshooting, 不用SELinux的可以關了
smartd
SMART Disk Monitoring, 監視擁有自我監視,分析和匯報技術的硬盤,開著吧
smolt
無用,關吧
sshd
OpenSSH服務器,通常可以關了,這是服務器端,關閉不影響ssh的使用
syslog
系統日誌,開著吧
vboxdrv,vboxnet
使用VirtualBox者,需開啟
vmware
使用vmware者,需開啟
vncserver
一般桌面用戶可以關了
vsftpd
vsftpd FTP伺服器,沒用到的可關
wine
如果有安裝wine就會有這個,讓你可以雙擊運行 *.exe 文件。不想要就關
winbind
不用Samba服務器的話, 可以關了
wpa_supplicant
無線網路設備,新增網路設備後,需開啟才會出現裝置.平時關閉不會影響無線上網
ypbind
不用NIS/YP,可以關了
yum-update
自動定期升級檢測, 如果你經常手動升級。可以關了
儲存設定,重新啟動

【17】安全防護

定時檢查連線數量(防砍站)
網站:http://bbs.mychat.to/read.php?tid=589326&page=e
下載:block_http.rar

檔名為block_http,將此檔放入/usr/local/bin/的目錄下
說明:每隔2分鐘檢查一次,檢查若發現某個IP連線次數超過MAX_TRY的值,就阻擋該IP
說明:每隔一段時間,自動清除BLOCKCHAIN

循環執行的例行性命令(使用其中一種)
1.使用者的設定:
執行 crontab -e 加入內容如下
*/2 * * * * /usr/local/bin/block_http
00 01 * * * /sbin/iptables -F blockhttp

2.系統的設定:
直接修改 /etc/crontab 這個檔案,加入內容如下
*/2 * * * * root /usr/local/bin/block_http
00 01 * * * root /sbin/iptables -F blockhttp

重新啟動 crond 服務(使用其中一種)
service crond restart
/etc/init.d/crond restart

如果不懂 crond 用法,請參考這裡【鳥哥-例行性命令的建立】
網站:http://linux.vbird.org/linux_basic/0430cron.php
使用命令列,顯示目前連接到本機的 IP 及流量的資料
[root]# yum install iftop
[root]# iftop
掃瞄主機開放那些服務通道(port)
[root]# yum install nmap
[root]# nmap 127.0.0.1
使用 iptables 拒絕特定IP連線
[root]# iptables -A INPUT -i eth0 -p tcp -s 192.168.1.201 -j DROP

檢查指令是否有效
[root]# iptables -L
限制連線範圍
[root]# yum install tcp_wrappers

設定服務開放給特定的連線範圍:
/etc/hosts.allow
in.telnetd: 123.204.62.176/255.255.255.0, 123.204.62.176, .skycity.com.tw : Allow
in.proftpd: 123.204.62.176/255.255.255.0, 123.204.62.176, .skycity.com.tw : Allow

設定服務拒絕特定連線範圍:
/etc/hosts.deny
in.telnetd: ALL : Deny
in.proftpd: ALL : Deny

123.204.62.176/255.255.255.0 [C class 範圍]
123.204.62.176 [單一IP]
skycity.com.tw [網域名稱]
提高 sshd 安全,禁止 非root帳號 登錄
建立 /etc/nologin
一般身份使用者登入顯示 nologin 內容後中斷連線
一直要到 /etc/nologin 被移除後,一般身份使用者才能夠再次的登入
提高 sshd 安全,禁止 root 登錄
/etc/ssh/sshd_config
#PermitRootLogin yes
改為
PermitRootLogin no

重新啟動服務:
[root]# service sshd restart
以 Fail2ban 封鎖嘗試侵入的 IP
[root]# yum install fail2ban

啟動服務:
[root]# service fail2ban restart
[root]# chkconfig fail2ban on
封鎖「暴力法」入侵 SSH 的使用者
網站:如何及時封鎖想要用「暴力法」以 SSH 入侵的使用者
下載:block_ssh.pl

下載 block_ssh.pl,將檔案存放在 [/usr/bin],並將權限設為 755:
[root]# cd /usr/bin
[root]# wget http://www.vixual.net/download/source/block_ip/block_ssh_pl
[root]# mv block_ssh_pl block_ssh.pl
[root]# chmod 755 block_ssh.pl

編輯 /etc/hosts.allow,加入:
sshd : ALL : spawn (/usr/bin/block_ssh.pl %c %d)
關閉 icmp 不回應 ping
[root]# iptables -I INPUT -p icmp --icmp-type 8 -j DROP

加入 /etc/sysconfig/iptables 啟動自動生效
-A INPUT -p icmp --icmp-type 8 -j DROP

【18】登入模式

設定開機登入模式
修改 /etc/inittab
# 0 - halt (Do NOT set initdefault to this) ---> 關機「不可設定」
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode ---> 終端機
# 4 - unused
# 5 - X11 ---> 圖形化桌面
# 6 - reboot (Do NOT set initdefault to this) ---> 重開機「不可設定」
#
id:5:initdefault: ---> 預設-圖形化桌面
用root帳號切換
[root]# init 0 ---> 關機
[root]# init 3 ---> 關閉X-Windows
[root]# init 5 ---> 啟動X-Windows
[root]# init 6 ---> 重開機
自動登入 GNOME 桌面
教學:Jamyy's Weblog: 自動登入 Linux 系統

編輯 /etc/gdm/custom.conf
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=root
TimedLoginEnable=true
TimedLogin=root
TimedLoginDelay=0
自動登入 tty 文字介面
教學:酷!學園 - 要如何在ubuntu下自動登入文字模式..疑問!?

新建立 /sbin/autologin
#!/bin/sh
exec 0/dev/$1 2>&1
shift
exec $*

改為可執行權限
[root]# chmod +x /sbin/autologin

修改 /etc/event.d/tty1
respawn
exec /sbin/mingetty tty1 ==> #exec /sbin/mingetty tty1
exec /sbin/autologin tty1 login -f root
關閉Ctrl+Alt+Del之功能
修改 /etc/event.d/control-alt-delete
start on control-alt-delete ===> 前面加上#註解
exec /sbin/shutdown -r now "Control-Alt-Delete pressed" ===> 前面加上#註解
[root]# /sbin/init q ===> 強制init程序立即重新查看開機載入相關資訊

【19】資料救援

啟動Linux單人模式,登入系統
* 開機後按上下方向鍵,會出現選單
* 在第一個項目 LinuX 上按 e 鍵,開啟 boot loader screen
* 移到第二個項目 kernel 那一行,再按 e 鍵,進入編輯這行的畫面
* 在這一行指令最後面,先空一格再加上 single ,按 Enter,回到 boot loader screen
* 按 b 鍵,啟動Linux單人模式
硬碟資料修復--[當機後,啟動失敗]
# fsck 按 Enter,執行掛載修復
# 所有選項(y/n)皆按 y
# reboot 按 Enter,重開機
重設遺忘的LINUX密碼
# passwd 更改 root 密碼
# shutdown -r now 重開機
分隔線
skycity_D1 會員中心遊客中心系統公告消費者保護網路安全兒童網路安全
關於天空之城聯絡天空之城服務條款隱私權聲明網頁連結說明
天空之城 SkyCity © 2002-2017 SkyCity internet Inc,All Rights Reserved.
地址:新北市板橋區龍興街99巷47號1樓 客服:(02)8275-2832 傳真:(02)8275-1802
No.47, Ln. 99, Longsing St., Banciao Dist., New Taipei City Tel:(02)8275-2832 Fax:(02)8275-1802
普級 skycity_D3