# # GENERIC -- Generic kernel configuration file for FreeBSD/i386 # # For more information on this file, please read the handbook section on # Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the # FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the # latest information. # # An exhaustive list of options and more detailed explanations of the # device lines is also present in the ./LINT configuration file. If you are # in doubt as to the purpose or necessity of a line, check first in LINT. # # $FreeBSD: src/sys/i386/conf/GENERIC,v 1.246.2.48 2002/08/31 20:28:26 obrien Exp $
machine i386 cpu I586_CPU cpu I686_CPU ident kernel_wwwx #内核文件名,这个要和你的内核文件名一致 maxusers 0
options INET #InterNETworking options FFS #Berkeley Fast Filesystem options FFS_ROOT #FFS usable as root device [keep this!] options SOFTUPDATES #Enable FFS soft updates support options UFS_DIRHASH #Improve performance on big directories options PROCFS #Process filesystem options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=15000 #Delay (in ms) before probing SCSI options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options P1003_1B #Posix P1003_1B real-time extensions options _KPOSIX_PRIORITY_SCHEDULING options ICMP_BANDLIM #Rate limit bad replies options AHC_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~128k to driver. options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver.
# SCSI peripherals #没有SCSI设备不需要这段 device scbus # SCSI bus (required) device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct SCSI access)
# atkbdc0 controls both the keyboard and the PS/2 mouse device atkbdc0 at isa? port IO_KBD device atkbd0 at atkbdc? irq 1 flags 0x1
device vga0 at isa?
# syscons is the default console driver, resembling an SCO console device sc0 at isa? flags 0x100
# Floating point support - do not disable. device npx0 at nexus? port IO_NPX irq 13
# Serial (COM) ports device sio0 at isa? port IO_COM1 flags 0x10 irq 4
# 我用的是8139和Dlink DFE-530TX网卡,大家可根据自己的网卡型号保留或删除 # 使用公共的MII总线控制器代码的PCI以太网适配器 # 注意:一定要保留'device miibus'以确保可用 # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support device fxp # Intel EtherExpress PRO/100B (82557, 82558) device rl # RealTek 8129/8139 device vr # VIA Rhine, Rhine II device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# Pseudo devices - the number indicates how many units to allocate. pseudo-device loop # Network loopback pseudo-device ether # Ethernet support pseudo-device sl 1 # Kernel SLIP pseudo-device ppp 1 # Kernel PPP pseudo-device tun # Packet tunnel. pseudo-device pty # Pseudo-ttys (telnet etc) pseudo-device md # Memory "disks" pseudo-device gif # IPv6 and IPv4 tunneling pseudo-device faith 1 # IPv6-to-IPv4 relaying (translation)
# The `bpf' pseudo-device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this!
default: set log Phase tun command set ifaddr 10.0.0.1/0 10.0.0.2/0 adsl: # 配置代号 set device PPPoE:vr0 # vr0 改成你连接ADSL modem的网卡名 set mru 1492 set mtu 1492 set authname username # username是拨号用户名 set authkey password # password是拨号密码 set dial set login add default HISADDR
# vi /etc/rc.conf
我的rc.conf文件内容如下:(动态ip)
# -- sysinstall generated deltas -- # Tue Jul 15 21:20:28 1997 # Created: Tue Jul 15 21:20:28 1997 # Enable network daemons for user convenience. # Please make all changes to this file, not to /etc/defaults/rc.conf. # This file now contains just the overrides from /etc/defaults/rc.conf. hostname="wwwx.3322.org" # 你的主机域名 ifconfig_fxp0="inet 192.168.0.1 netmask 255.255.255.0" #内网网卡ip地址,fxp0是网卡名 inetd_enable="YES" # 开机加载inetd kern_securelevel_enable="NO" linux_enable="YES" nfs_reserved_port_only="NO" sendmail_enable="NO" sshd_enable="YES" usbd_enable="NO" gateway_enable="YES" firewall_enable="YES" #启用防火墙 firewall_script="/etc/rc.firewall" firewall_type="open" firewall_quiet="YES" firewall_logging_enable="YES" ppp_enable="YES" # 开机自动拨号 ppp_mode="ddial" ppp_nat="YES" # 启用透明代理 ppp_profile="adsl" # 配置代号 # -- sysinstall generated deltas -- # Wed Jul 16 06:52:13 1997
# cd /home/ylf/app # tar zxvf squid-2.5.STABLE3.tar.gz #解压缩安装包 # cd squid-2.5.STABLE3 #进入解开的目录 # ./configure --prefix=/usr/local/squid #配制、将squid安装在/usr/local/squid目录 # make all #编译 # make install #安装
2003/06/21 18:01:09| Starting Squid Cache version 2.5.STABLE3 for i386-unknown-freebsd4.7... 2003/06/21 18:01:09| Process ID 160 2003/06/21 18:01:09| With 957 file descriptors available 2003/06/21 18:01:09| Performing DNS Tests... 2003/06/21 18:01:09| Successful DNS name lookup tests... 2003/06/21 18:01:09| DNS Socket created at 0.0.0.0, port 1029, FD 4 2003/06/21 18:01:09| Adding nameserver 202.97.224.68 from /etc/resolv.conf 2003/06/21 18:01:09| Unlinkd pipe opened on FD 9 2003/06/21 18:01:09| Swap maxSize 1048576 KB, estimated 80659 objects 2003/06/21 18:01:09| Target number of buckets: 4032 2003/06/21 18:01:09| Using 8192 Store buckets 2003/06/21 18:01:09| Max Mem size: 32768 KB 2003/06/21 18:01:09| Max Swap size: 1048576 KB 2003/06/21 18:01:09| Store logging disabled 2003/06/21 18:01:09| Rebuilding storage in /usr/local/squid/cache (DIRTY) 2003/06/21 18:01:09| Using Least Load store dir selection 2003/06/21 18:01:09| Current Directory is /usr/local/squid/etc 2003/06/21 18:01:09| Loaded Icons. 2003/06/21 18:01:09| Accepting HTTP connections at 0.0.0.0, port 3128, FD 8. 2003/06/21 18:01:09| WCCP Disabled. 2003/06/21 18:01:09| Ready to serve requests. 2003/06/21 18:01:16| Done scanning /usr/local/squid/cache swaplog (0 entries) 2003/06/21 18:01:16| Finished rebuilding storage from disk. 2003/06/21 18:01:16| 0 Entries scanned 2003/06/21 18:01:16| 0 Invalid entries. 2003/06/21 18:01:16| 0 With invalid flags. 2003/06/21 18:01:16| 0 Objects loaded. 2003/06/21 18:01:16| 0 Objects expired. 2003/06/21 18:01:16| 0 Objects cancelled. 2003/06/21 18:01:16| 0 Duplicate URLs purged. 2003/06/21 18:01:16| 0 Swapfile clashes avoided. 2003/06/21 18:01:16| Took 7.3 seconds ( 0.0 objects/sec). 2003/06/21 18:01:16| Beginning Validation Procedure 2003/06/21 18:01:16| Completed Validation Procedure 2003/06/21 18:01:16| Validated 0 Entries 2003/06/21 18:01:16| store_swap_size = 0k 2003/06/21 18:01:17| storeLateRelease: released 0 object
否则根据提示检查配制文件。
为了使squid的透明代理起作用,需要设置端口转发。方法如下:
编辑/etc/rc.firewall文件,添加下面一句:
ipfw add 00500 fwd 127.0.0.1,3128 tcp from 192.168.0.0/24 to any 80
下面建立squid的启动脚本squid.sh:
首先建立/usr/local/etc/rc.d目录:
# mkdir /usr/local/etc # mkdir /usr/local/etc/rc.d # cd /usr/local/etc/rc.d # vi squid.sh
文件内容如下:
#!/bin/sh
# if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then # echo "$0: Cannot determine the PREFIX" >&2 # exit 1 # fi
case "$1" in start) if [ -x /usr/local/squid/sbin/squid -a -f /usr/local/squid/etc/squid.conf ]; then (cd /usr/local/squid/var/logs; /usr/local/squid/sbin/squid >/dev/null 2>&1 &) ; echo -n ' squid' fi ;; stop) /usr/local/squid/sbin/squid -k shutdown 2>&1 # Uncomment this if you'd like the system to (attempt to # wait for) squid to shut down cleanly #echo "Sleeping for 45 seconds to allow squid to shutdown.." #sleep 45 ;; *) echo "Usage: `basename $0` {start|stop}" >&2 ;; esac
# cd /usr/local/www/data # mkdir backup # mv * backup
将论坛程序拷贝到/usr/local/www/data目录
# cd /home/ylf/app/vbb2.3.0final # cp –r * /usr/local/www/data
编辑论坛配置文件:
# vi /usr/local/www/data/admin/config.php
内容如下:
<?php^M ^M /////////////////////////////////////////////////////////////^M // Please note that if you get any errors when connecting, //^M // that you will need to email your host as we cannot tell //^M // you what your specific values are supposed to be //^M /////////////////////////////////////////////////////////////^M ^M // type of database running^M // (only mysql is supported at the moment)^M $dbservertype='mysql';^M #数据库类型 ^M // hostname or ip of server^M $servername='localhost';^M #主机名 ^M // username and password to log onto db server^M $dbusername='root';^M #登录数据库用户 $dbpassword='123456';^M #密码 ^M // name of database^M $dbname='fin230';^M #论坛所使用的数据库名称 ^M // technical email address - any error messages will be emailed here^M $technicalemail='webmaster@yoursite.com';^M #管理信息 ^M // use persistant connections to the database^M // 0 = don't use^M // 1 = use^M $usepconnect=1;^M ^M ?>
# cd /home/ylf/app # tar zxvf proftpd-1.2.7.tar.gz # tar zxvf proftpd-mod-quotatab-1.2.4.tar.gz
进入mod-quotatab目录
# cd mod_quotatab
把mod_quotatab中的文件拷贝到proftpd 中的modules 目录中
# cp * ../proftpd-1.2.7/modules
在开始运行configure之前,我们要先改动一个文件
进入 proftpd-1.2.7/contrib 目录
# cd /home/ylf/app/proftpd-1.2.7/contrib
修改 mod_sql_mysql.c
# vi mod_sql_mysql.c
找到#include <mysql/mysql.h> 把他改为你的实际路径,这里是:
#include </usr/local/include/mysql/mysql.h>
然后编译安装:
# cd /home/ylf/app/proftpd-1.2.7 #./configure --prefix=/usr/local/proftpd --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql --with-includes=/usr/local/include/mysql --with-libraries=/usr/local/lib/mysql # make # make install
进入到proftpd配置文件所在目录
# cd /usr/local/proftpd/etc
备份原配置文件
# mv proftpd.conf proftpd.conf.bak
然后编辑新的配置文件proftpd.conf
# vi proftpd.conf
我的proftpd.conf内容如下:
# This is a basic ProFTPD configuration file (rename it to # 'proftpd.conf' for actual use. It establishes a single server # and a single anonymous login. It assumes that you have a user/group # "nobody" and "ftp" for normal operation and anon.
ServerName "ftpx.3322.org" ServerType standalone DefaultServer on
# 用户登陆时不显示ftp服务器版本信息 ServerIdent off
# Port 21 is the standard FTP port. Port 21
# Umask 022 is a good standard umask to prevent new dirs and files # from being group and world writable. Umask 022
# To prevent DoS attacks, set the maximum number of child processes # to 30. If you need to allow more than 30 concurrent connections # at once, simply increase this value. Note that this ONLY works # in standalone mode, in inetd mode you should use an inetd server # that allows you to limit maximum number of processes per service # (such as xinetd). MaxInstances 30
# Set the user and group under which the server will run. User FTPUSR Group FTPGRP
# Normally, we want files to be overwriteable. <Directory /> AllowOverwrite on </Directory>
# A basic anonymous configuration, no upload directories. # 匿名登录设置。匿名用户目录为/ftp <Anonymous /ftp> User ftp Group ftpusers
# We want clients to be able to login with "anonymous" as well as "ftp" UserAlias anonymous ftp
# Limit the maximum number of anonymous logins MaxClients 10
# We want 'welcome.msg' displayed at login, and '.message' displayed # in each newly chdired directory. DisplayLogin welcome.msg DisplayFirstChdir .message
# Limit WRITE everywhere in the anonymous chroot #<Limit WRITE> # DenyAll #</Limit>
CREATE TABLE quotalimits ( name VARCHAR(30), quota_type ENUM("user", "group", "class", "all") NOT NULL, per_session ENUM("false", "true") NOT NULL, limit_type ENUM("soft", "hard") NOT NULL, bytes_in_avail FLOAT NOT NULL, bytes_out_avail FLOAT NOT NULL, bytes_xfer_avail FLOAT NOT NULL, files_in_avail INT UNSIGNED NOT NULL, files_out_avail INT UNSIGNED NOT NULL, files_xfer_avail INT UNSIGNED NOT NULL );
CREATE TABLE quotatallies ( name VARCHAR(30) NOT NULL, quota_type ENUM("user", "group", "class", "all") NOT NULL, bytes_in_used FLOAT NOT NULL, bytes_out_used FLOAT NOT NULL, bytes_xfer_used FLOAT NOT NULL, files_in_used INT UNSIGNED NOT NULL, files_out_used INT UNSIGNED NOT NULL, files_xfer_used INT UNSIGNED NOT NULL );
ftp> quote SITE QUOTA 200-The current quota for this session are [current/limit]: Name: user1 Quota Type: User Per Session: False Limit Type: Soft Uploaded Kb: 0.00/10000.00 Downloaded Kb: unlimited Transferred Kb: 0.00/2000.00 Uploaded files: 0/500 Downloaded files: unlimited Transferred files: 0/10 200 Please contact root@wwwx.3322.org if these entries are inaccurate
# cd /home/ylf/app # tar zxvf qmail_setup-v1.5.3.tar.gz
进入解开的目录
# cd Qmail_setup
将新的sqwebmail中文安装包拷到此目录
# cp ../sqwebmail-3.5.0-cn.tar.gz ./
编辑安装配置文件setup
# vi seutp
按系统情况修改如下内容:(这里是我的配置)
# 操作系统类型为FreeBSD _OS="FreeBSD"
# 默认语言为中文 _LANG="CN"
# 不安装apache _INSTALLAPACHE="NO"
# 添加qmail用户 _ADDQMAILUSERS="YES"
# 域名 _DOMAIN=mail01.3322.org
# 邮箱管理员密码 _MAILPASSWD=1234
# CGI路径 _CGIBIN=/usr/local/www/cgi-bin
# Html路径 _HTMLPATH=/usr/local/www/data
###########--------Advanced set--------################# # 设置邮箱容量50M _MAILSIZE=50000000 # enable virutal domain lookup via reverse ip address lookup for virtual domains. "y" and "n" _USERCRUISE=n # apache 安装路径 _APACHEPATH=/usr/local # 不使用系统用户验证 _SYSTEMPASS=n # 安装 vpopmail _VPOPMAIL="YES" # 安装 ezmlm _EZMLMIN="YES" # ezmlm coding _EZMLM=ch_GB # 安装 autorespond _AUTORESPOND="YES" # 安装 QmailAdmin _QMAILADMIN="YES"
##########--------SqWebMail set--------############# # 安装 webmail _WEBMAIL="YES" # webmail coding set.have "iso","gb2312","big5" and more. _MIMESET=gb2312 # webmail use SSL,"YES" or "NO" _WEBHTTPS="NO"
##########--------SQL set---------################ # 使用数据库 _SQL=y # mysql 主机 _SQLHOST=localhost # mysql 用户 _SQLUSER=root # mysql 密码 _SQLPASS=123456 # include path _INCDIR=/usr/local/include/mysql # lib file path _LIBDIR=/usr/local/lib/mysql
然后在安装脚本里找到下面几句
tar xzf sqwebmail-3.3.7.20020910.tar.gz cd sqwebmail-3.3.7.20020910 if [ "$_LANG" = "CN" ]; then cp /tmp/iceblood/Qmail_setup/iceblood/sqwebmailcn/*.html sqwebmail/html/en-us fi
将其改为
tar xzf sqwebmail-3.5.0-cn.tar.gz cd sqwebmail-3.5.0 # if [ "$_LANG" = "CN" ]; then # cp /tmp/iceblood/Qmail_setup/iceblood/sqwebmailcn/*.html sqwebmail/html/en-us # fi