Showing posts with label FreeBSD. Show all posts
Showing posts with label FreeBSD. Show all posts

spawn-fcgi standalone release

自從lighttpd更新到1.4.20後,原本跑的好好的spawn-fcgi就停住了,不曉得是否跟gslin這一篇所提的有關,反正後來只好用1.40.19的版本。

現在spawn-fcgi從lighttpd中獨立出來。試了一下,完全正常。

Release: spawn-fcgi 1.6.0
read on
Posted at 12:33 PM on 3/1/09 | 1 comments
Filed under: ,
 

PPPoE Check

檢查 pppoe 連線是否正常

#!/bin/sh
set -- `ping -c 5 -t 4 202.145.138.1 | grep loss`
# 202.145.138.1 --> TTN DNS
LOSS=$7
if [ "$LOSS" = "100.0%" ]; then
pkill -9 ppp
sleep 15
ppp -ddial pppoe
fi


檢查 DNS 是否更新

#!/bin/sh
set -- `nslookup monkeybiz.info | grep Address`
DNS=$4
set -- `ifconfig tun0 |grep inet`
tun=$2

if [ "$DNS" = "$tun" ]; then
else
/usr/local/etc/rc.d/ddclient restart
fi


ddclient.conf for dnspark

daemon=1800 # check every 1800 seconds
syslog=yes # log update msgs to syslog
#mail=root # mail all msgs to root
mail-failure=root # mail failed update msgs to root
pid=/var/run/ddclient.pid # record PID in file.
ssl=no # use ssl-support. Works with

## single host update
protocol=dnspark, \
login=login-name, \
password=passwd \
abcdefg.com

use=web, web=ipdetect.dnspark.com, web-skip='Current Address:'
read on
Posted at 1:50 AM on 9/4/08 | 0 comments
Filed under: ,
 

FreeBSD 6.3 Release

6.3 Release Announcement. 新音效卡支援, snd_envy24(4)snd_hda(4)
令人期待的7.0 ? 再等等吧,到現在RC_2 都還沒下落。

Firefox 3 也是該出現了吧,之前用的beta版本,比現在的Firefox 2 快上不少,雖然記憶體的問題還是沒多大差別。只是一些擴充套件如 Gmail Manager、Google Toolbar等還無法支援。
read on
Posted at 4:13 AM on 1/19/08 | 2 comments
Filed under:
 

Lighttpd with PHP and MySQL

好像沒什麼好寫的
  1. cd /usr/ports/blahblah
  2. make install clean
  3. end
PHP安裝選項要選 CGI、FASTCGI。
其他的去 /usr/ports/lang/phpX-extensions 裝。
php.ini中要加
cgi.fix_pathinfo = 1
Lighttpd中MySQL要選。
預設的設定檔 /usr/local/etc/lighttpd.conf 裡面,
"mod_fastcgi",  要打開。

fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.sock", 這裡要改成這樣
"bin-path" => "/usr/local/bin/php-cgi" 這裡也是
)
)
)
記得還要自己 touch 記錄檔。

如果有些東西想要藏起來,可以用 "mod_auth" 功能,
有很多種選擇:plain, htpasswd, htdigest, LDAP 等,

以下用簡單的htpasswd就好。

auth.backend = "htpasswd"
auth.backend.htpasswd.userfile ="/path/to/.htpasswd"

auth.require = ( "/要隱藏起來的地方" =>
(
"method" => "basic",
"realm" => "不要進來",
"require" => "user=xxxxx"
)
)

htpasswd 是 apache 內建的程式,也可以透過PHP來產生,可以參考這裡
read on
Posted at 1:09 AM on 10/29/07 | 2 comments
Filed under: ,
 

cshrc,screenrc,vimrc

.cshrc

alias h history 25
alias j jobs -l
alias la ls -a
alias lf ls -FA
alias ll ls -lA
alias csup csup -g -L 2
alias rm rm -i
alias vi vim
alias su su -
alias df df -h
alias du du -h
# A righteous umask
umask 22

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
set autolist
set autoexpand
set recexact
set autocorrect
set correct = all
set prompt3 = "%SDo you mean [%R] (y/n/e) ? "
if ( $tty =~ ttyv* ) then
setenv TERM cons25
else
setenv TERM xterm-color
endif
setenv EDITOR vim
setenv PAGER less
setenv BLOCKSIZE K
setenv PACKAGEROOT http://ftp3.tw.freebsd.org
setenv CLICOLOR
setenv LSCOLORS ExGxFxdxCxDxDxBxBxExEx
setenv LANG zh_TW.UTF-8
setenv LC_TIME en_US.UTF-8

if ($?prompt) then
# An interactive shell -- set some stuff up
#set prompt = "`/bin/hostname -s`# "
set prompt = "%B%{^[[32m%}%n:%~%#"
set filec
set history = 100
set savehist = 100
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey "^W" backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward
endif
endif


.screenrc

#caption always "%{wb}[%M %d %C %a] Load: %l %-Lw%{Wk}%50>%n%f* %t%{-}%+Lw%< "
caption always "%{wb} %-Lw%{Wk}%50>%n%f* %t%{-}%+Lw%< "
hardstatus alwayslastline "%=%{..K}%e %{..Y} %M %d %{..G}%c %{..W} Load: %l %{wb}"
defutf8 on
defc1 off
defencoding utf8
bind b encoding big5 utf8 #^A+b Big5轉utf-8
bind u encoding utf8 utf8 #^A+u 轉utf-8
attrcolor b ".I"
attrcolor i "+b"
# tell screen how to set colors. AB = background, AF=foreground
# erase background with current bg color
term xterm
termcapinfo xterm "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"
defbce "on

.vimrc

set cindent
set hls
set nocompatible
set sw=2
set background=dark
syntax on
highlight Comment ctermfg=darkcyan
highlight Search term=reverse ctermbg=4 ctermfg=7
set tabstop=4
hi Normal guifg=White guibg=DarkBlue
set autoindent
set shiftwidth=4
set nobackup
set ru
set fileencoding=utf-8
set encoding=utf-8
set termencoding=utf-8
set fileencodings=utf-8,big5,euc-jp,gbk,euc-kr,utf-bom,iso8859-1
set ambiwidth=double
read on
Posted at 12:45 AM on 10/28/07 | 0 comments
Filed under: ,
 

FreeBSD 7.0-BETA1.5

7.0-BETA1.5 Available,難怪前幾天一直編不過。

從頭安裝,記錄一下過程。
  1. ISO檔,下載燒錄安裝。
  2. 網路設定,ADSL撥接,PPPoE
  3. 更新 src 跟 ports。現在已經改用csup,不用再去抓cvsup-without-gui。設定檔在 /usr/share/examples/cvsup。
  4. 基本界面,先把 vim-lite、screen 裝起來。screenrc....等設定檔
  5. make.conf,範例在/usr/share/examples/etc,
  6. 重編kernel,world。
read on
Posted at 12:23 AM on | 0 comments
Filed under:
 

FreeBSD Driver for Ralink RT2561

UPDATE:

Under FreeBSD 7.0-BETA, the Ralink RT2561 device can be recognized and work smoothly by the default.

link:*BSD driver for Ralink RT2500/RT2600 chipsets.


雖然在6.2中已經有ral(4),可以支援Ralink RT2500。但是Edimax Ew-7128g總是抓不到。
pciconf -lv 顯示的結果
none1@pci2:4:0: class=0x028000 card=0x25611814 chip=0x03011814 rev=0x00 hdr=0x00
vendor = 'Ralink Technology, Corp'
class = network
Google的結果,找到解決方法,以module載入。
在/usr/src/sys下套用patch之後, 到/usr/src/sys/modules/ral下 make && make install 。
修改/boot/loader.conf,加入if_ral_load="YES"。
試試看,下 kldload if_ral 指令。
抓到啦 :p
ral0@pci2:4:0: class=0x028000 card=0x25611814 chip=0x03011814 rev=0x00 hdr=0x00
vendor = 'Ralink Technology, Corp'
class = network
read on
Posted at 6:59 PM on 5/9/07 | 0 comments
Filed under: ,
 

FreeBSD下的pppoe撥接

最簡單的設定

/etc/ppp/ppp.conf
default:
set speed sync
set mru 1492
set mtu 1492
set ctsrts off
disable lqr ipv6cp
set log Phase tun
add default HISADDR
enable dns

pppoe:
set device PPPoE:rl0 #請參閱系統中網卡代號
set authname xxxxxx #連線帳號
set authkey xxxxxx #連線密碼


連線
# ppp -ddial pppoe


開機自動連線

/etc/rc.conf
ppp_enable="yes"
ppp_mode="ddial"
ppp_nat="no"
ppp_profile="pppoe"


檢查連線是否正常,PPPoE Check。放入/etc/crontab中,自動執行。
read on
Posted at 12:26 AM on 2/16/07 | 0 comments
Filed under: