Host Affection

算一算寄居在 Host Affection 也已經有兩年的時間了。
他算是賣 Steadfast.net (NoZone, Inc.) 的 reseller,但是價錢比 Steadfast.net 還漂亮。我用的是他們最基礎的 starter plan:300MB / 6GM / 3 domain hosted / unlimited database ...(more)。雖然空間不大,但是對我這種小使用量來說,已經綽綽有餘。

一年 15 元美金,換算台幣大概 500 以內,可說是相當的便宜。之前也用過自己架設 server,但是光是一年電費就不止這些了。而且還要自己維護系統的穩定與安全,定期升級等等,就以經濟與環保考量,還是租用主機來的方便。

功能算是完備,PHP、CGI、MySQL、Postgre、Shared SSL 等等,該有的基本功能都有。也支援 .htaccess 的使用,讓架設網站的細部設定更健全。後台的 Control Panel 也算是蠻簡便易懂的,輕鬆安裝 CMS 或創建新資料庫都是按一按就可以完成。他們的客服也很積極,只要藉由 Support Tickets,送出後多半在幾小時內就一定會有人答覆。截至目前為止每次的技術支援,我都還蠻滿意的,很快就解決問題了。

雖然伺服器速度不快,有時候會掛點,但是至少整體而言表現不差啦!查了一下台灣好像蠻少網站用他們的空間,想說使用起來還算滿意,就幫他們廣告一下囉!小流量的網站可以考慮看看!

自動將資料庫等資料備份到Gmail

首先必須安裝 mutt,放在 /usr/ports/mail/mutt
然後就可以複製這份 script 來修改成你的版本

#!/bin/sh

##################################################
# Backup Mysql Datebase To Gmail ( for FreeBSD )
#
# Fixed by ajer001
##################################################
#where you want to save the backup files.
BACKUP_PATH=備份檔案的儲存路徑

#what mail you want to mail to.
RECEIVE_MAIL=填入e-mail account

#what your MySQL database server root's password.

用 Gmail 備份 MySQL on FreeBSD

先在自己的機器與 mysql server 安裝 GnuPG (現在是 1.4.0):

# cd /usr/ports/security/gnupg
# make install clean

如果是 FreeBSD 4.x,在自己的機器上產生 key 前,先設定 random device:

# rndcontrol -s 5
# rndcontrol -s 11

其中的 5 與 11 是 IRQ number,可以用下面的指令看哪個 IRQ 可以當 random device:

# pciconf -l

接下來在自己機器上用下面的指令產生 publickey 與 privatekey:

$ gpg –gen-key

Postfix+SASL+IMAP-UW+MailScanner+F-prot on FreeBSD

網路上有許多相關的文件
可是有些設定或方法 我實際操作遇到了問題
經過嘗試之後 將自己完整的安裝過程紀錄 分享
應該會讓你在整個安裝過程順利進行

我們先停止sendmail 並安裝Postfix
# killall sendmail
# cd /usr/port/mail/postfix
# make install clean

在出現的第一個選單中選擇 SASL 和 TLS
在出現的第二個選單中選擇 DB3 和 PWCHECK
之後的程序中會出現兩個選項,一個是問「是否將 postfix 加入 mail 群組?」,

FreeBSD source 更新與系統升級

FreeBSD source 更新與系統升級 for 4-stable
Last Update: 2005/12/03

安裝完 FreeBSD 也安裝好 CVSup 套件後
就可以開始做 source 更新與系統升級
來修補 FreeBSD 系統上的漏洞 維護系統安全

不過要先確定在安裝FreeBSD時 有安裝 src 否則更新會花很多時間
可透過 /stand/sysinstall 選擇安裝 src
# /stand/sysinstall

將 stable-supfile 複製至 /root/
# cp /usr/share/examples/cvsup/stable-supfile
# ee /root/stable-supfile

編輯 stable-supfile 更改下列部分

FreeBSD CVSup 安裝與應用

我這裡就不詳加介紹如何安裝 FreeBSD 了
網路上的相關文件已經夠多了
或者你可以參考 OHaHa’s 學習心得 的教學

CVSup 是在 FreeBSD 系統中相當重要的程式
功用在於更新最新的 port tree 以及 source
可以讓你使用 ports 安裝程式時 能夠裝上最新的程式
也可以借此更新 source 來升級系統

CVSup 的安裝其實非常簡單
只要在安裝 FreeBSD 時 有選擇安裝 ports 且已經正確連上網路
便可輕鬆由下列方式安裝:

更改 fonera 無線訊號強度

更改 fonera 無線訊號強度
change the wifi tx-power of the fonera (plus)

Recently I read in the FON-Forums, that some people are using huge antennas with their Foneras. Some of them now seem to be concerned about not meeting legal regulations concerning tx power anymore… Well… even though I personally don’t know anyone who’d really care, you can of course cut down the tx power to a level that suits your needs! So let’s check what’s standard:

root@OpenWrt:~# iwconfig ath0 | grep Tx-Power
Bit Rate:0 kb/s Tx-Power=18 dBm Sensitivity=0/3

更改 Fonera Plus 流量限制

更改 Fonera Plus 上傳下載流量限制
how to change the fonera plus upload / download limit

root@OpenWrt:~# uci set qos.wan.upload=640
root@OpenWrt:~# uci set qos.wan.download=8192
root@OpenWrt:~# uci commit

關閉流量限制
disable the flow limits

root@OpenWrt:~# uci set qos.wan.enabled=0
root@OpenWrt:~# uci commit

XAMPP 使用者網頁設定

xampplite\apache\conf\httpd.conf 去掉前面註解
# LoadModule userdir_module modules/mod_userdir.so

xampplite\apache\conf\extra\httpd-userdir.conf 新增下面幾行:

UserDir "D:/xampplite/user/*/public_html"

Options Indexes FollowSymLinks Includes ExecCGI
.......
.......

使用者資料夾在 /xampplite/user/*/public_html
位址:http://www.example.com/~*/
自由創建新資料夾即可,不用再做其他設定。