貧窮人家

Just another IT worker weblog

Server is Dwon!!??

吃完飯回來, 小阿姨說進不去伺服器….

樓上沒關機的可以用, 一旦離開後就進不去了…

感覺好像是Service出問題, 檢查了一下Service, 果然少了一點點的東西… 怎會如此??  想不通??  不管, 先重啟系統看看.

重啟後再檢查一下, 嗯… 資料庫起來了, 看來一切正常, 但是還是進不去. 試著ping看看, 吚… 不回答. 看一下伺服器端, 燈號是亮著的, 再看一下設定… 哇… 真是太神奇了, NIC不見了!! 趕快翻出Driver, 重新安裝. 原本想保留上回重新的中文版Driver. 但是裝好重開後仍然不行, 只好裝上原本附的英文版. 再次重新開機後, 終於回復正常.

這一忙… 剛好一個小時. :-(

The Joel on Software Translation Project:萬國碼

每個軟體開發者都絕對一定要會的Unicode及字元集必備知識(沒有藉口!)

The Joel on Software Translation Project:萬國碼 – The Joel on Software Translation Project

這是篇在網路上爬文時發現的,好奇看了一下,寫得真好.現今一般的軟體開發者都弄不清楚這問題.弄得使用者常看不懂收到的東東上出現的外星文.

好文要收藏...

Table ‘visiter-counter’ is marked as crashed and should be repaired”

發現網站人次變為0,檢查伺服器發現原來是空間被用光了.
由於人次使用 mysql 儲存記錄,檢查出現錯誤的訊息
Table ‘visiter-counter’ is marked as crashed and should be repaired”

先把空間還回來,再來進 mysql,用下列指令修復 table
REPAIR TABLE `visiter-counter`

回頭檢查網頁上的人次記錄,回來了說

Note: MySQL Change User Password

Dammmm…. forgot how to change user password in mysql.  Make a note….

1)login to MySql server, type following command at shell prompt to login as root
$ mysql -u root -p

2)Use mysql database
mysql> use mysql;

3)Change password for user test:
mysql> update user set password=PASSWORD("TEST-PASSWORD") where User='test';

4)FLUSH PRIVILEGES
mysql> flush privileges;

Why am I always wrong, the password = password (“xxx”) labeled password = “xxx” ??? :-(

無法ping?

網路出現一個怪現象:可以上網,但是卻 ping 不到主機.

掃了毒,查了線,最後重新安裝也無法解決.

最後...解決了--把 Hub 關掉重開.

這應了一句話-魔鬼就藏在細節裡!

 

 

升級 php 5.1.6-29 為 5.2.16

CentOS 5.5 PHP 升級到 5.2.16 (yum)
因為 CentOS 5.5 yum 預設提供的 php 是 5.1.6-29
某些套件需要較新的版本才能安裝,所以只好更新一下

參拜一下古狗大神…..

1.匯入 rpm key

rpm -import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

2.編輯 yum 檔案

vi /etc/yum.repos.d/CentOS-Base.repo

在檔案最後面,加上下面幾行後存檔

[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

3.yum 更新 php

yum -y install php

4.檢查版本

[root@localhost ~]# php -v

變成 PHP 5.2.16

5.最後再修正一下設定檔內容

cp /etc/php.ini.rpmnew /etc/php.ini

cp /etc/httpd/conf.d/php.conf.rpmnew

vi /etc/php.ini
;default_charset = “iso-8859-1

改為 default_charset = “UTF-8“  ( ; 記得拿掉)

magic_quotes_gpc = Off

改為 magic_quotes_gpc = On (可以減少繁體中文字特殊字的問題)

;error_reporting = E_ALL & ~E_NOTICE

改為 error_reporting = E_ALL & ~E_NOTICE  (;拿掉)

error_reporting = E_ALL

改為 ;error_reporting = E_ALL  (加上;)

放寬 memory_limit = 64M,改為 memory_limit  = 128M  (CentOS 5.5 內預設為128M)

放寬 max_execution_time,由 30 改為 max_execution_time = 300

確認 register_globals = Off ( CentOS 5.5 內預設為Off )

6.再確認一下

yum update

7.重新啟動 httpd

/etc/rc.d/init.d/httpd restart

或 service httpd restart

看一下網頁… 都正常說.

CentOS Setup Note for Me.

Set up host name and address

Use system-config-network-tui to set up IP, Netmask and Gateway:

system-config-network-tui

Edit /etc/sysconfig/network and set hostname:

NETWORKING=yes

NETWORKING_IPV6=no

HOSTNAME=hostname.domainname.com

Edit /etc/resolv.conf and add DNS servers:

nameserver 168.95.1.1

nameserver 168.95.192.1

Edit /etc/hosts, according to system settings:

127.0.0.1 localhost.localdomain localhost

192.168.100.100 hostname.domainname.com hostname

Restart network:

service network restart

If using GUI interface (ex. Gnome), Restart it by:

init 6

Installing prerequisites

yum install -y gettext httpd mysql mysql-server dovecot postfix system-switch-mail perl

yum install -y php php-mysql php-xml php-imap php-mbstring php-mcrypt php-pecl-Fileinfo php-pecl-memcache

php-pear-DB php-pear-File php-pear-Log php-pear-Mail-Mime php-pear-Auth-SASL php-pear-Date

php-pear-HTTP-Request php-pear-Mail php-pear-Net-Sieve php-pear-Net-Socket php-pear-Net-SMTP

php-pear-MDB2-Driver-mysql php-gd php-xmlrpc php-soap php-pecl-json

yum install -y php-pear-Date-Holidays <– (for now, this package is available in the EPEL[1] repo)

yum install -y openssl mod_ssl crypto-utils perl-Net-SSLeay <–(for https secure browsing)

yum install -y php-devel gcc <–(if you want to install extra pecl modules – PS: use ‘pear install pecl/module

ps. About EPEL repo: http://fedoraproject.org/wiki/EPEL

Configuring Postfix and Dovecot

Turn off sendmail:

service sendmail stop

chkconfig sendmail off

system-switch-mail

(select postfix)

Configure Postfix:

postconf -e ‘home_mailbox = Maildir/’

Edit /etc/dovecot.conf and add the following to the end of the file:

# to allow the creation of mail subfolders

mail_location = maildir:~/Maildir

# Enable IMAP protocol

protocols = imap

If using CentOS x86_64, temporary fix for this bug

login_process_size = 64

To configure the rest of postfix, such as domain name and secure connections, take a look at this nice tutorial: http://fedorasolved.org/server-solutions/postfix-mail-server

Start Http, Postfix, Dovecot and MySQL services

service httpd restart

chkconfig httpd on

service postfix restart

chkconfig postfix on

service dovecot restart

chkconfig dovecot on

service mysqld restart

chkconfig mysqld on

Configure mysqld root password:

/usr/bin/mysqladmin -u root password ‘new-password’

/usr/bin/mysqladmin -u root -h hostname.domainname.com password ‘new-password’

Creating database and tables in MySQL

For those who want everything in UTF-8

MySQL default charset is “latin1″ (or ISO-8859-1).

It happens that keeping evertyhing in UTF-8 is a good practice and prevent a lot of trouble in the future, as mentioned here.

Turn MySQL installation to UTF-8, inserting these lines into /etc/my.cnf file:

[mysqld]

collation_server=utf8_general_ci

character_set_server=utf8

init_connect=”SET NAMES ‘utf8′”

[client]

default_character_set=utf8


Fedora 13 無法啟動 POP3 & 無法收信

肥龍的主機又掛點, 換了 Fedora 13 後, pop3 起不來, 檢查 port 110 沒有 listen.

重新啟動dovecot發現不太”正常”… 看不到命令提示???

改用yum update dovecot升級看看.

問題仍沒解決… :-(

再狠一點…  yum reinstall dovecot

:-( :-(

yum erase dovecot

yum install dovecot

終於可以起來了.. 感動呢…

用 netstat – a 檢查 imap pop3 都有在 listen

telnet localhost 110看看

user xxx

pass ppp

出現錯誤… 被遠端伺服器中斷…

用 outlook 收信出現
您的伺服器突然結束連線。可能的原因包括伺服器問題、網路問題或長時間閒置。 帳號: ‘user.aaa.bbb.ccc’, 伺服器: ‘aaa.bbb.ccc’, 通訊協定: POP3, 連接埠: 110, 安全(SSL): 否, 錯誤碼: 0x800CCC0F

最後…. 在user目錄中忽然發現…沒有Mail目錄.

用mutt開信箱看看…. 哈.. 發現了. 建一個給它用.

再用telnet localhost 110 試連看看.. 好了吔! :-)

再回到outlook收看看…. 正常了說.

弄了半天, 從dns一直到移除重裝dovecot, 安裝outlook.

居然忽略掉了最基本的Mail目錄. 用看的就可以解決的. :-D

套句前人說的話: 小處著眼, 大處著手.

永遠別小看那些小螺絲釘… :-D
P.S.記性慢慢變差了?? 指令一直打錯. 哎! 天曉得有些指令好多年才用那麼一次. 想不忘還很困難.

Avast 無法更新?

今早發現Avast無法更新, 總是出現 “嘗試xxx.xxx.xxx.xxx:80//iavs5x/servers.def時,發生其他HTTP錯誤(0)”.

試了半天, 感覺應該是網路問題, 但又能通,

後來按了一下右上角的”設定”->”更新”->”設定代理伺服器”->”自動偵測”
一下下就給它好了說

又見病毒

繼上星期煮麵的拿了個號稱不能用的usb碟, 找到了幾隻病毒後, 今天又拿了一支, 也是中標…哎…………
手動作掉它.

Follow

Get every new post delivered to your Inbox.