所以我貼圖好了= =a

裡面的播放畫面會用到 mediaplayer.swf
js檔案會用到 swfobject.js
我通通上傳到 http://www.mediafire.com/?jhzgya3xbs0 方便大家下載回去使用
code很簡單,看不懂的話再問吧
freeBSD C php MySQL
下面很多可以看,但是助益最大的一句話是!
「ESC :沒事多按逃脫鍵,有益身體健康。」
自從看到這句話之後我的vi速度變快了...
一。從命令到編輯模式
a :將游標放到目前游標後一個字元,開始文字編輯模式。insert
i :將游標放在目前游標位置,開始文字編輯模式。append
o :將游標放到下一行起始位置,開始文字編輯模式。open new line
比較常用就是i,a,o,I,A,O了,將來多試幾次就好了,就很熟悉了。
二從編輯到命令
ESC :沒事多按逃脫鍵,有益身體健康。
三命令模式中的其他命令
在命令模式中的按鍵就很多了,這些需要好好熟練一下了。
在vi命令模式裡面,有的按鍵按完後他還是在命令模式,有的改個字元或copy/paste後
又回到命令模式,有的就一去不回頭變成文字編輯模式了。
有些按鍵會把你原本想改的內容做特殊的定位,例如要改個word,也會把你帶離命令模式
檔案
:q 離開vi
:e xxxx 編輯xxxx
:w 存檔
:w xxxx 另存檔案xxxx
:q! 不存檔強迫離開
:w! 強迫存檔
:wq 存檔與離開
游標移動
h,j,k,l 往左,往下,往上,往右
0 到行首
$ 到行尾
^ 到這行的第一個非空白字元
w,W 到下個字, 到下個非空白的字
b,B 回上個字, 到上個非空白的字
e,E 到這個字的字尾, 到下個非空白的字字尾
Ctrl-F ,Ctrl-B 往後一頁,往前一頁
G 到檔尾
:n 到第n行 (所以到檔頭就是:1)
Ctrl-G 顯示第幾行
J 合併兩行
搜尋與取代
/
/pattern 尋找pattern
?pattern 往上尋找pattern
n 再往下尋找
N 再往上尋找
:s/patrn/str/cgi搜尋patrn取代str
其中:跟s間必需指定範圍(range)沒設範圍就是游標這行
1,10 表示 1-10行
% 表示整篇
最後cgi
c 表示confirm尋問
g 表示global全部
i 表示ignore不分大小寫
常用字元字串處理
cc 改變整行
dd 砍掉整行
yy 拷貝整行(yank whole line)
p,P 貼上(paste) 你最近砍掉或拷貝的
cw 改變一個字
d$ 砍到行尾
ye 拷貝到這個字尾
r,R 取代一個字元, 取代整行
u,U undo 最後修改,UNCHANGE整行
x,X 砍一個字元, 往回砍個字元(等於按backspace)
重複的處理
. 重複剛剛的命令或輸入
這些試試看
ce, 3x, 5dd, 10w, d0, y$, 5G
indentation
>> 往右一個indent
<< 往左一個indent
vim的多檔與多窗
:e xxx 編輯xxx
:buffers 列出所有編輯檔
:bn n是數 b1 b2 b3....表是開第n個buffer
:bdn n是數:bd1 :bd2 表示殺掉第n個buffer
:new 一個水平新窗
:vnew 開個垂直新窗
:only 只留一個窗窗
C-w j k h l 移到下 上 左 右 窗去
轉自
http://www.study-area.org/cyril/opentools/opentools/x62.html
cd /usr/ports/net/cvsup-without-gui
make install clean
cp /usr/share/examples/cvsup/ports-supfile /root/
vi /root/ports-supfile
*default host=cvsup.tw.freebsd.org
cvsup -g -L 2 /root/ports-supfile
建議在做更新之前先把/etc/make.conf裡面的站台位置換成台灣的網站
這樣會快很多很多
magicallove# cat /etc/make.conf
# added by use.perl 2008-05-07 13:55:22
PERL_VER=5.8.8
PERL_VERSION=5.8.8
# Port master sites.
#
# If you want your port fetches to go somewhere else than the default
# (specified below) in case the distfile/patchfile was not found,
# uncomment this and change it to a location nearest you. (Don't
# remove the "/${DIST_SUBDIR}/" part.)
#
MASTER_SITE_BACKUP?= \
ftp://ftp.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp5.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp10.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp3.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp4.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp7.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp8.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp9.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp11.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp12.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
#
# If you want your port fetches to check the above site first (before
# the MASTER_SITES specified in the port Makefiles), uncomment the
# line below. You can also change the right side to point to wherever
# you want.
#
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
#
就是這樣啦,把/etc/make.conf裡面的內容加入上面那幾個吧!
真的會快很多
scp -r ID@xxx.xxx.xxx.xxx:/home/ID/ ./
scp -r ./ ID@xxx.xxx.xxx.xxx:/home/ID/
-r 遞迴複製遠端路徑底下的所有資料,包含子資料夾
ID 要登入的遠端機器的帳號,如同 ssh 登入一樣,你只能複製這個 ID 可以讀取的資料
xxx.xxx.xxx.xxx 遠端的 ip,後面一定要記得接上冒號之後再接絕對位置
最後面是本地端路徑
如同 cp 指令一樣,只要將前後兩邊的路徑對調一下就可以變成複製到遠端了
>1.
cat /etc/named/named.conf
//設定要正解的網域是ncku.edu.tw, DNS 伺服器類型是master(另一種是slave)
//並且到 master 資料夾裡面的 naku.edu.tw.rev 找 ncku.edu.tw 的設定
zone "ncku.edu.tw" {
type master;
file "master/ncku.edu.tw.rev";
};
//設定要反解的ip範圍是140.116.250.*, DNS 伺服器類型是master(另一種是slave)
//並且到 master 資料夾裡面的 140.116.250.rev 找反解設定
//注意!我們有整個class C的網域(140.116.250.*),其他反解寫法不管,反正用不到
zone "250.116.140.in-addr.arpa" {
type master;
file "master/140.116.250.rev";
};
named.conf 裡面會有很多範例,那些範例是我們不能直接使用的...
>2.
vi /etc/manedb/master/140.116.250.rev
加入以下兩行
30 IN PTR forum.ccns.ncku.edu.tw.
26 IN PTR magicallove.ccns.ncku.edu.tw.
>3.
vi /etc/namedb/master/ncku.edu.tw.rev
加入以下兩行
forum.ccns IN A 140.116.250.30
magicallove.ccns IN A 140.116.250.26
>4.ps -aux|grep named
找出named的程序
例如:bind 81173 0.0 0.1 4920 3668 ?? Ss 接下行
8:00PM 0:00.19 /usr/sbin/named -t /var/named -u bind
然後kill 81173,砍掉目前的named(我考慮了很久到底要不要把cat開啟的bind砍掉 怕死)
再輸入指令重新開啟BIND這支程式 /etc/rc.d/named start
我不知道為什麼輸入/etc/rc.d/named restart沒有效果
另外,在 /etc/resolv.conf 裡面
domain ccns.ncku.edu.tw
nameserver 163.28.112.1
nameserver 163.28.113.1
nameserver 168.95.1.1
還不太清楚這個檔案是做啥用的,不過應該有很大用途!待釐清= =
Sudo 可以讓 wheel 群組的使用者在被列入可以變身為 root 名單後
利用自己的密碼變身為sudo
對於管理來說實在非常方便!
安裝了sudo喔
安裝過程如下,簡單的很~~
su
變身為 root ,這樣才能安裝軟體喔!
whereis sudo
/usr/ports/security/sudo
如果你已經知道 sudo 放哪裡的話當然可以不用這個步驟
cd /usr/ports/security/sudo
make install clean
移動到該目錄下,直接用第二行指令安裝
visudo
編輯可以使用 sudo 這個指令變身 root 的名單,怎麼寫也很簡單
我節錄如下
# User privilege specification
root ALL=(ALL) ALL
mXXXXXXXXXX ALL=(ALL) ALL
rXXXXX9 ALL=(ALL) ALL
也就是說 magciallove renn999 可以變身為 root
至於後面除了接ALL=(ALL) ALL之外,還可以接什麼參數我也不曉得。
不過應該這樣就夠用了
rehash
這行到底做了什麼事情我也不太確定,不過安裝了軟體之後
如果有新的指令就要跑一下這 rehash ,應該是把執行檔路徑加進去吧
搞定
批次解壓:
#!/bin/sh
for unzipfile in $(ls *.tgz)
do
tar -zxf $unzipfile
echo "$unzipfile done!"
rm $unzipfile
done
====================
#!/bin/sh
這一行代表要使用的shell語言,最前面那個#不是註解掉這一行喔= =
for unzipfile in $(ls *.tgz)
.
.
done
這是個迴圈,會將 in 後面接的 list 傳到 unzipfile 作為變數使用
這邊寫上unvipfile其實就可以當做你在宣告這個變數了
這裡用的 list 是(ls *.tgz)
動作是列出與這個 shell 同一個路徑下的所有 .tgz 檔案
並將其檔名一次一個放到 unzipfile 裡面。
tar -zxf $unzipfile
解壓縮檔案,這行如果看不懂就去辜狗tar吧...
$unzipfile,這個是要被解壓縮的檔名,變數要使用時要加上 $ 符號
echo "$unzipfile done!"
這行純粹是讓使用者看到目前進行到哪個檔案了
rm $unzipfile
解壓縮完後刪除該壓縮檔
====================
批次壓縮:
#!/bin/sh====================btw
你可以用 vi 或者任何你喜歡的編輯器輸入上面的 script 例如:
vi unzipfile.sh#!/bin/sh
for unzipfile in $(ls *.tgz)
do
tar -zxf $unzipfile
echo "$unzipfile done!"
rm $unzipfile
done
:wq
執行方法有兩種
1.sh < unzipfile.sh
把這個 script 丟給 sh 執行
2.chmod a+x unzipfile.sh
./unzipfile.sh
把這個script變為可執行,然後直接執行他
netstat -na
-n 將ip以數字顯示,而不以dns查名稱,這樣會快很多!
-a 除了已連結的port外,一併列出監聽中的port,可以觀察一下有沒有奇怪的port被打開= =
各參數意義如下
CLOSED 表示插槽沒被使用。
LISTENING 表示正在監聽進入的連接。
SYN_SENT 表示正在試著建立連接。
SYN_RECEIVED 進行連接初始同步。
ESTABLISHED 表示連接已被建立。
CLOSE_WAIT 表示遠程計算機關閉連接,正在等待插槽的關閉。
FIN_WAIT_1 表示插槽關閉,正在關閉連接。
CLOSING 先關閉本地插槽,然後關閉遠程插槽,最後等待確認信息。
LAST_ACK 遠程計算機關閉後,等待確認信號。
FIN_WAIT_2 插槽關閉後,等待來自遠程計算機的關閉信號。
TIME_WAIT 連接關閉後,等待遠程計算機關閉重發。
CLOSED ---- Closed. The socket is not being used.
LISTEN ---- Listening for incoming connections.
SYN_SENT ---- Actively trying to establish connection.
SYN_RECEIVED ---- Initial synchronization of the connection under way.
ESTABLISHED ---- Connection has been established.
CLOSE_WAIT ---- Remote shut down; waiting for the socket to close.
FIN_WAIT_1 ---- Socket closed; shutting down connection.
CLOSING ---- Closed, then remote shutdown; awaiting acknowledgement.
LAST_ACK ---- Remote shut down, then closed ;awaiting acknowledgement.
FIN_WAIT_2 ---- Socket closed; waiting for shutdown from remote.
TIME_WAIT ---- Wait after close for remote shutdown retransmission.
netstat -I rl0(這一個參數是你的網路卡代號!你的不一定跟我的一樣!而且要注意,1和 l 不好分辨= =)
>netstat -I rl0
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
rl0 1500 00:02:44:59:d6:be 205831 0 231610 0 0
rl0 1500 140.116.250/2 she911 137997 - 231609 - -
網路卡代號可以用ifconfig查看
>ifconfig
rl0: flags=8843mtu 1500
通常第一個裝置就是你的網路卡了
ftp/pure-ftpd 是你最好選擇啊 :p
因為有 jnlin 大神寫的 patch,所以現在支援 RFC 2640 了
你可以看到 pure-ftp.conf 有這一行
# UTF-8 support for file names (RFC 2640)
# Define charset of the server filesystem and optionnally the default charset
# for remote clients if they don't use UTF-8.
# Works only if pure-ftpd has been compiled with --with-rfc2640
FileSystemCharset utf-8
ClientCharset big5
如果 client 用的是 filezilla 懂得 utf-8 的軟體,他就會吐 utf-8 給 client
不懂的話,就會幫你轉成 big5
=====================
建議先cvsup更新pure-ftp到最新版 因為6.2裡面預設的好像沒有這個功能(不確定啦= =) 如何使用cvsup更新port,在"FreeBSD 6.0架設管理與應用",有詳細的說明。不難
簡易安裝步驟如下
我用p3 667M的CPU編譯安裝花了約半小時,學網下載很快,網路下載時間略過。
=====================
安裝後的設定檔位於
/usr/local/etc
/usr/local/etc/rc.d
詳細設定方法還在研究ing...
=====================
pure-ftpd.conf.sample
############################################################
# #
# Configuration file for pure-ftpd wrappers #
# #
############################################################
# If you want to run Pure-FTPd with this configuration
# instead of command-line options, please run the
# following command :
#
# /usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf
#
# Please don't forget to have a look at documentation at
# http://www.pureftpd.org/documentation.shtml for a complete list of
# options.
# Cage in every user in his home directory
ChrootEveryone yes
# If the previous option is set to "no", members of the following group
# won't be caged. Others will be. If you don't want chroot()ing anyone,
# just comment out ChrootEveryone and TrustedGID.
# TrustedGID 100
# Turn on compatibility hacks for broken clients
BrokenClientsCompatibility no
# Maximum number of simultaneous users
MaxClientsNumber 50
# Fork in background
Daemonize yes
# Maximum number of sim clients with the same IP address
MaxClientsPerIP 8
# If you want to log all client commands, set this to "yes".
# This directive can be duplicated to also log server responses.
VerboseLog no
# List dot-files even when the client doesn't send "-a".
DisplayDotFiles yes
# Don't allow authenticated users - have a public anonymous FTP only.
AnonymousOnly no
# Disallow anonymous connections. Only allow authenticated users.
NoAnonymous no
# Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)
# The default facility is "ftp". "none" disables logging.
SyslogFacility ftp
# Display fortune cookies
# FortunesFile /usr/share/fortune/zippy
# Don't resolve host names in log files. Logs are less verbose, but
# it uses less bandwidth. Set this to "yes" on very busy servers or
# if you don't have a working DNS.
DontResolve yes
# Maximum idle time in minutes (default = 15 minutes)
MaxIdleTime 15
# LDAP configuration file (see README.LDAP)
# LDAPConfigFile /etc/pureftpd-ldap.conf
# MySQL configuration file (see README.MySQL)
# MySQLConfigFile /etc/pureftpd-mysql.conf
# Postgres configuration file (see README.PGSQL)
# PGSQLConfigFile /etc/pureftpd-pgsql.conf
# PureDB user database (see README.Virtual-Users)
# PureDB /etc/pureftpd.pdb
# Path to pure-authd socket (see README.Authentication-Modules)
# ExtAuth /var/run/ftpd.sock
# If you want to enable PAM authentication, uncomment the following line
# PAMAuthentication yes
# If you want simple Unix (/etc/passwd) authentication, uncomment this
# UnixAuthentication yes
# Please note that LDAPConfigFile, MySQLConfigFile, PAMAuthentication and
# UnixAuthentication can be used only once, but they can be combined
# together. For instance, if you use MySQLConfigFile, then UnixAuthentication,
# the SQL server will be asked. If the SQL authentication fails because the
# user wasn't found, another try # will be done with /etc/passwd and
# /etc/shadow. If the SQL authentication fails because the password was wrong,
# the authentication chain stops here. Authentication methods are chained in
# the order they are given.
# 'ls' recursion limits. The first argument is the maximum number of
# files to be displayed. The second one is the max subdirectories depth
LimitRecursion 2000 8
# Are anonymous users allowed to create new directories ?
AnonymousCanCreateDirs no
# If the system is more loaded than the following value,
# anonymous users aren't allowed to download.
MaxLoad 4
# Port range for passive connections replies. - for firewalling.
# PassivePortRange 30000 50000
# Force an IP address in PASV/EPSV/SPSV replies. - for NAT.
# Symbolic host names are also accepted for gateways with dynamic IP
# addresses.
# ForcePassiveIP 192.168.0.1
# Upload/download ratio for anonymous users.
# AnonymousRatio 1 10
# Upload/download ratio for all users.
# This directive superscedes the previous one.
# UserRatio 1 10
# Disallow downloading of files owned by "ftp", ie.
# files that were uploaded but not validated by a local admin.
AntiWarez yes
# IP address/port to listen to (default=all IP and port 21).
# Bind 127.0.0.1,21
# Maximum bandwidth for anonymous users in KB/s
# AnonymousBandwidth 8
# Maximum bandwidth for *all* users (including anonymous) in KB/s
# Use AnonymousBandwidth *or* UserBandwidth, both makes no sense.
# UserBandwidth 8
# File creation mask.: .
# 177:077 if you feel paranoid.
Umask 133:022
# Minimum UID for an authenticated user to log in.
MinUID 100
# Allow FXP transfers for authenticated users.
AllowUserFXP no
# Allow anonymous FXP for anonymous and non-anonymous users.
AllowAnonymousFXP no
# Users can't delete/write files beginning with a dot ('.')
# even if they own them. If TrustedGID is enabled, this group
# will have access to dot-files, though.
ProhibitDotFilesWrite no
# Prohibit *reading* of files beginning with a dot (.history, .ssh...)
ProhibitDotFilesRead no
# Never overwrite files. When a file whoose name already exist is uploaded,
# it get automatically renamed to file.1, file.2, file.3, ...
AutoRename no
# Disallow anonymous users to upload new files (no = upload is allowed)
AnonymousCantUpload no
# Only connections to this specific IP address are allowed to be
# non-anonymous. You can use this directive to open several public IPs for
# anonymous FTP, and keep a private firewalled IP for remote administration.
# You can also only allow a non-routable local IP (like 10.x.x.x) to
# authenticate, and keep a public anon-only FTP server on another IP.
#TrustedIP 10.1.1.1
# If you want to add the PID to every logged line, uncomment the following
# line.
#LogPID yes
# Create an additional log file with transfers logged in a Apache-like format :
# fw.c9x.org - jedi [13/Dec/1975:19:36:39] "GET /ftp/linux.tar.bz2" 200 21809338
# This log file can then be processed by www traffic analyzers.
# AltLog clf:/var/log/pureftpd.log
# Create an additional log file with transfers logged in a format optimized
# for statistic reports.
# AltLog stats:/var/log/pureftpd.log
# Create an additional log file with transfers logged in the standard W3C
# format (compatible with most commercial log analyzers)
# AltLog w3c:/var/log/pureftpd.log
# Disallow the CHMOD command. Users can't change perms of their files.
#NoChmod yes
# Allow users to resume and upload files, but *NOT* to delete them.
#KeepAllFiles yes
# Automatically create home directories if they are missing
#CreateHomeDir yes
# Enable virtual quotas. The first number is the max number of files.
# The second number is the max size of megabytes.
# So 1000:10 limits every user to 1000 files and 10 Mb.
#Quota 1000:10
# If your pure-ftpd has been compiled with standalone support, you can change
# the location of the pid file. The default is /var/run/pure-ftpd.pid
#PIDFile /var/run/pure-ftpd.pid
# If your pure-ftpd has been compiled with pure-uploadscript support,
# this will make pure-ftpd write info about new uploads to
# /var/run/pure-ftpd.upload.pipe so pure-uploadscript can read it and
# spawn a script to handle the upload.
#CallUploadScript yes
# This option is useful with servers where anonymous upload is
# allowed. As /var/ftp is in /var, it save some space and protect
# the log files. When the partition is more that X percent full,
# new uploads are disallowed.
MaxDiskUsage 99
# Set to 'yes' if you don't want your users to rename files.
#NoRename yes
# Be 'customer proof' : workaround against common customer mistakes like
# 'chmod 0 public_html', that are valid, but that could cause ignorant
# customers to lock their files, and then keep your technical support busy
# with silly issues. If you're sure all your users have some basic Unix
# knowledge, this feature is useless. If you're a hosting service, enable it.
CustomerProof yes
# Per-user concurrency limits. It will only work if the FTP server has
# been compiled with --with-peruserlimits (and this is the case on
# most binary distributions) .
# The format is ::
# For instance, 3:20 means that the same authenticated user can have 3 active
# sessions max. And there are 20 anonymous sessions max.
# PerUserLimits 3:20
# When a file is uploaded and there is already a previous version of the file
# with the same name, the old file will neither get removed nor truncated.
# Upload will take place in a temporary file and once the upload is complete,
# the switch to the new version will be atomic. For instance, when a large PHP
# script is being uploaded, the web server will still serve the old version and
# immediatly switch to the new one as soon as the full file will have been
# transfered. This option is incompatible with virtual quotas.
# NoTruncate yes
# This option can accept three values :
# 0 : disable SSL/TLS encryption layer (default).
# 1 : accept both traditional and encrypted sessions.
# 2 : refuse connections that don't use SSL/TLS security mechanisms,
# including anonymous sessions.
# Do _not_ uncomment this blindly. Be sure that :
# 1) Your server has been compiled with SSL/TLS support (--with-tls),
# 2) A valid certificate is in place,
# 3) Only compatible clients will log in.
# TLS 1
# Listen only to IPv4 addresses in standalone mode (ie. disable IPv6)
# By default, both IPv4 and IPv6 are enabled.
# IPV4Only yes
# Listen only to IPv6 addresses in standalone mode (ie. disable IPv4)
# By default, both IPv4 and IPv6 are enabled.
# IPV6Only yes
# UTF-8 support for file names (RFC 2640)
# Define charset of the server filesystem and optionnally the default charset
# for remote clients if they don't use UTF-8.
# Works only if pure-ftpd has been compiled with --with-rfc2640
# FileSystemCharset big5
# ClientCharset big5
內容如下,歡迎慢慢研究= =
像標題這樣的裝法應該很多人很熟悉了,這裡把昨天安裝的經驗分享一下,或
許有大大可以指正,或者還在摸索的朋友可以參考。
6.3安裝完之後因為所有軟體我習慣從PORTS安裝,所以我習慣先更新一下PORTS
,更新步驟如下:
先安裝portupgrade與cvsup-withoutgui,然後去修改ports-supfile
#ee /usr/share/examples/ports-supfile
檔案裡把host指定改為: "tw.freebsd.org"
更新ports-tree:
#cd /usr/ports
#cvsup -L2 /usr/share/examples/ports-supfile
#portsdb -Uu (更新PORTS)
#
#pkgdb -F (check and fix package database)
#
#portupgrade -acCv (把已安裝的套件升級)
再來去PORTS安裝mysql,安裝完之後要經過下面程序才能啟動mysql:
1. 執行initial db script
#/usr/local/bin/mysql_install_db
2. 找到mysql提供的設定檔範例,拷貝到/etc檔名為my.cnf
3. 更改目錄擁有者
#cd /var/db
#chown -R mysql mysql
4. 啟動 mysql
#/usr/local/bin/safe_mysqld &
5. 更改 mysql root's password.
然後安裝Apache2,安裝完之後再安裝PHP4與PHP4-extension,安裝步
驟精華區裡好像都有。
安裝完之後PHP4會自動修改httpd.conf,但我看apache還是不能讀php
檔,所以我找了一下資料,把httpd.conf裡頭的php參數改為:
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
5. 更改 mysql root's password.
然後安裝Apache2,安裝完之後再安裝PHP4與PHP4-extension,安裝步
驟精華區裡好像都有。
安裝完之後PHP4會自動修改httpd.conf,但我看apache還是不能讀php
檔,所以我找了一下資料,把httpd.conf裡頭的php參數改為:
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
原來的參數好像沒有Handler字眼。
接著便是修改rc.conf讓這些軟體可以在開機時執行,我喜歡用webmin設
定比較方便,在剛裝好的freebsd裡面我會安裝lynx,再用lynx去
www.webmin.com下載新版webmin。
分享一下,前陣子記的
http://blog.pixnet.net/bojack/post/14064752
自從 FreeBSD 6.2 開始,系統就內建了 csup 這指令來更新 Ports,使用方法就和cvsup\
一模一樣,的確省去大幅時間在安裝 cvsup
要使用前記得搭配 /etc/make.conf 的設定喔 ( 如下 )
SUP_UPDATE=yes
SUP=/usr/bin/csup
SUPFLAGS=-g -L 2
SUPHOST=cvsup.tw.FreeBSD.org
SUPFILE=/usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE=/usr/share/examples/cvsup/ports-supfile
MASTER_SITE_BACKUP?= \
ftp://cvsup.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://cvsup2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://cvsup3.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
安裝 Apache + PHP + MySQL
http://blog.pixnet.net/bojack/post/12983723
OS freeBSD6.2
ftp smbftpd 王俊斌改寫的那個
我開放匿名上傳
有人上傳的檔案名稱有空白鍵
而且因為我設定匿名上傳資料夾裡面的檔案disable_modify
所以沒有辦法透過ftp軟體修改檔名
我用ssh連線到主機想要改檔名,可是輸入rm BABY COME AROUND.MP3
可想而知,他會判斷成三個檔案= =
所以刪不掉
同時,BABY開頭的檔案又不只一個
也不能用rm BABY*的方法刪除
請問還有沒有其他辦法可以刪掉該檔案?
很巧!我剛剛輸入某個有空白的檔名前半部分(還沒有到有空白的地方)
也很巧這個檔案檔名跟其他都差很多
我用的是tcsh
所以當我按下tab時!電腦讓我知道...加入\(跳脫字元)就可以包含空白了
例如:rm 舞曲大帝國12-13-CLOUND 9.mp3
要寫成rm 舞曲大帝國12-13-CLOUND\ 9.mp3
自己解答了!也希望對其他人有幫助到!
安裝freeBSD時,如果掛載路徑太長例如:/home/ftp/iloveyou/youloveme
輸入確定之後在畫面上面看不到完整路徑
但是這沒關係
一樣可以正常掛載上去的!
進入單人模式時,會出現下列提示
Enter full pathname of shell of RETURN for /bin/sh:
(直接按 enter即可以 B shell進入單人模式)
必要時執行以下動作-
# fsck -p 檢查並修正檔案系統(preen filesystem)
# mount -u / 重新載入 / ,-u 代表改變為可讀可寫狀態
# mount -a -t ufs 載入所有 /etc/fstab有記錄、型態為 ufs的檔案系統
# swapon -a 開啟swap
# adjkerntz -i 讀取CMOS clock為當地時間,如果存在/etc/wall_cmos_clock,就參考時區設定,調整 kernel clock為UTC(格林威治時間)
可以參考這邊的東西
http://cu.ttc.edu.tw/wordpress/
蠻多的!
要掛載成swap的硬碟分割區,必須是Linux swap(type 82)的類型。
掛載swap磁區
語法:
swapon <裝置名稱>
swapon -a
【範例1】
將/dev/hda2的swap磁區掛載。
swapon /dev/hda2
【範例2】
將所有的swap磁區掛載。
swapon -a
卸載swap磁區
語法:
swapoff <裝置名稱>
swapoff –a
【範例1】
將/dev/hda2的swap磁區卸載。
swapoff /dev/hda2
【範例2】
將所有的swap磁區卸載。
swapoff -a
假如有一顆只有分割出一個256MBswap空間的300G硬碟要割出另外要使用的分割曹
上面的意思就是說阿,要重新分割已經被分割過的硬碟前要先卸載上面的分割區
我的機器上面swap只有使用200k
不知道如果一台swap吃很大的機器卸載之後會怎麼樣= =
freeBSD安裝在RAID上面,實做經驗!
使用的機器是ASUS TS300-E4 PA4
按照使用手冊上的步驟進入LSI Logic Embedded SATA RAID設定RAID1
過程都可以從使用手冊上找到。在此不說明。
設定完後會要求重新開機,此時再到BIOS設為RAID為開機裝置
我安裝的系統是freeBSD amd64版本
安裝方法可以參考http://www.twbsd.org/
amd64和一般的i386都一樣
但是要注意的地方如下說明!
設定RAID之後,安裝系統時候的硬碟裝置要選擇ar0或者ar1...之類開頭的硬碟裝置
其他ad(n)安裝會出問題。而且選下去的瞬間就會跳出磁區錯誤的訊息了
而且我安裝的機器有四顆硬碟,我只有設定其中兩顆為RAID1。
另外兩顆一般使用。
但是當我安裝過程中要設定掛載ad硬碟時,選下去的瞬間就會跳出硬碟磁區錯誤的警告訊息了
雖然電腦依然可以讓你安裝系統在沒有被設定RAID的硬碟,
不過就我的安裝經驗來說!
同時擁有RAID、和一般硬碟時,選擇一般硬碟都會出現磁區錯誤的訊息,也就是說只能安裝在RAID過的硬碟
因此,我將系統安裝在RAID1硬碟,另外的硬碟不在安裝系統時掛載,這樣就不會出錯了!
另外
如果我設定四顆硬碟為兩個RAID1邏輯硬碟,那麼當我安裝系統在選擇硬碟時,
我沒有辦法分辨出哪個ra(n)硬碟對應到哪組硬碟,
也就是說如果想要保留原本存放在RAID1上面的資料的話,就一定要先將那組硬碟拔下來
我的機器好像沒有辦法在開了RAID之後再到BIOS設定哪顆硬碟不要被偵測到
而且還有一點很奇怪的是!
當我將RAID1初始化之後,做兩顆硬碟資料比對的動作
它會馬上跳出資料不一致的訊息,而且是連0%都還沒跑完就跳出這個訊息了哦= =
這點很奇怪...不知道為什麼會這樣...