Archive for the ‘Internet’ Category

List of actually useful PR 10 pages

Friday, April 21st, 2006

Here is a list of current (as of last updated time/date) PageRank (PR) 10 pages that are actually useful:

More useful PR10 pages are to be added.

1&1 Server ReImage Notes

Monday, April 3rd, 2006

Recently, 1&1 released Fedora Core 3 with Plesk 7.5 as one of the images server administrator can restore to. Since I've messed up the server a lot, instead of spending more time trying to figure out how to fix it and upgrade it, a quicker solution is to reimage it to FC3. This leads to backuping things up. I tried to get ftpfs working so there would be easy access to 1&1's backup server, but the process seems like this: I'm getting close the solution, but there is this one problem which leads to another problem, and then as I get close to the solution of this another problem, there's another one problem that leads to another another problem. You get the idea. Anyway, I ended up using tar and ftp command to manually backup files and upload them onto the backup server.

Directories backuped:

  • /etc
  • /home/httpd
  • /var

1&1's FAQ has an article "What should I backup?" and I think… yeah… well… it's a 1&1's FAQ, as long as you're happy. I use the standard tar zcvf to add each directory info one .tgz file and then upload it onto the backup server. After these, simply go to the admin panel's Server ReImage page, and select Fedora Core 3 w/ Plesk 7.5, then click the button. In about 40 minutes? Maybe less? The refreshed page finally shows Server Ready.

These are what I really used during restore:

  • /etc/csh.cshrc
  • /etc/screenrc
  • /home/httpd
  • /var/lib/mysql

I tried to restore mysql database through the dumped out database via phpmyadmin by uploading them into the sql query window. It doesn't work (orz). What I found out that worked way easier is to create the database & user via Plesk first, and then copy the old database files onto the new ones. Files are located under /var/lib/mysql/[databasename]/. Since I'm getting my old files back from the FTP backup server, installing FTPFS helps a lot.

Additionally, there are other things to do after the newly reimaged server:

  • Move /opt to allow Plesk 8.0 update: For some mysterious reason, Plesk 8.0 refuse to install unless you have enough space under /opt. Ironically, by default, there is not enough space. So to make Plesk 8.0 happy in this FC3, link /opt to /home/opt.
  • Change the timezone: relink the file /etc/localtime to the correct timezone listed under /usr/share/zoneinfo. For mine:
    ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime
  • Add ntpdate into root's cron:
    0 * * * * /usr/sbin/ntpdate time.ucla.edu
  • Essential packages: yum install cvs firefox openssl python-devel subversion vim xterm
  • Essential Packages not available via yum: apt, ncftp. rpm -iv files.

Also within /etc/my.cnf under [mysql.server], add in:

set-variable = max_connections = 300
set-variable = max_user_connections = 300

Do they work? I haven't get a chance to try yet.

To be updated later if new things came across.

VoipStunt Paid

Monday, April 3rd, 2006

在老木來的這個禮拜裡面, 去給 VoipStunt 付費了. 為什麼? 因為老木要打電話回去跟中華電信抱怨說為啥明明廣告說 3G 電話拿到哪裡都可以用, 來美國後竟然不能用. 用電話卡打國際電話回台灣 complain 實在有點小白, 於是興起了用網路電話打的念頭. 但是最近 VoipStunt 的一分鐘限製作的十分徹底, 1 minute, cut. 所以想說用 Skypeout 或者 Voipstunt 選一個. 用上次得到的 $.20 SkypeOut credit 來打回去給老北試, 看起來效果似乎真的跟電話差不多. Voipstunt 則是音質差了那麼一咪咪 (難看的使用介面造成心靈層面的質感問題?), 但基本上效果也是跟電話一樣. 但是 SkypeOut 每分鐘要算錢, VoipStunt 則不用算, 所以結果很明顯了.

根據 VoipStunt 官方網頁的說法是只要帳號裡面有餘額, 就不會有一分鐘的限制. 雖然這麼說, 但是進入付費網頁後, 發現最低也要存入 $10 EUR. 根據 XE.COM (PR9) 網站的資料, $10 EUR = $12.13 USD. 那實際上銀行顯示是多少呢?

VoipStunt Fee

他還會存了 $0 來跟我講說要 charge 我 $10 Eur + $.36 手續費, 真是貼心阿. $12.43 USD 根據 XE.COM (PR9) 折合新台幣 $405.27.存完後 balance 馬上就變成 $10, 然後討厭的 1 minute limit 也不見了. 除此外基本上都完全一樣. 真的都讓你無限制的打到爆嗎? 會倒吧… Orz 所以他們有限制在你付費完 120 天內得用完.

VoipStunt 4 month limit

那可不可以共用帳號? 答案是… 否定的. 他不會像 Sype 一樣讓你同時在兩台電腦 Sign in, 然後人家打來時候兩台電腦同時響 (新的版本還會不會不知道耶.. 以前的都會這樣). VoipStunt 的做法則是像一般的 IM, 這台 Sign in, 之前那台就會自動被 Sign Out. 不過只要同時間只有一個人用, 那看來是沒問題的. 所以一個月 $100 台幣可以無限制的打那麼多的國家 (台灣手機參照這篇), 很划算啦 XD

HOWTO: mount ftpfs under linux

Sunday, April 2nd, 2006

1&1's Dedicate Servers come with a free FTP backup account that is only accessible within the server, and has a capacity matching the server's harddrive. Wouldn't it be nice if I don't have to use text-only ftp command to put, get files from that server? Yeah, mount it as an directory.
There are couple options available:

FTPFS is obsolete. Since FUSE is merged into Linux Kernel 2.6.14, it seems reasonable to choose FUSE than LUFS. So the task now is to recompile a Linux Kernel version 2.6.14 and up with FUSE support. As far as how to compile the kernel, there are way too many articles detailing step by step howtos. Since this dedicated server is using FC3, I followed this article. If you have a kernel 2.6.14 and up and want to enable FUSE, simply add this into your kernel's .config file.

CONFIG_FUSE_FS=y

Reboot with the new FUSE-enabled kernel, then we're ready to use all the Filesystem based on FUSE. There were quite many. Since the focus is to mount FTP access as a directory, using FTP as keyword and search through the page brings us to two choices:

CurlFtpFs seems to be more feature-rich, so I went with it. Note that on SF's Project Detail, the Development Status is 3-Alpha, so use it with your own risk. Since I'm only working on occasional copying and retrieving of backups, and it works fine, I'm happy with it. Installation of CurlFtpFs is simple, given that libcurl and dependencies are installed correctly. These are the steps:

  • Download and extract the latest version of CurlFtpFs here.
  • Configure: ./configure
  • Compile: make
  • Install: make install

So it's done. Mounting procedure is as followed:

  • mkdir MountPoint (eg: mkdir /backup)
  • curlftpfs -o user=USERNAME:PASSWORD ftp://FTPHost/ MountPoint/
    (eg: curlftpfs -o user=testusr:mypass ftp://127.0.0.1/ /backup/)

Done. Now that FUSE is installed, here are some other interesting filesystems available under FUSE:

I was trying to get Flickrfs working has no success at the authentication part where I need to authorize the Flickr API to access my Flickr photos. If you succeed, please tell me how.

How to prepare your site for Digg Effect (Diggstruction)

Sunday, March 19th, 2006

No more database error due to too many connections.When a site was dugg to the front page of Digg, the amount of requests to the server will usually take down small sites running on relatively low end hardwares (small RAM, slow CPU, HDD). To prevent this from happening to your site (specifically, WP blogs), there are things you can do to maximize what low end hardwares can manage, and therefore prevent the Digg Effect.

From last experiment, I am very aware this $69/mo (now $99/mo) 1&1 Dedicated Root Server with 2.0Ghz Celeron, 512MB RAM and 40GB HDD cannot take on Digg Effect without doing some tweaking. Here are the measures I’ve gathered:

1) Cache it: WP-Cache 2.0

A very-easy-to-install-and-use plugin. By creating cached pages, it reduce the php code parsed by the web server, and also eliminate the query to mysql database. Both speeds up the page load dramatically.

You can test to see the difference by doing very simple test, this is what I get:

Without cache:

time wget http://blog.tarotoast.com/
>> 0.005u 0.007s 0:01.36 0.0% 0+0k 0+0io 0pf+0w

With cache:

time wget http://blog.tarotoast.com/
>> 0.003u 0.012s 0:00.02 50.0% 0+0k 0+0io 0pf+0w

I don’t really know what all numbers mean, but I know the time for the request is reduce from 1.36 second to .02 second. Keep in mind, however, counter plugins (like Counterize) will not count requests for cached pages (so you don’t feel as good).

2) Apache 2: MPM Worker

Taken directly from Apache’s website:

This Multi-Processing Module (MPM) implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve a large number of requests with less system resources than a process-based server. Yet it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads.

In order to use the php module, you need to compile it with thread safety.

3) Stress Test with ab

ab stands for Apache Benchmarking

ab -n 100 -c 100 -d http://URL

This will give you an idea how your webserver can handle traffic.

*Warning: set the number small and increase it slowly.

4) Additional Tweakings

Digg

All Rights Reserved Copyright © 2008 Design by StyleShout and Clazh