Buy Reviews
Powered by MaxBlogPress  

Posts Tagged ‘apache’

用APC來加速你的WordPress部落格

星期四, 五月 13th, 2010點閱人數:37次

前幾天去一個網友eddie的部落格留言,結果發現無法留言的問題,就跟eddie展開一連串的mail對話:

ㄚ琪:

「Dear edde…
最近突然想在你的部落格上回應,感謝您到工作達人上留言!
卻發現
2010-05-06_104128
按了發表後
2010-05-06_104543
這是什麼問題?」

eddie:

「其實這個狀況我發現好一陣子了
不過一直沒能找到真正的原因是什麼 :)
猜想可能跟我在主機上用了APC有關
神奇的是,一般正常的回應可能會遇到這問題
但spam回應卻反而一直進來 :)

看來作為一個格主,絕對不要輕易讓這個功能給停掉,不然會造成民怨喔!不過ㄚ琪事很有好奇新的一個人,就問:

「APC是什麼?滿好奇的!」

eddie:

「您可以在這裡找到更多相關資料
http://php.net/manual/en/book.apc.php
基本上就是拿來做cache的東西
btw, 我是你blog的忠實讀者啊,我有訂閱到google reader裡的 :)

真的沒想到有個死忠讀者,給ㄚ琪很大的勇氣繼續給它寫下去,但是他有訂閱Google reader喔,我可不可以看出誰訂閱啊?這應該是個好問題,留待以後探討!

我回說:「

喔!原來如此!真是感謝啊!
去年我把你所有的文章都讀了一遍說!
不過目前在瘋攝影…

eddie:「

說來不好意思

我去年都在忙工作的東西,幾乎沒什麼更新到文章了 :)

最近的話我大部份的工作都是在弄ruby跟python

所以文章大概會以這兩者居多了

我喜歡看別人的攝影作品,但攝影相關的技術我其實不熟

雖然最近也買了台新相機 GF1

不過很多功能都還在學就是了 :)

嗯!最近他的站上確實多了很多ruby跟python的東西了,也有台GF1的相機,以後應該也可以互相交流吧!我在猜!

所以今天有空來看看APC的功能,這個東西馬上讓我聯想到了eAccelerator,不過我沒在用!後來就又想到APC應該可以幫助點工作達人這種Wordpress加速吧!馬上繼續找APC 跟Wordpress的關係!

4+1 Ways To Speed Up WordPress With Caching

看了這一篇後又發現有其它方式的效能加速的工具,而APC是PHP Compiler Cache的一種加速方式!

好,決定安裝試試看,希望不會有eddie的問題!

要安裝APC在Ubuntu機子上,請看Installing Alternative PHP Cache (APC) on Ubuntu 8.04 PHP5 Apache2

我簡略的說明,APC需要的套件:

apache2-threaded-dev : 這個套件提供了apache2的執行緒版本的開發版本表頭檔跟apxs2執行檔

php5-dev : 這個套件提供PHP5原始碼來編譯額外的模組的檔案。

php-pear : 這個套件包含PHP的基本PEAR類別,跟PEAR安裝器。

make : make 工具

gcc : C 程式語言用

g++ : C++ 程式語言用

使用apt安裝上述所有的套件:

apt-get install apache2-threaded-dev php5-dev php-pear make gcc g++

然後:

pecl install apc

中間有一個選項會詢問你,yes/no,預設是yes,我就選yes了,之後可以見到

Build process completed successfully

那就表示安裝成功了!

好,重啟動Apache,開始試用,不知你是否感覺工作達人變快了,請說說你的想法給ㄚ琪知道,感恩!

Managing an Apache Server review

星期二, 二月 2nd, 2010點閱人數:27次

加入BlogAD

In 2007 I wrote a Chinese article “監控網站紀錄檔”about how to monitor the site’s log files. I did not use webalizer because it’s not displayed correctly. I changed to install awstats and it’s cool. Last year my server crashed every day. I wrote a Chinese article “ubuntu當機問題”about how to solve the problems. Today I read the article http://www.web-articles.info/e/a/title/Managing-an-Apache-Server/ to study about the new way of monitoring the apache server.

By default, the Apache server stores these log files at /usr/local/apache/log/. But in Ubuntu the Apache server stores the log files at /var/log/apache2/. When viewing directory listings in /var/log or any of its subdirectories, we may encounter log files with names such as accesss.log.1, access.log.2.gz, and so on. It’s because the logrotate command of course  and it built in our system. Wow! It’s enjoyable and we did not need to install the software.

The author presented the mod_status and mod_info module but for security I do not suggest the modules. He also shared monitoring tools include the following: · big brother system and network monitor · mon, the Service Monitoring Daemon. I think it’s useful to me.

The second article I want to talk about is http://www.webworldarticles.com/e/a/title/Using-analytics-metrics-to-make-SEO-decisions/. This related my Chinese article “ SEO 7 個步驟”.  From “工作達人跳出率82.21%” we know to lower Bounce rate to 50%. The author suggested us to write how-to articles. And I suggest you can put the target=”_blank” in <a> tags.

And in this section “Using analytics data to make SEO decisions”.  It’s hard to understand how to create the chart so I give up to read.

XAMPP apache

星期一, 十一月 9th, 2009點閱人數:135次

XAMPPㄚ琪是自從去年五月多進入新的公司後,因為公司的權限卡得很緊,長官又有時間的要求,所以那時就找上XAMPP 1.6.6a來裝的,我唯一看上它的一點就是可以只用解壓縮的方式,就可以在Windows系列的本機localhost上跑,這對不懂Apache、MySQL、PHP的初學使用者可以說是真easy!

那時的版本就有很多工具可以使用了,如下:

Apache 2.2.8
MySQL 5.0.51a
PHP 5.2.5 + PHP 4.4.8 + PEAR
PHP-Switch win32 1.0 (please use the "php-switch.bat")
XAMPP Control Version 2.5 from www.nat32.com   
XAMPP Security 1.0   
SQLite 2.8.15
OpenSSL 0.9.8g
phpMyAdmin 2.11.4
ADOdb 4.96
Mercury Mail Transport System v4.52
FileZilla FTP Server 0.9.25
Webalizer 2.01-10
Zend Optimizer 3.3.0a
eAccelerator 0.9.5.2 for PHP 5.2.5  (comment out in the php.ini)

*系統需求也不會很高:
  + 64 MB RAM (RECOMMENDED)
  + 200 MB free fixed disk
  + Windows 98, ME
  + Windows NT, 2000, XP (RECOMMENDED)

到現在新版的1.7.2已經在八月出來了,相對應的工具有

  • Apache 2.2.12 (IPv6 enabled) + OpenSSL 0.9.8k
  • MySQL 5.1.37 + PBXT engine
  • PHP 5.3.0
  • phpMyAdmin 3.2.0.1
  • Webalizer 2.21-02 + GeoIP lite
  • FileZilla FTP Server 0.9.32
  • msmtp 1.4.17
  • 看來已經有很大的差異了,應該趕快更新一下才好!
  • 對於現在常用Vista的人來說,也有一些注意的事項,有興趣的人可以上他的繁體網頁瀏覽
  • 要下載檔案可以進入
  • EXE (RAR-Sfx)
    44 MB
    RAR 自動解壓縮檔
    MD5 checksum: 14c2e3e35f9792b9aec674548472348b

    ZIP
    84 MB
    ZIP 壓縮檔
    MD5 checksum: 087af5c2e6a936dd90587e0bacc3aef3

    下載這兩種不同的XAMPP Windows 1.7.2安裝方式!

ubuntu當機問題

星期二, 一月 13th, 2009點閱人數:263次

最近ㄚ琪琪的家、工作達人、還有最近幫教會建的2009北區單成活動報名系統,發現沒多久就當機,造成ㄚ琪很大的困擾,所以開始不斷的監控主機到底什麼問題?
昨天使用top監控時,突然發現一堆apache2的資源被使用,然後swap free的空間突然變為0,之後就是無法監控,想當然就是當機了,不過這樣已經給我幾個方向了:
1.網站的流量太大,這是該高興還是要哭啊?不過既然這樣,就要從加大頻寬、控制流量、限制apache的使用以及mysql資料庫的使用著手

2.硬體資源不足,唉!四個小朋友太少了,所以硬體一直很差,記憶體不夠,從五個方向來評估及著手:

一、是擴充記憶體,我現在是用PC133 的SDRAM,大家應該都知道我這是古董級的了吧!所以我正著手採購512MB的RAM,如果有好心的善心人士,可以送給我或便宜賣給我,我會更感謝的。

二、是減低使用的資源,努力學習怎樣讓Ubuntu的載入服務降低,已減少使用的記憶體,我會再開另一篇文章說明目前正在測試減低使用的資源

三、關掉gnome視窗,原本想好玩看看,偶爾也只在高雄家中看看,不過這應該是記憶體浪費的很大元兇吧,不過現在的Ubuntu版本不好設定為文字模式的啟動畫面,很有可能過年回家時才能作。

四、既然swap變為0,那就從擴充swap硬碟空間來作。

五、買新規格的記憶體,DDR2 或 DDR3的現在真的很便宜,不過就是要整個主機大改造了,這個要coco的。

目前想到的就這些,如有新的進展,再加入紀錄。

監控網站紀錄檔

星期五, 三月 23rd, 2007點閱人數:47次

Google廣告工具 一書裡示範使用webalizer
我在Ubuntu機器裡裝webalizer後,發現全是亂碼, 真是不優

只好改用之前在用的AWStats, Peter’s blogAwstats under Ubuntu寫的不錯!

我補充一下安裝的步驟:
1.sudo apt-get awstats
系統會建議您也安裝:libgeo-ipfree-perl,libnet-xwhois-perl,我就順便也給他裝了

另外,設定檔中的LogFormat=1,需要跟apache的設定檔搭配,也就是其access_log的格式要長得像下面這樣:
111.22.33.44 – - [10/Jan/2001:02:14:14 +0200] “GET / HTTP/1.1″ 200 1234 “http://www.fromserver.com/from.htm” “Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)”
在apache中的命令像這樣:
CustomLog /var/log/apache2/access.log combined

嗯,這樣行了,雖說是big5編碼的,但是使用起來不會有亂碼!