FreeBSD的systat命令备忘
[ 2007/11/14 13:09 | by Johnny.He ]
systat 是一个在FreeBSD中帮助你查看、观察系统状况的命令,并且显示在屏幕。
systat -- display system statistics on a crt
使用方法:
systat [-display] [更新-时间]
示范:
systat -vmstat 1
systat -- display system statistics on a crt
使用方法:
systat [-display] [更新-时间]
示范:
systat -vmstat 1
FreeBSD修改IP
[ 2007/11/12 07:51 | by Johnny.He ]
FreeBSD下如何更改IP
1.进入 /etc/rc.conf 文件
2.修改 ifconfig_lnc0="inet xxx.xxx.xxx.xxx netmask 255.255.255.0"
别忘了defaultrouter="xxx.xxx.xxx.xxx (gateway ip address)"
如果想一次性的话,只要直接输入 ifconfig lnc0 xxx.xxx.xxx.xxx netmask 255.255.255.0
即时生效
重启后失效!!
图形界面配置IP
sysinstall --> configure --> Networking -->interfaces -->相应网卡名
1.进入 /etc/rc.conf 文件
2.修改 ifconfig_lnc0="inet xxx.xxx.xxx.xxx netmask 255.255.255.0"
别忘了defaultrouter="xxx.xxx.xxx.xxx (gateway ip address)"
如果想一次性的话,只要直接输入 ifconfig lnc0 xxx.xxx.xxx.xxx netmask 255.255.255.0
即时生效
重启后失效!!
图形界面配置IP
sysinstall --> configure --> Networking -->interfaces -->相应网卡名
修改FreeBSD系统时间
[ 2007/11/07 17:05 | by Johnny.He ]
sysinstall
#Configure
#Time Zone
#CMOS clock set to UTC? [ No ]
#5 Asia
#9 China
#1 east China - Beijing, Guangdong, Shanghai, etc.
#Does the abbreviation `CST' look reasonable? [ Yes ]
#[Cancel]
#[X Exit Install]
date 200711071728(date 年月日时分)
以上时间修改完成,但是不知道重起之后会怎么样,我reboot了一次,察看时间的时候已经正确了,但是不知道这种方法是否正确...
#Configure
#Time Zone
#CMOS clock set to UTC? [ No ]
#5 Asia
#9 China
#1 east China - Beijing, Guangdong, Shanghai, etc.
#Does the abbreviation `CST' look reasonable? [ Yes ]
#[Cancel]
#[X Exit Install]
date 200711071728(date 年月日时分)
以上时间修改完成,但是不知道重起之后会怎么样,我reboot了一次,察看时间的时候已经正确了,但是不知道这种方法是否正确...
Apache22后 Gzip的安装
[ 2007/11/03 22:42 | by Johnny.He ]
今天刚刚装好服务器,上了FreeBSD6.2,ports安装了 apache22,php5,php5-ex,mysql50-Ser 上面放了一个Discuz的论坛,安装也成功,但是我进入后台 要起用 Gzip的时候 他告诉我没有安装,然后我返回到ports/www/mod_gzip,make就出错,不知道是什么原因。
错误如下:(只贴了最后的部分..)
错误如下:(只贴了最后的部分..)
mod_gzip.c: In function `mod_gzip_generate_vary_header':
mod_gzip.c:8069: error: `array_header' undeclared (first use in this function)
mod_gzip.c:8069: error: `ary' undeclared (first use in this function)
mod_gzip.c:8071: warning: assignment makes pointer from integer without a cast
mod_gzip.c:8076: warning: assignment makes pointer from integer without a cast
mod_gzip.c:8080: warning: return makes pointer from integer without a cast
mod_gzip.c: In function `mod_gzip_compress_file':
mod_gzip.c:8110: warning: passing arg 4 of `ap_log_error' makes integer from pointer without a cast
mod_gzip.c:8110: warning: passing arg 5 of `ap_log_error' from incompatible pointer type
apxs:Error: Command failed with rc=65536
.
*** Error code 1
Stop in /usr/ports/www/mod_gzip/work/mod_gzip-1.3.26.1a.
*** Error code 1
Stop in /usr/ports/www/mod_gzip.
mod_gzip.c:8069: error: `array_header' undeclared (first use in this function)
mod_gzip.c:8069: error: `ary' undeclared (first use in this function)
mod_gzip.c:8071: warning: assignment makes pointer from integer without a cast
mod_gzip.c:8076: warning: assignment makes pointer from integer without a cast
mod_gzip.c:8080: warning: return makes pointer from integer without a cast
mod_gzip.c: In function `mod_gzip_compress_file':
mod_gzip.c:8110: warning: passing arg 4 of `ap_log_error' makes integer from pointer without a cast
mod_gzip.c:8110: warning: passing arg 5 of `ap_log_error' from incompatible pointer type
apxs:Error: Command failed with rc=65536
.
*** Error code 1
Stop in /usr/ports/www/mod_gzip/work/mod_gzip-1.3.26.1a.
*** Error code 1
Stop in /usr/ports/www/mod_gzip.
解决Apache关于‘httpready’报错的办法
[ 2007/11/02 16:24 | by Johnny.He ]
在安装了Apache以后,确认httpd.conf的配置没有任何错误,但启动时却遇到:
解决办法:要在内核加载accf_http这个module,他的作用是直到接到完整的http请求前先缓冲下数据。
可以输入 kldload accf_http 加载到内核中,如果想永久的在内核里加载这个模块可以在/boot/loader.conf文件中输入:
“[warn] (2)No such file or directory:Failed to enable the ‘httpready’ Accept Filter”
这个错误,百思不得其解。后来找遍资料终于明白,原因出在内核上(我的FreeBSD是6.2)。解决办法:要在内核加载accf_http这个module,他的作用是直到接到完整的http请求前先缓冲下数据。
可以输入 kldload accf_http 加载到内核中,如果想永久的在内核里加载这个模块可以在/boot/loader.conf文件中输入:
accf_http_load=”YES”
tcsh(csh兼用) 提示符常用的变量
[ 2007/11/01 14:22 | by Johnny.He ]
! 和%h一样
%B 开始粗体模式
%b 结束粗体模式
%c 当前工作目录名称的最后部分
%c2,%c3等等 当前工作目录名称的最后两个、三个(等等)组成部分
%C 跟%c类似,但是使用长形式的目录名称
%d 本周的当天
%D 今天是当月中的第几天
%h 当前命令的历史记录编号
%l shell的当前控制终端
%L 清除从提示符末尾到下一行的所有内容
%m 机器的主机名称
%M 机器的完全符合规范的域名
%n 用户名
%B 开始粗体模式
%b 结束粗体模式
%c 当前工作目录名称的最后部分
%c2,%c3等等 当前工作目录名称的最后两个、三个(等等)组成部分
%C 跟%c类似,但是使用长形式的目录名称
%d 本周的当天
%D 今天是当月中的第几天
%h 当前命令的历史记录编号
%l shell的当前控制终端
%L 清除从提示符末尾到下一行的所有内容
%m 机器的主机名称
%M 机器的完全符合规范的域名
%n 用户名
没有想到啊…… 没有想到……
前两天买得书,在网上找到了....,虽然没有多少米,就是不爽!
不过这个是英文版,嘿!我看了看我买的书,再看看这个E文版本,发现了一个更让自己痛心的事情!这书翻译的错误够低级的!
不管怎么说,我把这个E文版的放上来,E文好的看看吧,总的来说我觉得不错。
文件格式:CHM,使用Winrar压缩,请解压缩后阅览!
-----------------------------------------------------
Looking for a unique set of practical tips, tricks, and tools for administrators and power users of BSD systems? From hacks to customize the user environment to networking, securing the system, and optimization, BSD Hacks takes a creative approach to saving time and accomplishing more with fewer resources. If you want more than the average BSD user--to explore and experiment, unearth shortcuts, create useful tools--this book is a must-have.
-----------------------------------------------------
下载文件 (已下载 2300 次)
前两天买得书,在网上找到了....,虽然没有多少米,就是不爽!
不过这个是英文版,嘿!我看了看我买的书,再看看这个E文版本,发现了一个更让自己痛心的事情!这书翻译的错误够低级的!
不管怎么说,我把这个E文版的放上来,E文好的看看吧,总的来说我觉得不错。
文件格式:CHM,使用Winrar压缩,请解压缩后阅览!
-----------------------------------------------------
Looking for a unique set of practical tips, tricks, and tools for administrators and power users of BSD systems? From hacks to customize the user environment to networking, securing the system, and optimization, BSD Hacks takes a creative approach to saving time and accomplishing more with fewer resources. If you want more than the average BSD user--to explore and experiment, unearth shortcuts, create useful tools--this book is a must-have.
-----------------------------------------------------
下载文件 (已下载 2300 次)用ports安装Apache+PHP+MySQL
[ 2007/09/18 09:15 | by Johnny.He ]
cvsup -h cvsup.freebsd.org /usr/share/example/cvsup/ports-supfile
# 这条命令的大体意思是从互联网上同步一下ports,以防止后续的工作中出现不必要的麻烦。
# 接下来的步骤就是要安装MySQL了:
cd /usr/ports/databases/mysql50-server/
make install clean ;rehash # N长时间的等待
# 配置mysql:
cp /usr/local/share/mysql/my-small.cnf /etc/my.cnf
# 以上是起用小内存模式使用mysql,如果条件允许,您可以尝试 my-big.cnf 甚至于 my-huge.cnf
# 这条命令的大体意思是从互联网上同步一下ports,以防止后续的工作中出现不必要的麻烦。
# 接下来的步骤就是要安装MySQL了:
cd /usr/ports/databases/mysql50-server/
make install clean ;rehash # N长时间的等待
# 配置mysql:
cp /usr/local/share/mysql/my-small.cnf /etc/my.cnf
# 以上是起用小内存模式使用mysql,如果条件允许,您可以尝试 my-big.cnf 甚至于 my-huge.cnf






