久久精品国产一区二区三区免费看 ,亚洲专区一区,亚洲免费av一区二区http://www.aygfsteel.com/sealyu/category/30673.html--- The devil's in the Detailszh-cnMon, 09 Aug 2010 08:28:01 GMTMon, 09 Aug 2010 08:28:01 GMT60Linux 與 BSD 之間的 10 個(gè)不同之處(轉(zhuǎn))http://www.aygfsteel.com/sealyu/archive/2010/08/09/328281.htmlsealsealMon, 09 Aug 2010 01:02:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/08/09/328281.htmlhttp://www.aygfsteel.com/sealyu/comments/328281.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/08/09/328281.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/328281.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/328281.html

你是否經(jīng)常會(huì)聽(tīng)到人們把 Linux 及 BSD 系統(tǒng)混為一談?是的,我有時(shí)會(huì)經(jīng)常聽(tīng)到一些新手,甚至于媒體都這么說(shuō)。當(dāng)然,事實(shí)上這兩者確實(shí)有很多相似之處,比如它們都是基于 Unix 演變而來(lái),而且基本上這兩類系統(tǒng)都是由非盈利組織及團(tuán)隊(duì)開(kāi)發(fā),另外我更想說(shuō)的是,這兩個(gè)系統(tǒng)都有一個(gè)共同的目標(biāo)–那就是創(chuàng)建最有用、最可靠的操作系統(tǒng)。


不過(guò)話說(shuō)回來(lái),這兩個(gè)系統(tǒng)確實(shí)存在著明顯的差異,當(dāng)人們忽略這點(diǎn)的時(shí)候,整個(gè) BSD 社區(qū)都會(huì)感到異常的憤怒,因此我們也可以經(jīng)常看到 BSD 社區(qū)人員或 BSD 用戶會(huì)對(duì) Linux 不屑一顧。因此,我會(huì)盡我所能來(lái)幫助我的 BSD 的弟兄們,讓更多的人了解到 Linux 與 BSD 的不同之處在哪里。

1、許可證

正如我們所知道的,Linux 操作系統(tǒng)是基于 GPL 許可證授權(quán)下的。該許可證可防止開(kāi)源軟件被轉(zhuǎn)換為封閉源代碼軟件及確保源代碼的可用性。 GPL 許可證的目的就是防止二進(jìn)制包成為唯一的軟件發(fā)行源。

而 BSD 許可證的限制則要少得多,它甚至允許二進(jìn)制包成為唯一的發(fā)行源。這就是核心差異,可以這樣理解:GPL 許可證讓您有權(quán)擁有任何你想要使用該軟件的方法,但你必須確保提供源代碼給下一個(gè)使用它的人(包括你對(duì)它的改變部分)。而 BSD 許可證并不是要求你必須那么做。( 譯者注:這里分別維基百科上對(duì) BSDGPL 許可證的解釋)

2、代碼控制

BSD 的代碼不是被控制在任何一個(gè)人手里,而 Linux 的內(nèi)核基本上被 Linus Torvalds ( Linux 創(chuàng)始人 ) 所控制,BSD 并沒(méi)有單一的人來(lái)說(shuō)什么可以或什么不可以進(jìn)入代碼。 <script src="/javascripts/tinymce/themes/advanced/langs/zh.js" type="text/javascript"></script><script src="/javascripts/tinymce/plugins/javaeye/langs/zh.js" type="text/javascript"></script> 相反,BSD 通過(guò)一個(gè)核心小組 ” Core Team” 來(lái)管理該項(xiàng)目,這個(gè)核心小組比非核心小組有更多的發(fā)言權(quán)來(lái)指導(dǎo) BSD 社區(qū)的發(fā)展方向,(譯者注:而據(jù)我所知,F(xiàn)reeBSDD 核心小組的成員會(huì)每?jī)赡赀x舉一次。)

3、內(nèi)核 vs 操作系統(tǒng)

BSD 項(xiàng)目維護(hù)的是整個(gè)操作系統(tǒng),而 Linux 則只是主要集中在單一的內(nèi)核上面。這點(diǎn)確實(shí)是需要注意的,雖然這兩個(gè)系統(tǒng)上都運(yùn)行著許多相同的軟件。

4、UNIX-Like

這里有一個(gè)關(guān)于 BSD vs Linux 的古老說(shuō)法:” BSD is what you get when a bunch of UNIX hackers sit down to try to port a UNIX system to the PC. Linux is what you get when a bunch of PC hackers sit down and try to write a UNIX system for the PC “,這里表達(dá)了很多。你會(huì)發(fā)現(xiàn) BSD 系統(tǒng)更為類似于 UNIX ,而事實(shí)上它就是傳統(tǒng) UNIX 的直接衍生品。而 Linux ,則是一個(gè)松散的基于 UNIX 衍生品 ( Minix ) 而新創(chuàng)建的一個(gè) OS 。

5、基本系統(tǒng)

這是一個(gè)關(guān)于 BSD 與 Linux 之間差異的至關(guān)重要的理念。 Linux 的”基本系統(tǒng)” 是并不真正存在的,許多人會(huì)說(shuō),Linux 的基本系統(tǒng)就是內(nèi)核,但問(wèn)題是如果沒(méi)有任何可用的應(yīng)用程序的話,那么這個(gè)內(nèi)核是完全沒(méi)有價(jià)值的。而另一方面,BSD 則有一個(gè)包括眾多工具的基本系統(tǒng), 甚至 libc 也是基本系統(tǒng)的一部分。因?yàn)檫@些組件都被作為一個(gè)基本系統(tǒng),所以它們都是被一起開(kāi)發(fā)和打包的,許多事實(shí)表明這樣更能創(chuàng)建出一個(gè)更具凝聚力的整體。

6、更多來(lái)自于源代碼

由于 BSD 的開(kāi)發(fā)方式(使用 Ports 系統(tǒng) ) 的關(guān)系,所以用戶們更多的是從源代碼來(lái)安裝程序,而不是預(yù)先編譯好的二進(jìn)制包。這是一個(gè)優(yōu)勢(shì)還是劣勢(shì)?這取決于不同的用戶。如果你更多的想從友好或易用性 方面考慮的話,看到這一點(diǎn)后你也許會(huì)有放棄的念頭,對(duì)于新用戶更是如此。但一些新的用戶也有想要從源代碼編譯安裝,這可能比較累人。但是,從源碼安裝也有 一定的優(yōu)勢(shì),比如(庫(kù)版本控制,通過(guò)特殊的包來(lái)構(gòu)建系統(tǒng)等等)。

7、升級(jí)

由于 BSD 的開(kāi)發(fā)方式的原因(見(jiàn)第5項(xiàng)),你可以利用一條指令就可以升級(jí)你的基本系統(tǒng)到最新版本 ( Freebsd 下是用 freebsd-update fetch update 命令)。或者你也可以下載整個(gè)源代碼樹(shù),然后通過(guò)編譯來(lái)升級(jí)。而在 Linux 中,你也可以通過(guò)內(nèi)置的包管理系統(tǒng)來(lái)升級(jí)系統(tǒng)。前者 (BSD) 僅更新基本系統(tǒng),而后者 ( Linux ) 則會(huì)升級(jí)整個(gè)系統(tǒng)。不過(guò)請(qǐng)記住,BSD 中升級(jí)到最新的基本系統(tǒng)并不意味著所有的附加軟件包也將會(huì)被更新,而 Linux 升級(jí)的時(shí)候,所有的軟件包都會(huì)被升級(jí)。這是否意味著 Linux 處理得更好嗎?在我看未必。我經(jīng)常會(huì)看到 Linux 在升級(jí)時(shí)出現(xiàn)嚴(yán)重錯(cuò)誤,從而需要重新安裝整個(gè)系統(tǒng),但這個(gè)現(xiàn)象基本不太可能發(fā)生在 BSD 的升級(jí)過(guò)程中。

8、前沿技術(shù)

基本上你不太可能會(huì)看到 BSD 系統(tǒng)運(yùn)行著任何非常前沿版本的軟件。而在 Linux 這一方面,大量的發(fā)行版會(huì)分發(fā)前沿版本的軟件包。如果你是一個(gè) ” If it isn’t broken, don’t fix it” 這樣觀點(diǎn)的持有者的話,你將會(huì)是 BSD 的超級(jí)粉絲。但是,如果你很新潮,想要體驗(yàn)一切最新的東西,那么你最好盡快遷移到 Linux 。

9、硬件支持

你會(huì)發(fā)現(xiàn),通常情況下 Linux 的硬件支持要比 BSD 更早一些。但這并不是說(shuō) BSD 沒(méi)有像 Linux 那樣支持足夠多的硬件,它只是意味著在某些情況下 Linux 會(huì)在 BSD 之前先支持某些硬件。因此,如果你想要最新的、最好的顯卡的話,基本上不用考慮 BSD 了。如果你有一個(gè)包含了最新無(wú)線芯片的新型筆記本的話,建議你選擇 Linux,運(yùn)氣好的話也許它會(huì)支持。

10、用戶群

在這里我冒險(xiǎn)概括一下計(jì)算機(jī)用戶們,但我想先聲明一下每一個(gè)事物都有例外。下面我要向你展示我對(duì)用戶分布方面的概括。

Mac –> Windows –> Linux –> BSD –> UNIX

從左邊到右邊,分別是”使用該 OS 的人里精通電腦的用戶群最少”到”使用該 OS 的人里精通電腦的用戶群最多”的過(guò)渡。我們可以看到,Linux的被放置在了中間,而 BSD 則更接近于右邊。許多人會(huì)對(duì)此有爭(zhēng)論,也有些人可能會(huì)感覺(jué)被冒犯了。但是,個(gè)人認(rèn)為這是一個(gè)對(duì)”哪些用戶使用哪些系統(tǒng)”相當(dāng)準(zhǔn)確的概括。

其他的不同點(diǎn)?

這個(gè)列表并不想表明哪個(gè)系統(tǒng)比哪個(gè)更好。事實(shí)上,BSD 和 Linux 各有著自己的亮點(diǎn)。你認(rèn)為怎么樣?有興趣的話也請(qǐng)表達(dá)出你的觀點(diǎn)。



seal 2010-08-09 09:02 發(fā)表評(píng)論
]]>
Ubantu10.04安裝RabbitVCS方法(轉(zhuǎn))http://www.aygfsteel.com/sealyu/archive/2010/07/28/327280.htmlsealsealWed, 28 Jul 2010 01:21:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/07/28/327280.htmlhttp://www.aygfsteel.com/sealyu/comments/327280.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/07/28/327280.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/327280.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/327280.html
RabbitVCS是Linux下替代TortoiseSVN的一個(gè)可視化工具,非常不錯(cuò)!
1. Go to http://wiki.rabbitvcs.org/wiki/download and click on the PPA link
2. Add "deb http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu lucid main" to
/etc/apt/sources.list as requested
3. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 34EF4A35
4. sudo apt-get update
5. sudo apt-get install rabbitvcs-cli rabbitvcs-core rabbitvcs-gedit rabbitvcs-nautilus rabbitvcs-thunar thunarx-python
6. reboot


seal 2010-07-28 09:21 發(fā)表評(píng)論
]]>
ubuntu 10.04源 更新源列表(轉(zhuǎn))http://www.aygfsteel.com/sealyu/archive/2010/07/22/326808.htmlsealsealThu, 22 Jul 2010 02:32:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/07/22/326808.htmlhttp://www.aygfsteel.com/sealyu/comments/326808.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/07/22/326808.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/326808.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/326808.html臺(tái)灣

代碼:
deb http://tw.archive.ubuntu.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid main universe restricted multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe main multiverse restricted


SRT Sources

代碼:
deb http://ubuntu.srt.cn/ubuntu/ lucid main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-security main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-updates main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-proposed main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-backports main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-security main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-updates main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-proposed main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-backports main restricted universe multiverse


網(wǎng)易(速度很快)

代碼:
deb http://mirrors.163.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-updates universe main multiverse restricted



ubuntu官方上海源,提供 Kernel,Hiweed,ubuntu

代碼:
deb http://mirror.rootguide.org/ubuntu/ lucid main universe restricted multiverse
deb-src http://mirror.rootguide.org/ubuntu/ lucid main universe restricted multiverse
deb http://mirror.rootguide.org/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://mirror.rootguide.org/ubuntu/ lucid-security universe main multiverse restricted
deb http://mirror.rootguide.org/ubuntu/ lucid-updates universe main multiverse restricted
deb http://mirror.rootguide.org/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://mirror.rootguide.org/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://mirror.rootguide.org/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirror.rootguide.org/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirror.rootguide.org/ubuntu/ lucid-updates universe main multiverse restricted 


搜狐

代碼:
deb http://mirrors.shlug.org/ubuntu/ lucid main universe restricted multiverse
deb-src http://mirrors.shlug.org/ubuntu/ lucid main universe restricted multiverse
deb http://mirrors.shlug.org/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://mirrors.shlug.org/ubuntu/ lucid-security universe main multiverse restricted
deb http://mirrors.shlug.org/ubuntu/ lucid-updates universe main multiverse restricted
deb http://mirrors.shlug.org/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://mirrors.shlug.org/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://mirrors.shlug.org/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.shlug.org/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.shlug.org/ubuntu/ lucid-updates universe main multiverse restricted


骨頭源,骨頭源是bones7456架設(shè)的一個(gè)Ubuntu源 ,提供ubuntu,deepin

代碼
deb http://ubuntu.srt.cn/ubuntu/ lucid main universe restricted multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid main universe restricted multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-security universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ lucid-updates universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-updates universe main multiverse restricted



seal 2010-07-22 10:32 發(fā)表評(píng)論
]]>
How to change your default locale on Ubuntu Linuxhttp://www.aygfsteel.com/sealyu/archive/2010/05/22/321591.htmlsealsealFri, 21 May 2010 16:16:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/05/22/321591.htmlhttp://www.aygfsteel.com/sealyu/comments/321591.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/05/22/321591.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/321591.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/321591.html
They are all related to Ubuntu's default British locale: en_GB.UTF-8

This was causing files checked out of CVS to be in Unicode (UTF-8) format rather than ISO-8859-1 and so the British pound sign (£) was being encoded as a double-byte (rather than single-byte) character in the file.

To check which locale you currently have as your default just run: locale

Changing the default locale is a little different on Ubuntu compared to most Linux distros, these are the steps we needed to go through to get it changed:

Add the locale to the list of 'supported locales'
Edit /var/lib/locales/supported.d/local and add the following line:
en_GB ISO-8859-1

Regenerate the supported locales
Run sudo dpkg-reconfigure locales

Change the default locale
Edit /etc/environment and ensure the LANG and LANGUAGE lines read as follows:
LANG="en_GB"
LANGUAGE="en_GB:en"


UPDATE '09: An old collegue has suggested that this change should now be made in /etc/default/locale rather than /etc/environment - Thanks Guy!

Reboot!

Rerun locale to check that your default locale is now en_GB


seal 2010-05-22 00:16 發(fā)表評(píng)論
]]>
改變ubuntu的命令行語(yǔ)言為英文(Language:en) [轉(zhuǎn)載]http://www.aygfsteel.com/sealyu/archive/2010/05/22/321590.htmlsealsealFri, 21 May 2010 16:12:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/05/22/321590.htmlhttp://www.aygfsteel.com/sealyu/comments/321590.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/05/22/321590.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/321590.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/321590.html1、修改/etc/default/locale, 改為:

LANG="en_US.UTF-8"

LANGUAGE="en_US:en"

2、sudo reboot

3、locale

顯示環(huán)境變量已經(jīng)全部是英文

seal 2010-05-22 00:12 發(fā)表評(píng)論
]]>
ubuntu 10.04安裝jdkhttp://www.aygfsteel.com/sealyu/archive/2010/05/03/319972.htmlsealsealMon, 03 May 2010 13:44:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/05/03/319972.htmlhttp://www.aygfsteel.com/sealyu/comments/319972.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/05/03/319972.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/319972.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/319972.html To enable Partner Repo:
SYSTEM -> ADMINISTRATION -> SOFTWARE SOURCES -> OTHER SOFTWARE -> ADD
deb http://archive.canonical.com/ lucid partner

Then CLOSE window and RELOAD, then search for Sun Java
You should find Version 6.20 ..... Install



seal 2010-05-03 21:44 發(fā)表評(píng)論
]]>
ubuntu新建用戶并添加到管理組(轉(zhuǎn))http://www.aygfsteel.com/sealyu/archive/2010/05/01/319839.htmlsealsealFri, 30 Apr 2010 16:13:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/05/01/319839.htmlhttp://www.aygfsteel.com/sealyu/comments/319839.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/05/01/319839.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/319839.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/319839.html用recovery mode模式啟動(dòng)后,進(jìn)入命令行模式,提示符應(yīng)該是 #

1、輸入用戶管理的命令,新建用戶(以test為例):
useradd test

修改 test 用戶的密碼:
passwd test

2、將新用戶添加到管理組:
gpasswd -a test admin

3、給 test 用戶創(chuàng)建自己的目錄:
cd /home

mkdir test

chown test /home/test

4、重新啟動(dòng),
reboot

然后用 test 登錄,

登錄以后,點(diǎn)菜單“系統(tǒng)-系統(tǒng)管理-用戶和組”,進(jìn)去選中你的用戶,點(diǎn)右邊的“屬性”按鈕,到用戶權(quán)限里打勾需要的;



seal 2010-05-01 00:13 發(fā)表評(píng)論
]]>
ubuntu 407 proxy(轉(zhuǎn))http://www.aygfsteel.com/sealyu/archive/2009/10/14/298212.htmlsealsealWed, 14 Oct 2009 06:55:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/10/14/298212.htmlhttp://www.aygfsteel.com/sealyu/comments/298212.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/10/14/298212.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/298212.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/298212.htmlcntlm 吧,比ntlmaps 好用些!

在 公司里面,網(wǎng)絡(luò)訪問(wèn)都是通過(guò)ISA Server的(Microsoft® Internet Security and Acceleration Server),在使用Windows的時(shí)候不會(huì)出現(xiàn)任何問(wèn)題,可是前兩天裝了Ubuntu Linux,遇到了些問(wèn)題。

我使用firefox訪問(wèn)網(wǎng)絡(luò)沒(méi)有問(wèn)題,只需要設(shè)好代理服務(wù)器地址,瀏覽網(wǎng)站時(shí)輸入相應(yīng)的用戶名和密碼即可,但在console下面使用apt-get更新系統(tǒng)時(shí)有問(wèn)題。

開(kāi)始我覺(jué)得應(yīng)該這樣設(shè)置代理:
export http_proxy=http://domaindomainuser:password@proxy.corpnet.com:8080

可是總會(huì)出現(xiàn)這個(gè)錯(cuò)誤:
407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. )

后來(lái)在網(wǎng)上搜索了一下,找到方法解決這個(gè)問(wèn)題了:

Download ntlmaps-0.9.9.0.1 from here

$ tar -zxvf ntlmaps-0.9.9.0.1

$ vim ntlmaps-0.9.9.0.1/server.cfg

Edit PARENT_PROXY,PARENT_PROXY_PORT,USER,PASSWORD to match your preferences, then run main.py

$ ./ntlmaps-0.9.9.0.1/main.py &

$ export http_proxy="http://127.0.0.1:5865 "

$ sudo apt-get update

Now, everything is OK.

seal 2009-10-14 14:55 發(fā)表評(píng)論
]]>
Ubuntu下Firefox使用flash插件亂碼問(wèn)題http://www.aygfsteel.com/sealyu/archive/2009/05/11/270000.htmlsealsealMon, 11 May 2009 02:12:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/05/11/270000.htmlhttp://www.aygfsteel.com/sealyu/comments/270000.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/05/11/270000.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/270000.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/270000.html sudo apt-get remove swfdec-mozilla
但是安裝過(guò)后還是亂碼,后來(lái)發(fā)現(xiàn)是字體配置文件的原因,解決方法:
$ sudo rm /etc/fonts/conf.d/49-sansserif.conf
然后重啟firefox。



seal 2009-05-11 10:12 發(fā)表評(píng)論
]]>
gsopcast頻道地址http://www.aygfsteel.com/sealyu/archive/2009/04/08/264438.htmlsealsealWed, 08 Apr 2009 04:58:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/04/08/264438.htmlhttp://www.aygfsteel.com/sealyu/comments/264438.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/04/08/264438.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/264438.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/264438.html

seal 2009-04-08 12:58 發(fā)表評(píng)論
]]>
ubuntu 聽(tīng)在線音樂(lè)http://www.aygfsteel.com/sealyu/archive/2009/03/10/258741.htmlsealsealTue, 10 Mar 2009 02:58:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/03/10/258741.htmlhttp://www.aygfsteel.com/sealyu/comments/258741.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/03/10/258741.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/258741.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/258741.htmlsudo apt-get remove totem-mozilla

這樣firefox就會(huì)用MPLAYER的播放了

sudo apt-get install mplayer mozilla-mplayer

安裝mplayer的插件。

同時(shí)在about:config里增加了兩個(gè)配置項(xiàng):

Network.protocol-handler.app.mms   string /usr/bin/mplayer

Network.protocal-handler.external.mms boolean True

restart it ,就OK了。


同時(shí)可以參考:

1、安裝軟件和相應(yīng)解碼器

sudo apt-get install mplayer mozilla-mplayer totem-xine libxine-extracodecs w32codecs audacious

安裝后 audacious 能播放 ogg*, flac*, MP3, wma, wav, 3gp 這些格式。安裝后 mplayer 和 totem 能播放 xvid/divx 編碼的 avi 格式視頻, rm/rmvb/asf/wmv 等流媒體視頻,外加 vcd/dvd 和其他 mpeg2/mpeg4 視頻。

1) 如果要讓 Rhythmbox 和 Banshee 這些使用 gstreamer 為后端的播放器,能播放 MP3, wma, ra, ram, wav 等格式音樂(lè),就裝上:

sudo apt-get install gstreamer0.10-plugins-ugly gstreamer0.10-pitfdll gstreamer0.10-ffmpeg

2) 如果要讓 audacious 播放 APE 格式的音樂(lè):

sudo apt-get install audacious-mac

3) 如果需要把 APE 轉(zhuǎn)換為 FLAC:

sudo apt-get install mac flac cuetools shntool
cuebreakpoints xx.cue |shnsplit -o flac -n xx xx.ape
2、Mplayer 的中文字幕設(shè)置方法

1) 在 Preferences-Font 里面點(diǎn)擊 ”Browse” 選擇一個(gè)中文字體,Encodeing 選擇 Unicode。

2) 在 Preferences-Subtitle&OSD 里面的 Encoding 選擇:

Simplified Chinese Charset(cp936)


3) 在 Preferences-Font “Text scale” 這里調(diào)整字幕大小(我調(diào)整為 3.8 )。

如果播放時(shí)提示錯(cuò)誤,設(shè)置一下:

Preferences-Video 選擇 “xv X11/Xv”
Preferences-Codecs&demuxer 選擇 “FFmpeg/libavcodec audio decoders”

3、使用 Firefox 在線播放解決辦法

1) 內(nèi)嵌播放,可以安裝 MediaWrap 這個(gè)擴(kuò)展。

2) 如果喜歡調(diào)用外部播放器播放,安裝 MediaPlayerConnectivity 。

4、Totem 播放 rmvb 沒(méi)有聲音,這里給出了解決方法:

編輯 ~/.xine/catalog.cache 文件:
gedit ~/.xine/catalog.cache

找到
[/usr/lib/xine/plugins/1.1.4/xineplug_decode_real_audio.so]

把 decoder_priority 后面的數(shù)字修改為 10。


seal 2009-03-10 10:58 發(fā)表評(píng)論
]]>
ubuntu設(shè)置固定IPhttp://www.aygfsteel.com/sealyu/archive/2009/03/04/257777.htmlsealsealWed, 04 Mar 2009 06:10:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/03/04/257777.htmlhttp://www.aygfsteel.com/sealyu/comments/257777.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/03/04/257777.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/257777.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/257777.html首先設(shè)置IP

sudo gedit /etc/network/interface

將其內(nèi)容刪除

加上一下內(nèi)容

auto lo

iface lo inet loopback

auto etho

iface etho inet static

address 192.168.0.168

netmask 255.255.255.0

network 192.168.0.0

broadcast 192.168.0.255

gateway 192.168.0.1

保存

然后修改DNS

sudo gedit /etc/resolv.conf

將內(nèi)容修改為

nameserver 202.103.24.68

保存

重啟網(wǎng)絡(luò)連接

sudo /etc/init.d/networking stop

sudo /etc/init.d/networking start



seal 2009-03-04 14:10 發(fā)表評(píng)論
]]>
ubuntu java環(huán)境配置http://www.aygfsteel.com/sealyu/archive/2009/03/04/257760.htmlsealsealWed, 04 Mar 2009 04:31:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/03/04/257760.htmlhttp://www.aygfsteel.com/sealyu/comments/257760.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/03/04/257760.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/257760.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/257760.htmlJava安裝配置

出自Ubuntu中文

打開(kāi)終端,執(zhí)行以下命令,或使用Adept/新立得軟件管理器,在其中分別搜索"sun-java6-jre"和"sun-java6-jdk"并標(biāo)記安裝。

sudo apt-get install sun-java6-jre

如果空間富裕,建議安裝一個(gè)JDK。

sudo apt-get install sun-java6-jdk

提示:安裝過(guò)程中需要你回答是否同意使用協(xié)議(終端中紅藍(lán)色的提示界面),此時(shí)按tab鍵至OK,再按回車即可正常安裝。

設(shè)置當(dāng)前默認(rèn)的java解釋器:

sudo update-alternatives --config java

執(zhí)行后會(huì)出現(xiàn)類似如下的畫面:

There are 2 alternatives which provide `java'.



Selection Alternative

-----------------------------------------------

1 /usr/bin/gij-wrapper-4.1

*+ 2 /usr/lib/jvm/java-6-sun/jre/bin/java



Press enter to keep the default[*], or type selection number:

輸入 有包含 "sun" 的行的前面的數(shù)字。如上面顯示,則輸入2,然后回車確定。


配置JAVA環(huán)境變量:

sudo gedit /etc/environment

在其中添加如下兩行:

CLASSPATH=.:/usr/lib/jvm/java-6-sun/libv

JAVA_HOME=/usr/lib/jvm/java-6-sun

sudo gedit /etc/jvm

將文件中的

/usr/lib/jvm/java-6-sun

這一行填入到配置塊的頂部

安裝瀏覽器的JAVA Plugin(可選):

sudo apt-get install sun-java6-plugin



seal 2009-03-04 12:31 發(fā)表評(píng)論
]]>
Ubuntu下SQuirrel連接Microsoft SQL Server(很好的客戶端)http://www.aygfsteel.com/sealyu/archive/2009/01/14/251217.htmlsealsealWed, 14 Jan 2009 02:02:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/01/14/251217.htmlhttp://www.aygfsteel.com/sealyu/comments/251217.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/01/14/251217.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/251217.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/251217.html 順便把安裝配置SQuirrel的過(guò)程中遇到到的問(wèn)題記錄一下,以免忘記:
1。我安裝的版本是SQuirrel2.6.8, 在安裝完成后啟動(dòng),顯示出來(lái)的只有一個(gè)空窗口,除了標(biāo)題欄沒(méi)任何東西,Google了一下,有人說(shuō)是jdk版本的問(wèn)題,由于項(xiàng)目需要,必須使用jdk5,看來(lái)只有安裝兩個(gè)jdk了。 可以這么作,原有jdk及環(huán)境變量保持不變,再安裝一個(gè)jdk6,然后手動(dòng)創(chuàng)建一個(gè)launcher,啟動(dòng)參數(shù)設(shè)置為:/usr/lib/jvm/java-6-sun/bin/java -jar /home/sealyu/tools/SQuirreL/squirrel-sql.jar 。
2。不知道是否由于版本的原因,沒(méi)找到使用文檔,SQuirrel官方網(wǎng)站也沒(méi)找到。后來(lái)自己摸索了一下,想要連接到Microsoft SQL Server(這里我用的版本是2005),下載了最新的jtds驅(qū)動(dòng),我的是jtds1.2.2.jar。將之放到SQuirrel_home/lib下面,這樣就能自動(dòng)檢測(cè)到驅(qū)動(dòng),打開(kāi)SQuirrel后,在jTDS Microsoft SQL 右鍵,選擇Modify Driver, 在 Extra Class Path 中選出你的jtds架包,List Drivers,這樣你就能在下面的下拉框中看到驅(qū)動(dòng)的主類。點(diǎn)擊確定按鈕,這時(shí)候左邊樹(shù)形菜單里面對(duì)應(yīng)的條目前方就由紅色的小叉變?yōu)榫G色的對(duì)號(hào)了。
3。新建一個(gè)Alias,輸入你要連接數(shù)據(jù)庫(kù)的信息,connect即可使用。




seal 2009-01-14 10:02 發(fā)表評(píng)論
]]>
Ubuntu啟動(dòng)問(wèn)題:Your session only lasted less than 10 seconds 的解決http://www.aygfsteel.com/sealyu/archive/2009/01/13/251115.htmlsealsealTue, 13 Jan 2009 05:35:00 GMThttp://www.aygfsteel.com/sealyu/archive/2009/01/13/251115.htmlhttp://www.aygfsteel.com/sealyu/comments/251115.htmlhttp://www.aygfsteel.com/sealyu/archive/2009/01/13/251115.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/251115.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/251115.html
在系統(tǒng)做完一次更新后,重新啟動(dòng)系統(tǒng),輸入用戶名密碼后,彈出一個(gè)對(duì)話框:
顯示錯(cuò)誤信息:
Your session only lasted less than 10 seconds。。。。。。。。。。
點(diǎn)擊查看詳細(xì)信息:
/etc/gdm/Xsession ........
Couldn't exec /usr/bin/pulse-session

點(diǎn)擊確定后會(huì)重新定向到登錄窗口。再次登錄還是同樣問(wèn)題。不過(guò)可以通過(guò)將session改為failsafe模式登錄進(jìn)去,安全模式也可以登錄進(jìn)去。

分析錯(cuò)誤信息,應(yīng)該是pulseaudio這個(gè)文件出現(xiàn)了問(wèn)題, 所以將pulseaudio這個(gè)軟件重裝了一下,重啟登錄,還是沒(méi)有解決。

后來(lái)failsafe模式進(jìn)去后,發(fā)現(xiàn)/etc/gdm/Xsession目錄下面有一個(gè)70pulseaudio文件,應(yīng)該是系統(tǒng)啟動(dòng)gdm是要加載的session,但是找不到/usr/bin/pulse-session,所以導(dǎo)致了這個(gè)錯(cuò)誤。
確定了問(wèn)題所在,也就知道怎么解決了。

解決方法:sudo rm /etc/X11/Xsession.d/70pulseaudio
這樣每次啟動(dòng)的時(shí)候就不會(huì)去找這個(gè)session加載。
不過(guò)如果需要使用pulseaudio的話,需要卸載重裝了。





seal 2009-01-13 13:35 發(fā)表評(píng)論
]]>
Ubuntu下不能刪除WICD問(wèn)題的解決http://www.aygfsteel.com/sealyu/archive/2008/12/15/246499.htmlsealsealMon, 15 Dec 2008 14:11:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/12/15/246499.htmlhttp://www.aygfsteel.com/sealyu/comments/246499.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/12/15/246499.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/246499.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/246499.html E: Sub-process /usr/bin/dpkg returned an error code (1)

只要找到/var/lib/dpkg/info/wicd.prerm這個(gè)文件,用管理員帳戶刪除,然后再次運(yùn)行新利得刪除即可。


seal 2008-12-15 22:11 發(fā)表評(píng)論
]]>
ubuntu下ssh時(shí)碰到的問(wèn)題http://www.aygfsteel.com/sealyu/archive/2008/12/11/245803.htmlsealsealThu, 11 Dec 2008 14:44:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/12/11/245803.htmlhttp://www.aygfsteel.com/sealyu/comments/245803.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/12/11/245803.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/245803.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/245803.html @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!

根據(jù)網(wǎng)上搜索到的解決辦法,將之前保存的已知主機(jī)列表刪除即可,
執(zhí)行: rm  -rf  .ssh/known_hosts
問(wèn)題解決


seal 2008-12-11 22:44 發(fā)表評(píng)論
]]>
How to use Django with Apache and mod_pythonhttp://www.aygfsteel.com/sealyu/archive/2008/11/07/239347.htmlsealsealFri, 07 Nov 2008 15:44:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/11/07/239347.htmlhttp://www.aygfsteel.com/sealyu/comments/239347.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/11/07/239347.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/239347.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/239347.htmlApache with mod_python currently is the preferred setup for using Django on a production server.

mod_python is similar to (and inspired by) mod_perl : It embeds Python within Apache and loads Python code into memory when the server starts. Code stays in memory throughout the life of an Apache process, which leads to significant performance gains over other server arrangements.

Django requires Apache 2.x and mod_python 3.x, and you should use Apache’s prefork MPM, as opposed to the worker MPM.

You may also be interested in How to use Django with FastCGI, SCGI or AJP (which also covers SCGI and AJP).

Basic configuration

To configure Django with mod_python, first make sure you have Apache installed, with the mod_python module activated.

Then edit your httpd.conf file and add the following:

<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonOption django.root /mysite
PythonDebug On
</Location>

...and replace mysite.settings with the Python import path to your Django project's settings file.

This tells Apache: "Use mod_python for any URL at or under '/mysite/', using the Django mod_python handler." It passes the value of DJANGO_SETTINGS_MODULE so mod_python knows which settings to use.

New in Django 1.0: The PythonOption django.root ... is new in this version.

Because mod_python does not know we are serving this site from underneath the /mysite/ prefix, this value needs to be passed through to the mod_python handler in Django, via the PythonOption django.root ... line. The value set on that line (the last item) should match the string given in the <Location ...> directive. The effect of this is that Django will automatically strip the /mysite string from the front of any URLs before matching them against your URLConf patterns. If you later move your site to live under /mysite2, you will not have to change anything except the django.root option in the config file.

When using django.root you should make sure that what's left, after the prefix has been removed, begins with a slash. Your URLConf patterns that are expecting an initial slash will then work correctly. In the above example, since we want to send things like /mysite/admin/ to /admin/, we need to remove the string /mysite from the beginning, so that is the django.root value. It would be an error to use /mysite/ (with a trailing slash) in this case.

Note that we're using the <Location> directive, not the <Directory> directive. The latter is used for pointing at places on your filesystem, whereas <Location> points at places in the URL structure of a Web site. <Directory> would be meaningless here.

Also, if your Django project is not on the default PYTHONPATH for your computer, you'll have to tell mod_python where your project can be found:

<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonOption django.root /mysite
PythonDebug On
PythonPath "['/path/to/project'] + sys.path"
</Location>

The value you use for PythonPath should include the parent directories of all the modules you are going to import in your application. It should also include the parent directory of the DJANGO_SETTINGS_MODULE location. This is exactly the same situation as setting the Python path for interactive usage. Whenever you try to import something, Python will run through all the directories in sys.path in turn, from first to last, and try to import from each directory until one succeeds.

An example might make this clearer. Suppose you have some applications under /usr/local/django-apps/ (for example, /usr/local/django-apps/weblog/ and so forth), your settings file is at /var/www/mysite/settings.py and you have specified DJANGO_SETTINGS_MODULE as in the above example. In this case, you would need to write your PythonPath directive as:

PythonPath "['/usr/local/django-apps/', '/var/www'] + sys.path"

With this path, import weblog and import mysite.settings will both work. If you had import blogroll in your code somewhere and blogroll lived under the weblog/ directory, you would also need to add /usr/local/django-apps/weblog/ to your PythonPath. Remember: the parent directories of anything you import directly must be on the Python path.

Note

If you're using Windows, we still recommended that you use forward slashes in the pathnames, even though Windows normally uses the backslash character as its native separator. Apache knows how to convert from the forward slash format to the native format, so this approach is portable and easier to read. (It avoids tricky problems with having to double-escape backslashes.)

This is valid even on a Windows system:

PythonPath "['c:/path/to/project'] + sys.path"

You can also add directives such as PythonAutoReload Off for performance. See the mod_python documentation for a full list of options.

Note that you should set PythonDebug Off on a production server. If you leave PythonDebug On, your users would see ugly (and revealing) Python tracebacks if something goes wrong within mod_python.

Restart Apache, and any request to /mysite/ or below will be served by Django. Note that Django's URLconfs won't trim the "/mysite/" -- they get passed the full URL.

When deploying Django sites on mod_python, you'll need to restart Apache each time you make changes to your Python code.

Multiple Django installations on the same Apache

It's entirely possible to run multiple Django installations on the same Apache instance. Just use VirtualHost for that, like so:

NameVirtualHost *

<VirtualHost *>
ServerName www.example.com
# ...
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
</VirtualHost>

<VirtualHost *>
ServerName www2.example.com
# ...
SetEnv DJANGO_SETTINGS_MODULE mysite.other_settings
</VirtualHost>

If you need to put two Django installations within the same VirtualHost (or in different VirtualHost blocks that share the same server name), you'll need to take a special precaution to ensure mod_python's cache doesn't mess things up. Use the PythonInterpreter directive to give different <Location> directives separate interpreters:

<VirtualHost *>
ServerName www.example.com
# ...
<Location "/something">
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonInterpreter mysite
</Location>

<Location "/otherthing">
SetEnv DJANGO_SETTINGS_MODULE mysite.other_settings
PythonInterpreter othersite
</Location>
</VirtualHost>

The values of PythonInterpreter don't really matter, as long as they're different between the two Location blocks.

Running a development server with mod_python

If you use mod_python for your development server, you can avoid the hassle of having to restart the server each time you make code changes. Just set MaxRequestsPerChild 1 in your httpd.conf file to force Apache to reload everything for each request. But don't do that on a production server, or we'll revoke your Django privileges.

If you're the type of programmer who debugs using scattered print statements, note that print statements have no effect in mod_python; they don't appear in the Apache log, as one might expect. If you have the need to print debugging information in a mod_python setup, either do this:

assert False, the_value_i_want_to_see

Or add the debugging information to the template of your page.

Serving media files

Django doesn't serve media files itself; it leaves that job to whichever Web server you choose.

We recommend using a separate Web server -- i.e., one that's not also running Django -- for serving media. Here are some good choices:

If, however, you have no option but to serve media files on the same Apache VirtualHost as Django, here's how you can turn off mod_python for a particular part of the site:

<Location "/media">
SetHandler None
</Location>

Just change Location to the root URL of your media files. You can also use <LocationMatch> to match a regular expression.

This example sets up Django at the site root but explicitly disables Django for the media subdirectory and any URL that ends with .jpg, .gif or .png:

<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
</Location>

<Location "/media">
SetHandler None
</Location>

<LocationMatch "".(jpg|gif|png)$">
SetHandler None
</LocationMatch>

Serving the admin files

Note that the Django development server automagically serves admin media files, but this is not the case when you use any other server arrangement. You're responsible for setting up Apache, or whichever media server you're using, to serve the admin files.

The admin files live in (django/contrib/admin/media) of the Django distribution.

Here are two recommended approaches:

  1. Create a symbolic link to the admin media files from within your document root. This way, all of your Django-related files -- code and templates -- stay in one place, and you'll still be able to svn update your code to get the latest admin templates, if they change.
  2. Or, copy the admin media files so that they live within your Apache document root.

Using "eggs" with mod_python

If you installed Django from a Python egg or are using eggs in your Django project, some extra configuration is required. Create an extra file in your project (or somewhere else) that contains something like the following:

import os
os.environ['PYTHON_EGG_CACHE'] = '/some/directory'

Here, /some/directory is a directory that the Apache webserver process can write to. It will be used as the location for any unpacking of code the eggs need to do.

Then you have to tell mod_python to import this file before doing anything else. This is done using the PythonImport directive to mod_python. You need to ensure that you have specified the PythonInterpreter directive to mod_python as described above (you need to do this even if you aren't serving multiple installations in this case). Then add the PythonImport line in the main server configuration (i.e., outside the Location or VirtualHost sections). For example:

PythonInterpreter my_django
PythonImport /path/to/my/project/file.py my_django

Note that you can use an absolute path here (or a normal dotted import path), as described in the mod_python manual. We use an absolute path in the above example because if any Python path modifications are required to access your project, they will not have been done at the time the PythonImport line is processed.

Error handling

When you use Apache/mod_python, errors will be caught by Django -- in other words, they won't propagate to the Apache level and won't appear in the Apache error_log.

The exception for this is if something is really wonky in your Django setup. In that case, you'll see an "Internal Server Error" page in your browser and the full Python traceback in your Apache error_log file. The error_log traceback is spread over multiple lines. (Yes, this is ugly and rather hard to read, but it's how mod_python does things.)

If you get a segmentation fault

If Apache causes a segmentation fault, there are two probable causes, neither of which has to do with Django itself.

  1. It may be because your Python code is importing the "pyexpat" module, which may conflict with the version embedded in Apache. For full information, see Expat Causing Apache Crash.
  2. It may be because you're running mod_python and mod_php in the same Apache instance, with MySQL as your database backend. In some cases, this causes a known mod_python issue due to version conflicts in PHP and the Python MySQL backend. There's full information in the mod_python FAQ entry.

If you continue to have problems setting up mod_python, a good thing to do is get a barebones mod_python site working, without the Django framework. This is an easy way to isolate mod_python-specific problems. Getting mod_python Working details this procedure.

The next step should be to edit your test code and add an import of any Django-specific code you're using -- your views, your models, your URLconf, your RSS configuration, etc. Put these imports in your test handler function and access your test URL in a browser. If this causes a crash, you've confirmed it's the importing of Django code that causes the problem. Gradually reduce the set of imports until it stops crashing, so as to find the specific module that causes the problem. Drop down further into modules and look into their imports, as necessary.



seal 2008-11-07 23:44 發(fā)表評(píng)論
]]>
在RedHat AS4 上安裝Mysql_python模塊時(shí)遇到的問(wèn)題http://www.aygfsteel.com/sealyu/archive/2008/11/07/239288.htmlsealsealFri, 07 Nov 2008 09:03:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/11/07/239288.htmlhttp://www.aygfsteel.com/sealyu/comments/239288.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/11/07/239288.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/239288.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/239288.html
在RedHat AS4 上配置Apache+MySQL+Django 環(huán)境時(shí),首先安裝好了Apache和Python以及Django和Mysql,
其中Mysql是編譯安裝的5.0版本。
下載了MySQL-python-1.2.2.tar.gz之后,解壓縮,cd進(jìn)去,
執(zhí)行: python setup.py build時(shí)報(bào)錯(cuò):
File "/tmp/easy_install-nHSsgl/MySQL-python-1.2.2/setup_posix.py", line 26, in mysql_config
EnvironmentError: mysql_config not found

后來(lái)發(fā)現(xiàn)是由于Mysql編譯安裝后沒(méi)有 mysql_config這個(gè)值,解決方法:
打開(kāi) setup_posix.py, 將其中l(wèi)ine:26手動(dòng)改成系統(tǒng)中對(duì)應(yīng)的Mysql選項(xiàng)(這里我的是/usr/local/mysql):
mysql_config = /usr/local/mysql/bin/mysql_config

重新執(zhí)行 :python setup.py build,沒(méi)有了剛才的錯(cuò)誤,但是出現(xiàn)了另外一個(gè)錯(cuò)誤:
error: /usr/bin/ld: cannot find -lmysqlclient

網(wǎng)上搜索了一下這個(gè)錯(cuò)誤,發(fā)現(xiàn)有幾種不同的情況,主要有以下幾個(gè)原因:
1.沒(méi)有安裝mysqlclient。解決方法:找到對(duì)應(yīng)的版本進(jìn)行安裝。
2.安裝的mysqlclient的版本不匹配。對(duì)應(yīng)鏈接: http://www.hao32.com/webserver/258.html
3.已經(jīng)安裝了對(duì)應(yīng)的mysqlclient但是找不到對(duì)應(yīng)的鏈接。這是在一個(gè)國(guó)外的網(wǎng)站上看到的,具體網(wǎng)址已經(jīng)找不到了,后來(lái)那位仁兄將對(duì)應(yīng)的
mysql_home/lib/mysql文件夾下面libmysqlclient對(duì)應(yīng)的文件全部拷貝到/usr/local/lib下面才解決了問(wèn)題。

按照對(duì)應(yīng)方案,問(wèn)題解決。
重新執(zhí)行:
python setup.py build
python setup.py install
安裝完成。




seal 2008-11-07 17:03 發(fā)表評(píng)論
]]>
為RedHat AS4添加在線升級(jí)功能http://www.aygfsteel.com/sealyu/archive/2008/11/06/239070.htmlsealsealThu, 06 Nov 2008 09:20:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/11/06/239070.htmlhttp://www.aygfsteel.com/sealyu/comments/239070.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/11/06/239070.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/239070.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/239070.html文件命名,所有軟件包都跟rhel是完全兼容的,因此,我們完全可以用centos的apt和yum源來(lái)進(jìn)行系統(tǒng)和軟件更新.

Apt下載http://rpm.pbone.net/index.php3/ ... ntos4.i386.rpm.html
下載完以后用rpm -i apt-0.5.15cnc6-4.centos4.i386.rpm 進(jìn)行安裝

其實(shí)這時(shí)就可以用了,不過(guò)為了使更新更快,我們最好編輯一下下面這個(gè)文件
/etc/apt/sources.list.d/centos.list

修改其中的apt源為centos的中國(guó)鏡像
### CentOS-4 APT repository
rpm http://mirror.be10.com centos/4/apt/i386 os addons updates extras
rpm  http://mirror.be10.com centos/4/apt/i386  contrib centosplus
然后更新apt文件列表

apt-get update

升級(jí)所有文件

apt-get upgrade

也可以用下面命令來(lái)安裝軟件

apt-get install packagename

用apt可以升級(jí)我們大多數(shù)的軟件,但要升級(jí)內(nèi)核還需要用yum

先安裝yum

apt-get install yum

這個(gè)時(shí)候需要導(dǎo)入一個(gè)GPG-KEY

rpm --import /usr/share/rhn/RPM-GPG-KEY

現(xiàn)在網(wǎng)上的文章出現(xiàn)了一個(gè)失誤,還要修改一下/etc/yum.repos.d/CentOS-Base.repo
才可以yum升級(jí),把/etc/yum.repos.d/CentOS-Base.repo的內(nèi)容替換為:
[base]
name=CentOS-4 - Base
baseurl=http://mirror.be10.com/centos/4/os/i386/
gpgcheck=1

#released updates
[update]
name=CentOS-4 - Updates
baseurl=http://mirror.be10.com/centos/4/updates/i386/
gpgcheck=1

#packages used/produced in the build but not released
[addons]
name=CentOS-4 - Addons
baseurl=http://mirror.be10.com/centos/4/addons/i386/
gpgcheck=1

#additional packages that may be useful
[extras]
name=CentOS-4 - Extras
baseurl=http://mirror.be10.com/centos/4/extras/i386/
gpgcheck=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-4 - Plus
baseurl=http://mirror.be10.com/centos/4/centosplus/i386/
gpgcheck=1
enabled=0

#contrib - packages by Centos Users
[contrib]
name=CentOS-4 - Contrib
baseurl=http://mirror.be10.com/centos/4/contrib/i386/
gpgcheck=1
enabled=0

#packages in testing
[testing]
name=CentOS-4 - Testing
baseurl=http://mirror.be10.com/centos/4/testing/i386/
gpgcheck=1
enabled=0
然后現(xiàn)在就可以進(jìn)行升級(jí)了

yum update

yum升級(jí)完以后如果升級(jí)內(nèi)核的話需要重新啟動(dòng),使用

/sbin/shutdown -r now

重新啟動(dòng)以后再看看系統(tǒng)內(nèi)核,已經(jīng)是新版本的了

uname -a

你應(yīng)該有很高的悟性,知道baseurl=http://mirror.be10.com/centos/4/testing/i386/中,4代表的是版本號(hào)。
這類文章很多,恭喜你看到了最正確的一篇,同時(shí)也感謝你看到這里。

測(cè)試環(huán)境:紅帽AS4

seal 2008-11-06 17:20 發(fā)表評(píng)論
]]>
Linux和Windows下查看環(huán)境變量方法對(duì)比http://www.aygfsteel.com/sealyu/archive/2008/11/06/239050.htmlsealsealThu, 06 Nov 2008 08:13:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/11/06/239050.htmlhttp://www.aygfsteel.com/sealyu/comments/239050.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/11/06/239050.html#Feedback1http://www.aygfsteel.com/sealyu/comments/commentRss/239050.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/239050.html

一、查看所有環(huán)境變量的名稱和值:

Linux下:export

Windows下:set

二、根據(jù)名稱查該環(huán)境變量的值:

Linux下:echo $環(huán)境變量名

比如:echo $ORACLE_HOME

Windows下:set 環(huán)境變量名



seal 2008-11-06 16:13 發(fā)表評(píng)論
]]>
Ubuntu8.10 應(yīng)用程序菜單無(wú)法打開(kāi)的解決辦法http://www.aygfsteel.com/sealyu/archive/2008/08/27/224923.htmlsealsealWed, 27 Aug 2008 01:25:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/08/27/224923.htmlhttp://www.aygfsteel.com/sealyu/comments/224923.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/08/27/224923.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/224923.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/224923.html 搜索得到解決辦法:
找到/etc/xdg/menus/applications.menu這個(gè)文件,拷貝一份將你壞掉的/home/your_user_name/.config/menus/applications.menu文件替換掉就可以了。



seal 2008-08-27 09:25 發(fā)表評(píng)論
]]>
RedHat AS4升級(jí)http://www.aygfsteel.com/sealyu/archive/2008/08/14/222060.htmlsealsealThu, 14 Aug 2008 09:16:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/08/14/222060.htmlhttp://www.aygfsteel.com/sealyu/comments/222060.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/08/14/222060.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/222060.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/222060.html 第一步:下載第三方軟件
#wget http://apt.sw.be/packages/apt/apt-0.5.15lor ... _64.rpm   (注意,不同的版本不一樣)
第二步:下載rpm的密鑰
#wget http-://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
第三步:安裝第三方軟件apt-get
#rpm -Uvh ./pt-0.5.15cnc6-4.2.el4.rf.i386.rpm
第四步:導(dǎo)入rpm密鑰
#rpm --import RPM-GPG-KEY.dag.txt
第五步:編輯文件,讓apt-get知道去哪里找升級(jí)包和密鑰
#vi /etc/apt/sources.list.d/dag.list
添加下面一行:
#rpm http://apt.sw.be redhat/el4/en/i386 dag
保存退出
第六步:升級(jí)、安裝
更新數(shù)據(jù)庫(kù)
#apt-get update
真正的升級(jí)
#apt-get upgrade

seal 2008-08-14 17:16 發(fā)表評(píng)論
]]>
Ubuntu 中的網(wǎng)絡(luò)管理器wicdhttp://www.aygfsteel.com/sealyu/archive/2008/08/13/221647.htmlsealsealWed, 13 Aug 2008 03:17:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/08/13/221647.htmlhttp://www.aygfsteel.com/sealyu/comments/221647.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/08/13/221647.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/221647.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/221647.htmlWicd是Linux下的一個(gè)開(kāi)源的有線、無(wú)線網(wǎng)絡(luò)連接管理器。您可以在簡(jiǎn)單的界面里設(shè)置網(wǎng)絡(luò)連接的各種參數(shù)。

Wicd的功能:

  • 無(wú)需依賴Gnome運(yùn)行環(huán)境 (盡管它確實(shí)需要GTK),就是說(shuō)可以在XFCE、Fluxbox, Openbox、Enlightenment 等X下使用

  • 可以管理有線和無(wú)線網(wǎng)絡(luò)連接

  • 每個(gè)無(wú)線和有線網(wǎng)絡(luò)連接都有獨(dú)立的配置文件

  • 支持多種加密方式,包括 WEP、WPA、WPA2 等

  • 保持了對(duì) wireless-tools 的兼容性

  • 在系統(tǒng)托盤顯示網(wǎng)絡(luò)狀況和信號(hào)強(qiáng)度

在Ubuntu中安裝 Wicd:

首先編輯  /etc/apt/sources.list 文件

sudo gedit /etc/apt/sources.list

7.10 (gutsy) 在里面添加如下一行:

deb http://apt.wicd.net gutsy extras

8.04 (hardy) 用戶在里面添加這行:

deb http://apt.wicd.net hardy extras

保存退出

現(xiàn)在用下面的命令更新源列表

sudo aptitude update

通過(guò)下面這行命令安裝 wicd

sudo aptitude install wicd

請(qǐng)注意,此操作將刪除GNOME的默認(rèn)網(wǎng)絡(luò)管理器 network-manager,可能導(dǎo)致暫時(shí)失去網(wǎng)絡(luò)連接。

在GNOME中,如果您想讓它自動(dòng)啟動(dòng)并顯示系統(tǒng)托盤圖標(biāo)。那么請(qǐng)?jiān)?系統(tǒng)→首選項(xiàng)→會(huì)話 啟動(dòng)程序 標(biāo)簽中點(diǎn)擊 添加。設(shè)定個(gè)名字(比如”Wicd”)并在命令一欄中輸入 “/opt/wicd/tray.py”。

Auto Start

啟動(dòng)后效果如下:

Tray

使用 Wicd

在GNOME中通過(guò)應(yīng)用程序菜單啟動(dòng) wicd 的方法是點(diǎn)擊 應(yīng)用程序互聯(lián)網(wǎng)Wicd

在wicd的窗口中您將看見(jiàn)一個(gè)系統(tǒng)檢測(cè)到的無(wú)線網(wǎng)絡(luò)列表。有時(shí) Wicd 在剛啟動(dòng)的時(shí)候不能搜索到所有范圍內(nèi)的無(wú)線網(wǎng)絡(luò)。請(qǐng)點(diǎn)擊工具條上的刷新按鈕來(lái)重新搜索。

點(diǎn)擊網(wǎng)絡(luò)名稱下面的那個(gè) 連接 后稍候幾秒就應(yīng)該連上您選擇的網(wǎng)絡(luò)了。

Wicd Main

如果網(wǎng)絡(luò)是加密的,您需要再干點(diǎn)兒活兒。Wicd支持的加密方式包括:WPA、WEP、LEAP、TTLS、EAP 和 PEAP。

點(diǎn)擊您要連接的那個(gè)網(wǎng)絡(luò)名稱邊上的箭頭,然后點(diǎn)擊高級(jí)設(shè)置。在這里選中 Use Encryption 框,并在下拉菜單里選擇對(duì)應(yīng)的加密方式,最后在密鑰欄填上您的密碼。

Detail





seal 2008-08-13 11:17 發(fā)表評(píng)論
]]>
RedHat AS4 下使用別名收取root帳戶郵件。http://www.aygfsteel.com/sealyu/archive/2008/07/31/219184.htmlsealsealThu, 31 Jul 2008 15:05:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/07/31/219184.htmlhttp://www.aygfsteel.com/sealyu/comments/219184.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/07/31/219184.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/219184.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/219184.html 但是可以通過(guò)下列方式解決:
配置/etc/aliases  
   
  vi   /etc/aliases  
  加入:  
  root:   your_account_name   
  :wq  
   
  #newaliases  
   
  現(xiàn)在,發(fā)給root的,就轉(zhuǎn)發(fā)給了your_account_name樂(lè)。  



seal 2008-07-31 23:05 發(fā)表評(píng)論
]]>
Sendmail篇之dovecot(轉(zhuǎn))http://www.aygfsteel.com/sealyu/archive/2008/07/31/219158.htmlsealsealThu, 31 Jul 2008 13:16:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/07/31/219158.htmlhttp://www.aygfsteel.com/sealyu/comments/219158.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/07/31/219158.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/219158.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/219158.html
一、編譯安裝
# tar xzvf dovecot-1.0.2.tar.gz
# cd dovecot-1.0.2
# ./configure
# make
# make install

二、找出sendmail郵箱的位置
# echo "Hello me" | mail -s "Dovecot test" $USER
一般的rh系統(tǒng)都在 /var/mail 目錄下


三、配置dovecot
# mv /usr/local/etc/dovecot-example.conf /usr/local/etc/dovecot.conf
每個(gè)配置的選項(xiàng)conf文件里已經(jīng)有很詳細(xì)的注釋了,這里貼出我的dovecot.conf:
protocols = imap pop3
disable_plaintext_auth = no
ssl_disable = yes
ser=<%u> method=%m rip=%r lip=%l %c
#login_log_format = %$: %s

mail_location = mbox:~/mail:INBOX=/var/mail/%u

dotlock_use_excl = yes
maildir_copy_with_hardlinks = yes

protocol pop3 {
pop3_uidl_format = %v.%u
}


protocol lda {
postmaster_address = postmaster@example.com
}

auth_verbose = yes

auth default {
mechanisms = plain
passdb shadow {
}
userdb passwd {
}
user = root
}

四、啟動(dòng)dovecot
編輯啟動(dòng)腳本 /etc/init.d/dovecot,適應(yīng)于所有的操作系統(tǒng)
#! /bin/sh

DAEMON=/usr/local/sbin/dovecot

test -x $DAEMON || exit 0
set -e

base_dir=`$DAEMON -a|grep '^base_dir: '|sed 's/^base_dir: //'`
pidfile=$base_dir/master.pid

if test -f $pidfile; then
running=yes
else
running=no
fi

case "$1" in
start)
echo -n "Starting Dovecot"
$DAEMON
echo "."
;;
stop)
if test $running = yes; then
echo "Stopping Dovecot"
kill `cat $pidfile`
echo "."
else
echo "Dovecot is already stopped."
fi
;;
reload)
if test $running = yes; then
echo -n "Reloading Dovecot configuration"
kill -HUP `cat $base_dir/master.pid`
echo "."
else
echo "Dovecot isn't running."
fi
;;
restart|force-reload)
echo -n "Restarting Dovecot"
if test $running = yes; then
kill `cat $base_dir/master.pid`
sleep 1
fi
$DAEMON
echo "."
;;
*)
echo "Usage: /etc/init.d/dovecot {start|stop|reload|restart|force-reload}" >&2
exit 1
;;
esac

exit 0

# /etc/init.d/dovecot start 啟動(dòng)dovecot
# kill `cat /usr/local/var/run/dovecot/master.pid` 關(guān)閉dovecot

參考資料:
http://wiki.dovecot.org/FrontPage?action=show&redirect=%E9%A6%96%E9%A1%B5

seal 2008-07-31 21:16 發(fā)表評(píng)論
]]>
RedHat linux AS 4+Apache2.2+MYSQL5.0.17+PHP5.1.1(轉(zhuǎn))http://www.aygfsteel.com/sealyu/archive/2008/07/28/218089.htmlsealsealMon, 28 Jul 2008 08:06:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/07/28/218089.htmlhttp://www.aygfsteel.com/sealyu/comments/218089.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/07/28/218089.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/218089.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/218089.html # groupadd mysql
# useradd -g mysql -d /usr/local/mysql/data -M mysql
# tar -zxvf mysql-5.0.17.tar.gz
# cd mysql-5.0.17
./configure --prefix=/usr/local/mysql "             指定安裝目錄
> --sysconfdir=/etc "                                       配置文件的路徑
> --localstatedir=/usr/local/mysql/data "        數(shù)據(jù)庫(kù)存放的路徑
> --enable-assembler "                                  使用一些字符函數(shù)的匯編版本
> --with-mysqld-ldflags=-all-static "               以純靜態(tài)方式編譯服務(wù)端
> --with-charset=utf8 "                                  添加utf8字符支持
> --with-extra-charsets=all                            添加所有字符支持

# make
# make install
# /usr/local/mysql/bin/mysql_install_db
# chown -R mysql:mysql /usr/local/mysql/data
# cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
#  chkconfig --add mysqld
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf

安裝Apache
tar -zvxf httpd-2.2.tar.gz
cd httpd-2.2
./configure --prefix=/usr/local/apache --enable-so
make
make install

先安裝支持包(注意安裝順序)
先列出配置gd2需要的網(wǎng)址

gd-2.0.33.tar.gz
www.boutell.com/gd

jpegsrc.v6b.tar.gz
ftp.uu.net/graphics/jpeg
www.ijg.org

libpng-1.2.7.tar.tar
www.libpng.org/pub/png/libpng.html
libpng.sourceforge.net
sourceforge.net/projects/libpng

zlib-1.2.2.tar.gz
www.zlib.net
sourceforge.net/projects/zlib

freetype-2.1.9.tar.gz
www.freetype.org
freetype.sourceforge.net/index2.html
sourceforge.net/projects/freetype

建立初始目錄:
mkdir /usr/local/modules

jpeg目錄
mkdir /usr/local/modules/jpeg6
mkdir /usr/local/modules/jpeg6/bin
mkdir /usr/local/modules/jpeg6/lib
mkdir /usr/local/modules/jpeg6/include
mkdir /usr/local/modules/jpeg6/man
mkdir /usr/local/modules/jpeg6/man/man1


安裝libxml
# tar -zxf libxml2-2.6.16.tar.gz
# cd libxml2-2.6.16
# ./configure (xml默認(rèn)安裝就可以,不要指定路徑了,因?yàn)榘惭b時(shí)php可能找不到它,PHP5只支持libxml2-2.5.10以上版本)
# make
# make install

安裝zlib
tar xzvf zlib-1.2.2.tar.gz
cd zlib-1.2.2
#不要用--prefix自定義安裝目錄,影響gd的安裝
./configure
make
make install

安裝freetype
tar xzvf freetype-2.1.5.tar.gz
cd freetype-2.1.5
./configure --prefix=/usr/local/modules/freetype
make
make install

安裝libpng
tar xzvf libpng-1.2.5.tar.gz
#不要用--prefix自定義安裝目錄,影響gd的安裝
cd libpng-1.2.5
cp scripts/makefile.std makefile
make
make install


安裝jpeg
tar xzvf jpegsrc.v6b.tar.gz
./configure --prefix=/usr/local/modules/jpeg6 --enable-shared --enable-static
make
make install

安裝GD
tar xzvf gd-2.0.33.tar.gz
./configure --prefix=/usr/local/modules/gd --with-jpeg=/usr/local/modules/jpeg6 --with-png --with-zlib --with-freetype=/usr/local/modules/freetype
make
make install

安裝imap:
tar zxvf imap-2001a.tar.Z
cd imap-2001a  
make  slx  
cp  ipopd/ipop*.*  /usr/sbin  
cp  imapd/imapd  /usr/sbin  
cp  c-client/c-client.a  /usr/local/lib  
請(qǐng)確定你有  /usr/local/include  這個(gè)目錄
cp  c-client/rfc822.h  /usr/local/include  
cp  c-client/mail.h  /usr/local/include  
cp  c-client/linkage.h  /usr/local/include  


mkdir /usr/local/php5
tar -zxvf php-5.1.1.tar.gz
cd php-5.1.1
./configure --prefix=/usr/local/php5 "
              --with-mysql=/usr/local/mysql "
              --with-mysqli=/usr/local/mysql/bin/mysql_config "
              --with-apxs2=/usr/local/apache/bin/apxs "
              --with-libxml-dir=/usr/local/lib "
              --with-gd=/usr/local/modules/gd "
              --with-jpeg-dir=/usr/local/modules/jpeg6 "
              --with-zlib "
              --with-png "
              --with-freetype-dir=/usr/local/modules/freetype "
              --with-imap=/usr/local/lib "
              --with-xmlrpc "
              --with-config-file-path=/usr/local/php5/etc
make
make install

cp ./php.ini-dist /usr/local/php5/etc/php.ini

修改httpd.conf
#vi /usr/local/apache/conf/httpd.conf
加載php模塊,去掉注釋“#”,如沒(méi)有此行,請(qǐng)加上。
LoadModule php5_module        modules/libphp5.so
加上此兩行
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

到這里全部的安裝過(guò)程已完成。

seal 2008-07-28 16:06 發(fā)表評(píng)論
]]>
sendmail郵件服務(wù)器搭載smtp和pop3認(rèn)證的配置方法(轉(zhuǎn))http://www.aygfsteel.com/sealyu/archive/2008/07/24/217055.htmlsealsealWed, 23 Jul 2008 16:24:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/07/24/217055.htmlhttp://www.aygfsteel.com/sealyu/comments/217055.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/07/24/217055.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/217055.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/217055.html
1.軟件準(zhǔn)備

操作系統(tǒng):centos5.0

我選擇centos5,最新的操作系統(tǒng),不要再用redhat9了,很久沒(méi)有更新了,企業(yè)里用有風(fēng)險(xiǎn)的。更新?lián)Q代吧。

以下軟件,centos5全部自帶,無(wú)需另外下載。

郵件系統(tǒng):
               sendmail8.13
               sendmail-cf-8.13
               m4-1.4

pop3認(rèn)證:dovecot-1.0

smtp認(rèn)證:
        cyrus-sasl-2.1
        cyrus-sasl-md5-2.1
        cyrus-sasl-plain-2.1
          cyrus-sasl-lib-2.1

sasl這里,我要說(shuō)一句,網(wǎng)上有人說(shuō)“sendmail-8.13已經(jīng)包含cyrus-sasl的功能,所沒(méi)必要再安裝cyrus-sasl”
大 哥大姐們,沒(méi)有cyrus-sasl用什么做認(rèn)證.....sendmail官方只是說(shuō),sendmail的rpm包默認(rèn)已經(jīng)支持了cyrus-sasl 認(rèn)證方式,也就是說(shuō),sendmail會(huì)在cyrus-sasl的工作目錄下自動(dòng)創(chuàng)建相關(guān)認(rèn)證配置文件,并監(jiān)聽(tīng)25號(hào)端口,就不用你去手動(dòng)自己建立配置文 件和監(jiān)聽(tīng)端口了。當(dāng)有請(qǐng)求進(jìn)入25號(hào)端口的時(shí)候,sendmail會(huì)自動(dòng)找到/usr/lib/sasl2/Sendmail.conf讀取認(rèn)證方法。下 面我會(huì)詳細(xì)解釋。

2.安裝軟件

rpm -ivh把上面軟件全裝上,都在光盤里呢,好裝。

3.認(rèn)證配置

pop3:

網(wǎng) 上說(shuō)修改/etc/dovecot.conf文件,將第17行的:#protocols = imap imaps pop3 pop3s的#去掉。其實(shí)不用,它默認(rèn)已經(jīng)啟用了這些服務(wù),除非你只想用dovecot-auth的認(rèn)證,你可以改成protocols = none,否則不用改。

smtp:
注意,smtp稍微麻煩一下。

我講下原理:

當(dāng)用戶請(qǐng)求進(jìn)入 25號(hào)端口后,sendmail調(diào)用cyrus-sasl的saslauthd進(jìn)程,saslauthd要求對(duì)方輸入本地系統(tǒng)用戶的用戶名和密碼,當(dāng)用戶 輸入好后,saslauthd會(huì)去查找系統(tǒng)的/etc/shadow文件,密碼確認(rèn)無(wú)誤,放行,告訴sendmail,這個(gè)用戶合法,可以使用郵件服務(wù)來(lái) 發(fā)郵件。

這時(shí)候你去/usr/lib/sasl2/下看看,sendmail已經(jīng)做好了一個(gè)sendmail.conf文件,里面指明了:pwcheck_method=saslauthd,說(shuō)明sendmail認(rèn)證時(shí)就要調(diào)用saslauthd
所以要實(shí)現(xiàn)上述功能,就要設(shè)置cyrus-sasl的saslauthd,給它指定認(rèn)證方式。
首先,進(jìn)入/etc/sysconfig/,打開(kāi)saslauthd的腳本,找到第7行的:

MECH=

等號(hào)后面不管寫什么,我們都要改成:

MECH=shadow

保存

這樣saslauthd才會(huì)去找shadow文件給用戶做認(rèn)證。


其實(shí)saslauthd還可以用自己的用戶名和密碼數(shù)據(jù)庫(kù)做驗(yàn)證,但這樣不方便,還要另外創(chuàng)建用戶,不如直接用系統(tǒng)自身存在的用戶名和密碼。




4.Sendmail配置.

配置郵件服務(wù)器名稱:

打開(kāi)/etc/mail/local-host-names
加入你 @后面的郵箱地址。比如我這里是otto@linuxedentest.com
那么,你要在local-host-names文件里的第二行添加:
linuxedentest.com
保存

當(dāng)然
local-host-names還可以設(shè)置郵箱別名,這個(gè)不多說(shuō),大家查文檔看看。

改好后還要去你的dns服務(wù)器上,打上mx標(biāo)志,添加A標(biāo)記,用來(lái)解析dns名和地址。具體方法就要查查bind的設(shè)置方法了,或者win2003的dns設(shè)置方法。


配置sendmail.mc:

打開(kāi)/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

把前面的dnl注釋去掉,變成:

TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl

上面兩句的意思是:

放行那些通過(guò)EXTERNAL, LOGIN, PLAIN, CRAM-MD5或DIGEST-MD5等方式驗(yàn)證的郵件用戶,無(wú)視access文件中的設(shè)置。

confAUTH_MECHANISMS,確定系統(tǒng)支持的認(rèn)證方式。LOGIN PLAIN 方式下,outlook用的多。


還不算完,找到:

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, )dnl

改成:

DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, )dnl

這樣所有ip地址都可以通過(guò)smtp端口使用我們的郵件服務(wù)器了。


-----------------------------------------------------------
這里要說(shuō)一句,不要改

dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl

這句話!保持注釋狀態(tài)。

上面那句話,網(wǎng)上好多文章都說(shuō)把Port=submission,改成Port=25,說(shuō)是強(qiáng)制所有用戶在25端口上做認(rèn)證。

我不知道sendmail以前的版本是怎么樣設(shè)置smtp認(rèn)證的。sendmail8.13不用這么設(shè)置,這句話人家sendmail的意思是:取消注釋后,一旦當(dāng)25號(hào)端口被重定向或者被屏蔽,或者在25號(hào)端口打不開(kāi)的情況下,馬上使用587備用端口給用戶做認(rèn)證。

本來(lái)人家sendmail就已經(jīng)打開(kāi)了25端口(Port=smtp了已經(jīng)),你卻在這里還Port=25,把備用端口也改成25,這不是讓sendmail的sm-client認(rèn)

證進(jìn)程和sendmail的主進(jìn)程搶端口么....

-----------------------------------------------------------


到此為止,保存sendmail.mc


用m4重新生成sendmail.cf文件

# m4 /etc/mail/sendmail.mc > /etc/sendmail.cf


啟動(dòng)dovecot進(jìn)程:
/etc/init.d/dovecot start



啟動(dòng)saslauthd進(jìn)程:
/etc/init.d/saslauthd start



啟動(dòng)sendmail進(jìn)程:
/etc/init.d/sendmail start


把這些進(jìn)程加入到啟動(dòng)腳本中去:
chkconfig dovecot on
chkconfig saslauthd on
chkconfig sendmail on


ok,所有設(shè)置全部完成,可以正常認(rèn)證和收發(fā)郵件了。

本文如有不準(zhǔn)確的地方,請(qǐng)各位海批~~~


=============================分割線==============================================


                            smtp測(cè)試方法:

以下sh#表示在shell上輸入;C 為客戶端輸入, S為服務(wù)器端返回信息 。


sh# telnet <郵件服務(wù)器地址/IP>  <port(一般是25)>

S : 220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8; Sun, 18 May 2008 01:55:03 +0800

C : ehlo <名字> (不帶認(rèn)證功能的是helo +名字)

S : 250-localhost.localdomain Hello zhangzb.nec-as.nec.com.cn [172.28.90.9], pleased to meet you
S : 250-ENHANCEDSTATUSCODES
S : 250-PIPELINING
S : 250-8BITMIME
S : 250-SIZE
S : 250-DSN
S : 250-ETRN
S : 250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
S : 250-DELIVERBY
S : 250 HELP

C : auth login

S : 334 VXNlcm5hbWU6

注:{  下面先輸入username后passwd,兩者需要輸入encode base64碼,轉(zhuǎn)換方法:
sh# perl -MMIME::Base64 -e 'print encode_base64("username")'
(注意print前后 是單引號(hào),username 處替換成你需要的單詞)
}

C : MQ==  (這是我的用戶名:1)

S : 334 UGFzc3dvcmQ6

C : MQ==   (密碼,也是1)

S : 235 2.0.0 OK Authenticated

C : MAIL FROM:<XXXX@XXXX> (部分服務(wù)器設(shè)置后,需要真實(shí)的郵箱后綴名,具體方法不詳)

 
S : 250 2.1.0 <XXXX@XXXX>... Sender ok

 
C : RCPT TO:<XXXX@XXXX>   (目標(biāo)郵箱)

 
S : 250 2.1.5 <XXXX@XXXX>... Recipient ok

 
C : DATA

 
S : 354 Enter mail, end with "." on a line by itself

C : 〈這里添郵件內(nèi)容〉
C :.  (點(diǎn))
 
S : 250 2.0.0 m4HHt3Sj005640 Message accepted for delivery
 
C: quit 
〈mail send successful〉


seal 2008-07-24 00:24 發(fā)表評(píng)論
]]>
dovecot安裝http://www.aygfsteel.com/sealyu/archive/2008/07/23/217047.htmlsealsealWed, 23 Jul 2008 15:20:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/07/23/217047.htmlhttp://www.aygfsteel.com/sealyu/comments/217047.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/07/23/217047.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/217047.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/217047.html一、RPM格式
1。安裝RPM包;
2。編輯/etc/dovecot.conf
其中,修改
protocols = imap pop3
passdb passwd {
 }
passdb shadow {
  }
3。啟動(dòng)
#service dovecot start
 
二、tar.gz包的安裝
1。下載地址:(目前最新版本)http://www.dovecot.org/releases/dovecot-1.0.rc14.tar.gz
2。安裝:
#tar zxvf dovecot-1.0.rc14.tar.tar
#cd dovecot-1.0.rc14
#./configure --prefix=/usr/local/dovecot --sysconfdir=/usr/local/etc --with-mysql --without-ssl --disable-ipv6
#make
#make install
# cp /usr/local/etc/dovecot-example.conf /usr/local/etc/dovecot.conf
 
3。建立啟動(dòng)進(jìn)程所依賴的用戶
# useradd -s /bin/false -d /dev/null dovecot
 
4。修改配置文件
編輯/usr/local/etc/dovecot.conf
其中,修改
protocols = imap pop3
ssl_disable = yes
passdb passwd {
 }
passdb shadow {
  }
5。啟動(dòng)
#/usr/local/dovecot/sbin/dovecot
 
6。可以把啟動(dòng)命令寫進(jìn)/etc/rc.d/rc.local文件,以使得系統(tǒng)啟動(dòng)時(shí)能自動(dòng)啟動(dòng)服務(wù)。
#echo "/usr/local/dovecot/sbin/dovecot" >> /etc/rc.d/rc.local
 
7。驗(yàn)正
(1)驗(yàn)正POP3
#telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Dovecot ready.
 
(2)驗(yàn)正imap
#telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
* OK Dovecot ready.

seal 2008-07-23 23:20 發(fā)表評(píng)論
]]>
sendmail 配置錯(cuò)誤:Cannot open /usr/share/sendmail-cf/m4/cf.m4http://www.aygfsteel.com/sealyu/archive/2008/07/23/217028.htmlsealsealWed, 23 Jul 2008 13:40:00 GMThttp://www.aygfsteel.com/sealyu/archive/2008/07/23/217028.htmlhttp://www.aygfsteel.com/sealyu/comments/217028.htmlhttp://www.aygfsteel.com/sealyu/archive/2008/07/23/217028.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/217028.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/217028.htmlm4 sendmail.mc > sendmail.cf

卻提示 sendmail.mc:10: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory

這是因?yàn)闆](méi)有安裝sendmai-cf這個(gè)包

安裝完成后問(wèn)題解決



seal 2008-07-23 21:40 發(fā)表評(píng)論
]]>
主站蜘蛛池模板: 翼城县| 辽阳市| 巴林右旗| 乌拉特后旗| 武山县| 鱼台县| 宝应县| 探索| 广东省| 海伦市| 汉源县| 苏州市| 沙雅县| 抚顺县| 东乡县| 屯留县| 安陆市| 大英县| 中西区| 山东| 嘉荫县| 厦门市| 莲花县| 肇州县| 安泽县| 苗栗市| 金秀| 边坝县| 华阴市| 攀枝花市| 永顺县| 缙云县| 合水县| 金川县| 乐安县| 宜宾县| 突泉县| 阳江市| 满城县| 临清市| 廊坊市|