归档于 ‘FreeBSD’ 分类
中文PureFTPd配置文件翻译
cd /usr/ports/ftp/pure-ftp
vim Makefile
把 off 改成 on,保存退出
OPTIONS= MYSQL “Support for users in MySQL database” off \
安装完毕后的相关信息
Now you need to examine /usr/local/share/examples/pure-ftpd/pam/pure-ftpd
and add the relevant PAM configuration lines to your
/etc/pam.conf file.
If you defined call upload script in pure-ftpd config
define corresponding vars in rc.conf
Without it pure-ftpd will not listen [...]
简单记录一下
# make install clean
# mkdir /usr/local/pgsql/data
# chown pgsql /usr/local/pgsql/data
初始化
# su pgsql
# /usr/local/bin/initdb -D /usr/local/pgsql/data
# /usr/local/bin/postgres -D /usr/local/pgsql/data
自启动
rc.conf
postgresql_enable=”YES”
postgresql_data=”/usr/local/pgsql/data”
测试
$ /usr/local/bin/createdb test
$ /usr/local/bin/psql test
Welcome to psql 8.3.1, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
test=#
要备份出你的数据库安装,敲入:
pg_dumpall > outputfile
使用新的 psql, [...]
ntpd_enable
/etc/ntp.conf
server hshh.org
server pool.ntp.org
driftfile /etc/ntp/ntp.drift
/etc/rc.d/ntpd start
只想让 lighttpd 跑静态的网页,默认即可.
lighttpd_enable="YES"
lighttpd_conf="/usr/local/etc/lighttpd.conf"
放到 /etc/rc.conf 中,这样 /usr/local/etc/rc.d/lighttpd 脚本才会起作用,否则就直接运行 /usr/local/sbin/lighttpd -f lighttpd.conf 来启动 lighttpd
因为lighttpd的日志文件必须以www身份,所以需要chown一下
bsd# mkdir /usr/local/www/data/
bsd# touch /var/log/lighttpd.access.log
bsd# chown www:www /var/log/lighttpd.access.log
bsd# touch /var/log/lighttpd.error.log
bsd# chown www:www /var/log/lighttpd.error.log
执行 /usr/local/etc/rc.d/lighttpd start 即可
技巧:如何快速清空日志?
bsd# :>lighttpd.access.log
1.启用 pf
在 rc.conf 中配置了 pf_enable=”YES” 就可以加载pf 模块了,当然你也可以编译到内核
pfctl(8)
-d Disable the packet filter.
-e Enable the packet filter.
-f /etc/pf.conf 载入 pf.conf 文件
-nf /etc/pf.conf 解析文件,但不载入
-Nf /etc/pf.conf 只载入文件中的 NAT 规则
-Rf /etc/pf.conf 只载入文件中的过滤规则
-sn 显示当前的 NAT 规则
-sr 显示当前的过滤规则
-ss 显示当前的状态表
-si 显示过滤状态和计数
-sa 显示任何可显示的
注意:要先写NAT再写过滤规则;规则是从上到下,全部读取完后再执行.
一个朋友的朋友帮忙写的简单例子:
ext_if="fxp0"
int_if="re0"
lo_if="lo0"
ext_ports="{21, 22, 80}"
int_ips="{ 192.168.0.1, 192.168.0.2}"
scrub in all
no rdr on $lo_if from any to any
block in all
pass in quick on $ext_if proto tcp from any to $ext_if port $ext_ports
pass in quick on $int_if from [...]

















