Archive for the ‘Server Diary’ Category

Bluehost 筆記

Wednesday, April 4th, 2007

結果選了 Bluehost。原因很多而且說不清,但是簡單說就是讀了很多 BH Forum 上面的文章後最後 follow my heart 所作的決定。是不是因為裡面 moderator 說 BH 是 CEO 的 baby 我不知道,反正綜合了很多文章最後內心裡面的奇妙邏輯決定要 BH 的。

有關 BH 的一些 note:

Installing SVN 1.4.3 (source)

#

# this is how I installed subversion 1.4.3 on my bluehost account

#mkdir ~/src

# get and make 'apr-0.9.13' (this isn't included in the subversion tarball)

cd ~/src

wget http://apache.ausgamers.com/apr/apr-0.9.13.tar.gz

tar -xzf apr-0.9.13.tar.gz

cd apr-0.9.13

./configure --prefix=$HOME

make

make install

# get and make 'apr-util 0.9.13' (this isn't included in the subversion tarball either)

cd ~/src

wget http://apache.planetmirror.com.au/dist/apr/apr-util-0.9.13.tar.gz

tar -xzf apr-util-0.9.13.tar.gz

cd apr-util-0.9.13

./configure --prefix=$HOME --with-apr=$HOME

make

make install

# get and make 'subversion-1.4.3'

cd ~/src

wget http://subversion.tigris.org/downloads/subversion-1.4.3.tar.gz

tar -xzf subversion-1.4.3.tar.gz

cd subversion-1.4.3

./configure --prefix=$HOME --without-berkeley-db --with-zlib --with-ssl

# at this point there's a bit of complaining about berkeley db, let's ignore that...

make

make install

# check it works!

cd

svn --version

# yay!

SSH

Helpdesk 裡面說要寫信到 support@bluehost.com,但是其實不是。寫過去只會被退回說現在必須開 ticket 才行。正確做法是進入 cPanel (BH 的 cPanel 好像比 HM 的好看) 然後注意看右下角會看到一個 SSH Access 的選像,點下去就會把你丟到正確的地方了。填好資料 (domain name 和 cPanel 的密碼) 然後送出後的下一頁就可以夾帶檔案。把駕照用數位相機拍下來夾上去就 ok 了。

SSH 是個 chroot 的環境,但是但部分軟體像上面那樣,只要 configure 實後記得加 –prefix=$HOME 其實都可以裝。有個很爛的就是他對外所有連結只能 port 80。不能 ssh 回家耶,不能 sftp 回家耶,有沒有爛到這種程度 \囧/

Domains

BH 只收 5 個 addon domain,加上原本的 master domain,全部只能有 6 個。搞不好我會開始反悔了。不過說真的她資料夾的放法有夠弱,我還不知道有比 1&1 更弱的放法。她所有 addon domain 的資料夾都是掛在 ~/public_html/ 下面,並不能由選單上面選擇說你要放在 ~/domains/domain1/ 之類的更合邏輯的資料夾。根據 forum 上指出,其實打電話去可以叫 tech support 幫忙手動改,所以可能會等把所有 addon 都放上後再一次看哪些要改全部一起改吧。

Support

他們的 Support 系統如果拿 1&1 的來比的話,1&1 根本是大便。電話打進去如果沒有馬上接起來的話,會每分鐘跟妳說你前面還有幾個人在等,我等最久也才 5 分鐘左右。跟 1&1 的 3x 分再加後面的 1x 分 on hold 比起來,天使吧。

他們的 Ticket 也回應頗快,每個丟出去的 Ticket 都有個 Due Time,都是 12 HR 內得回應。好吧目前為止我只丟了兩個,但是這兩個都有在時限內回,而且都回的頗快的。至少到目前為止都還很滿意。

Bandwidth

從台灣學網對 1&1 和對 BH 的速度比起來,BH 很明顯快太多了 (160KB/s vs 38KB/s),然後我從家裡對 1&1 和 BH 的測試則是 1&1 略快。不過可能是 BH 對每個 TCP connection 有限制,所以我把 FlashGet 調成 6 條後速度也是一樣 max 在 cable 的頻寬。1&1 <–> BH 的速度還真黑皮,每個 TCP connection 的速度都是 1MB/s,然後同時 wget 四個檔,全部也都是 1MB/s。

將陸續增加..

Thoughts on server

Tuesday, April 3rd, 2007

真是個大問題,這兩天有在用心的思考該不該更換目前的 Hosting Plan

  • Colocation: 好一點的主機實在太貴了,所以短期內大概不大可能去買台 1U 主機然後丟 Datacenter 吧
  • Dedicated: 實在找不到比現在這個 1&1 的 Dedicated Root Server 更好的 Plan 了,雖然硬體實在真的很爛
  • VPS: 所有看到(付得起) VPS 的 disk space 實在小的無法接受阿 Orz
  • Shared Hosting: 頻寬大、空間大、設備好,看起來實在是聰明的選擇,但是不能惡搞主機

所以我覺得我大概是需要把需求分開來才對:

  1. 空間
  2. 流量
  3. 效能
  4. 控制

想一想,其實 1, 2, 3 只要找個好的 Shared Hosting Plan (像是胸毛男現在在用的 HostMonster?) 就可以輕鬆 cover,可能得仔細的讀 review 不要小心找到一間容易被丟到操的很兇的 server 上就好了。

要達到 4 隨心所欲的控制的話,還是得至少有 VPS 才可以。但是想一想,需要隨心所欲控制的部分,需要用到那麼多的功間、流量、和效能嗎?好像不用耶,就頂多拿來編些程式、跑些不該跑的東西、抓些不該抓的東西、丟給一小圈的人下載 (以上純為假設) 之類的事情。

總和以上,看起來取得兩個 Plan 會比較划得來。反正如果 shared hosting 上有 shell access 的話,也可以直接丟個 cron 之類的把 VPS 上的東西抓到 shared hosting 上然後再丟出來,頻寬嘛 XD

Server down past 3 days

Monday, April 2nd, 2007

I was working on something that’s probably not important because I don’t remember what I was working on. But anyway, 3/31/2007 morning, the server is suddenly offline, and it leads to my letter to 1&1:

===========================

Hi,
My customer id is [EDIT] and the question is regarding to the Root Server
with contract ID [EDIT].

My server became unreachable this morning (3/31). Since this happens once in
a while so I just go ahead and restart the server via the 1&1 Admin Panel.
The server did not come back online, so I tried logging in via Serial
Console. Server looks normal, nothing changed. However, it looks like the
DHCP server on your side is down for unknown reason. I've attach some
relevant command output below:

[root@u15185402 ~]# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:129 errors:0 dropped:0 overruns:0 frame:0
          TX packets:129 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:22508 (21.9 KiB)  TX bytes:22508 (21.9 KiB)

[root@u15185402 ~]# dmesg | grep eth0
eth0: VIA Rhine II at 0x1e000, [EDIT], IRQ 15.
eth0: MII PHY found at address 1, status 0x7849 advertising 05e1 Link 0000.
eth0: link down

[root@u15185402 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
169.254.0.0     *               255.255.0.0     U     0      0        0 lo

[root@u15185402 ~]# dhclient eth0
Internet Systems Consortium DHCP Client V3.0.2-RedHat
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

Listening on LPF/eth0/[EDIT]
Sending on   LPF/eth0/[EDIT]
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

[root@u15185402 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr [EDIT]
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:15 Base address:0xe000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:136 errors:0 dropped:0 overruns:0 frame:0
          TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:22909 (22.3 KiB)  TX bytes:22909 (22.3 KiB)

[root@u15185402 ~]# dmesg | grep eth0
eth0: VIA Rhine II at 0x1e000, [EDIT], IRQ 15.
eth0: MII PHY found at address 1, status 0x7849 advertising 05e1 Link 0000.
eth0: link down
eth0: link down

I tried calling the support number 1-877-206-4255 but was disconnected for
unknown reason before I reach a customer representative. Please help.

Thanks,

Peter

After two days no response, I called them again. Being put on hold for about 30 minutes, I was finally able to talk to a customer service. The rep told me my server is sending packets with fake MAC address and therefore my account is suspended. WOW. He was not able to do anything but elevate this case and put a high priority tag so the server department will be able to look into it later. Next morning, I suddenly saw the server back online again. Immediately after that I receive this letter:

===========================

Dear Peter Chang, (Customer ID: [EDIT])

Thank you for contacting us. Your server has been disabled at the switch
because it was generating traffic with false MAC address header
information.  This is most often due to a virtual machine running with
an independent interface. To use virtual machines on your server, you
must use NAT so that the virtual machine uses the host interface. I have
reenable the server back onto the switch and you r server is now
pinging.

If you have any further questions please do not hesitate to contact us.

--
Sincerely,
Chad Hodgdon
Technical Support
1&1 Internet

WOW. Virtual Machines? It can’t even run smoothly as 1 machine. How can my computer generate traffic with false MAC header? I really wonder how this happens. Also I don’t get any letter or any call telling me the account is suspended, is that normal? Anyway, it’s back, and I’m happy for now. Colopronto is looking very attractive though.

Joomla 1.1.0 alpha 2 to 1.5.0 beta

Saturday, December 30th, 2006

The meat of a site lies in the table `jos_content`. To import the old dump of `jos_content` from Joomla 1.1.0 alpha 2 into the latest 1.5.0 beta, you must take account of the new row presented in 1.5. To do this, use any text editor that has a replace string function and open up the sql dump of the `jos_content` section.

Replace ); with ,''); and save the file in UTF-8 if it contains special characters. Then simply import the file into phpmyadmin and then all the previous articles are imported.

You might have different Section/Category ID in the new Site, to update the database to reflect change:
UPDATE jos_content
SET `sectionid`=NEWID
WHERE `sectionid`=OLDID

replace `sectionid` with `catid` for categories.

雖然說昨天就把 http://lmj.tw/ 弄好了,但是忘記把 Apache 密碼拿掉,大概會被認為又沒有弄好吧.. XD 不過現在還長的真醜,晚點來把網頁美化。

back back back

Thursday, September 7th, 2006

All Rights Reserved Copyright © 2008 Design by StyleShout and Clazh