• Twitter
  • rss
  • facebook

緊隨 ROOTLAU.COM 的最新消息和資訊

CentOS5.1 安裝 OpenWebMail

(0)

Category : Linux

新安裝了CentOS 5.1版,(64位元版),仍舊使用Sendmail作為郵件伺服器,現要安裝Openwebmail,使用yum(已使用管理員權限):

* cd /etc/yum.repos.d
* get ftp://openwebmail.org/pub/yum/openwebmail.repo
* yum install openwebmail

接下來只要按下「y」,讓程式自動執行就可以了,比以前要安裝許多的相關附屬套件,真是輕鬆多了!

參考網頁:http://openwebmail.org/openwebmail/download/redhat/yum/readme.txt

Zend 原來也可以通過 yum 來安裝

(0)

Category : Linux

Linux CentOS 5 Server: YUM Repository to Install Zend Optimizer

I recently needed to install Zend Optimizer which was required by a ZenCart addon using Zend Guard. Zend Guard encrypts some or all of a PHP application to help protect its contents from being copied or modified. So I was typically like to install everything on CentOS using the yum package manger to make sure that updates for all applications are uniform and easy to do.

The actual package that needs to be installed to install Zend Optimizer is called php-zend-optimizer and isn’t readily available in many yum repositories. On a typical CentOS installation I add a couple extra yum repos including rpmforge and a repo that provides ruby based packages for CentOS. Anyhow after awhile of searching I finally located the atomic repository which did include the php-zend-optimizer package.

Install Atomic Repository On a CentOS Server:

  1. wget -q -O – http://www.atomicorp.com/installers/atomic.sh | sh

The above command will download the atomic.sh script and then execute it. First the script installs the Atomic GPG key. Unless you have a Plesk server that you want packages for you can answer “n” when asked if you want to enable the Plesk yum repository. After this it will install the atomic.repo file in /etc/yum.repos.d/ directory. Its contents are located below.

Contents: atomic.repo

  1. # Name: Atomic Rocket Turtle RPM Repository for CentOS / Red Hat Enterprise Linux 5 -
  2. # URL: http://www.atomicrocketturtle.com/
  3. [atomic]
  4. name = CentOS / Red Hat Enterprise Linux $releasever – atomicrocketturtle.com
  5. mirrorlist = http://www.atomicorp.com/mirrorlist/atomic/centos-5-$basearch
  6. #mirrorlist = http://www.atomicorp.com/channels/atomic/centos/5/mirrors-atomic
  7. enabled = 1
  8. priority = 1
  9. protect = 0
  10. gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
  11. gpgcheck = 1
  12. # Almost Stable, release candidates for [atomic]
  13. [atomic-testing]
  14. name = CentOS / Red Hat Enterprise Linux $releasever – atomicrocketturtle.com – (Testing)
  15. mirrorlist = http://www.atomicorp.com/mirrorlist/atomic-testing/centos-5-$basearch
  16. enabled = 0
  17. priority = 1
  18. protect = 0
  19. gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
  20. gpgcheck = 1
  21. # Untested, Unstable, known buggy, and incomplete packages.
  22. #[atomic-bleeding]
  23. #name = CentOS / Red Hat Enterprise Linux $releasever – atomicrocketturtle.com – (Bleeding)
  24. #baseurl = http://www.atomicorp.com/channels/atomic-bleeding/centos/5/$basearch/
  25. #enabled = 0
  26. #priority = 1
  27. #protect = 0
  28. #gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
  29. #gpgcheck = 1

By default only the atmoic yum repository is installed however you can also enable the atomic-testing repository and atomic-bleeding repository. Once installed issued the below command to install php-zend-optimizer.

  1. yum install php-zend-optimizer

Now that Zend Optimizer is installed you can run PHP applications protected by Zend Guard. The Zend Optimizer package is now easily managed with the yum package manager.


SquirrelMail + poppassd

(0)

Category : Linux

不管輸入的密碼是多麼的正確,一律給錯:

很久沒有替別人安裝過 Mail Server 了,那個 Fedora Core 8 真了得‧‧‧

除了給那個 Bind 玩耍了幾天外,Poppassd 也攪了我十數個小時‧‧‧

那個 bind 竟然不許其他 ip 查詢‧‧‧

而 Poppassd 就錯漏百出‧‧‧

500 Old password is incorrect

查了半天程式、 log 、網路,不斷搜尋資料,一直找不到原因,直到看到有人提到 /etc/pam.d/poppassd 裡面

#%PAM-1.0
auth required pam_pwdb.so shadow nullok
account required pam_pwdb.so
password required pam_cracklib.so retry=3
password required pam_pwdb.so use_authtok nullok

使用的 pam_pwdb.so ,但是系統上沒有這個檔案 O_O 。仔細一查,奇了, 竟然真的找不到這個檔案。

知道原因,就好辦。仔細查了一下, 在 pam 套件裡,真的沒提供 pam_pwdb.so 。而 pam_pwdb.so 與 pam_unix.so 是相同功能的模組,於是解決方法就很簡單了:

cd /lib/security
ln -s pam_unix.so pam_pwdb.so

建立一個 soft link ,用 pam_unix.so 來提供 pam_pwdb.so 的功能,搞定!

但是,要求的 password 就很有要求了,我敢肯定用戶不大可能記到這樣子的密碼‧‧‧ >_<

相信不足三、二天就一定會有人走來跟我說忘記了密碼;還需努力,再找!

修改 /etc/pam.d/poppassd

刪除 pam_cracklib.so 這一行 (在這行的前面加 # 號)

在這行 “password required /lib/security/pam_unix.so use_authtok nullok”

刪除 pam_unix.so 後面的 “use_authtok”

終於可以睡覺了,但太陽伯伯已經出來!‧‧‧ z… z… Z…

Ubuntu 8.04 LTS Server

(0)

Category : Linux

當我收到 Ubuntu 8.04 LTS Server 這張光盤時,興致勃勃地開始安裝‧‧‧

由一開始接觸 Linux 就是使用 Redhat,別的就從沒有用過;聽說 Ubuntu 是個不錯的 distrubtion。

開始安裝時,也是得簡單,整過過程也不難,好像少了些什麼似的‧‧‧

但是當安裝完時竟然無法以 root 登入,即時 O 晒嘴;對了,安裝時好像並沒有問 root 的密碼!只有使用安裝時建立的用戶登入好了。

最後在線上找到了些有關於 Ubuntu Server 的資訊,原來她是把 root 的帳戶 disable 了,是為了安全吧了。如果要使用只有 root 才能使用的指令,就只得在指令前加上 sudo 才可以使用。

如果要一直使用 root 的身份,可以使用以下指令:

sudo -i

如果要啟動 root 的帳戶,可以使用以下指令:

sudo passwd root

如果要關閉 root 的帳戶,可以使用以下指令:

sudo passwd -l root

也可以在安裝時按 [F6] 進入進階模式,那裡可以啟動 root 的帳號並設定密碼。

解決 dovecot POP3 收信時發生 Mailbox / INBOX 錯誤的問題

(0)

Category : Linux

解決 dovecot POP3 收信時發生 Mailbox / INBOX 錯誤的問題

版本: dovecot-0.99.13-3.FC3

maillog:

pop3(某帳號): Error syncing mbox file /var/mail/某帳號: LF not found where expected
pop3(某帳號): Error indexing mbox file /var/mail/某帳號: LF not found where expected
pop3(某帳號): Couldn’t open INBOX: Internal error occured. Refer to server log for more information.

以 telnet 登入 110 埠:

輸入完密碼後回應: -ERR No INBOX for user.

版本: dovecot-1.0-0.beta2.7

maillog:

pop3(某帳號): Mailbox init failed top=0/0, retr=0/ del=0/0, size=0

Outlook Express 訊息:

登入您的郵件伺服器時發生錯誤。您的密碼被拒絕。…通訊協定: POP3, 伺服器回應: ‘-ERR Mailbox isn’t a valid mbox file’,… 伺服器錯誤: 0x800CCC90, 錯誤碼: 0x800CCC92

解決方法:

以下以 foo 代表某帳號

cd /var/spool/mail
cp foo foo_ 備份郵件
true > foo 清空郵箱

另外寄一封信到 foo 帳號

cat foo_ >> foo 匯入剛剛備份的郵件

即可正常收信

from: http://cha.homeip.net/blog/archives/2006/06/mis.html

在 Linux 的 shell 上搜尋文字並替代

Comments Off

Category : I.T., Linux

今天真的忙過死去活來!在決定放棄使用 Pacific Internet 的寬頻而改用 PCCW 的一刻,已經知道會有這一天的來臨‧‧‧ 無耐 Pacific Internet 實在不爭氣,連我這個 Reseller Partner 也要‧‧‧

接著就是要將我的 Servers (幾部) 的網絡設定,DNS,HTTPD,SENDMAIL,‧‧‧ 全部也要將 IP 更換下來,痛苦‧‧‧

幸好徙網路上找到了一個可以將文字更換的程式,工作就可以比較輕鬆地完成!

#!/bin/bash
#       This script will search and replace all regular files for a string
#       supplied by the user and replace it with another string.
#
#       Written by Daniel McCarthy
# daniel.mccarthy@linuxphile.org
#
function usage {
echo “”
echo “Search/replace script”
echo “    Written by Daniel McCarthy”
echo ” daniel.mccarthy@linuxphile.org”
echo ” http ://linuxphile.org”
echo “”
echo “Not enough parameters provided.”
echo “Usage: ./$0 searchstring replacestring”
echo “Remember to escape any special characters in the searchstring or the replacestring”
echo “”
}

#check for required parameters
if  [ ${ #1 } -gt 0  ]  &&  [ ${ #2 } -gt 0  ];
then
for f in `find  -type f`;
do
if grep -q $1 $f;
then
cp $f $f.bak
echo “The string $1 will be replaced with $2 in $f”
sed s/$1/$2/g < $f.bak > $f
rm $f.bak
fi
done

else
#print usage informamtion
usage
fi

參考:http://linuxphile.org/node/13

更改 root 的密碼

(0)

Category : Linux

有不少朋友至電給小 root 問有關於如更改 root 的密碼,當然不是我的私人密碼啦!是 Linux 管理員帳戶 root 的密碼。

All you need to do is reboot the machine. When you are presented with the Grub menu, hit the ‘e’ key. This will allow you to edit the current boot options. Add the ‘ single’ to the line that begins with ‘kernel /vmlinuz’.  Now press ‘b’ to boot with the modified boot options.

You’ll now be presented with the command line. At the command line simply enter ‘passwd’. You’ll be prompted, twice, for a new password.

Type in ‘exit’ and the machine will continue booting into the normal process. Your root password has now been changed.

轉自:http://linuxphile.org/node/15

Adding GD PHP support to Fedora Core 5 (FC5)

(0)

Category : Linux

A simple way to install PHP-PD in FC5

% yum install gd-devel
% yum install php-gd

restart apache:
% /sbin/service httpd restart

http://iamcam.wordpress.c……pport-to-fedora-core-5-fc5/