天天加油 - 助您成才
FreeBSD网站平台建设全过程
您正在看的Linux|Unix是:FreeBSD网站平台建设全过程。
试验环境如下:

硬件环境:普通pc机,双网卡。配制不需要高,主要是稳定,并能适应长时间开机。听前辈介绍AMD k6的cpu运行FreeBSD好像有点问题。不过我没有试验。建议用intel的。

软件环境:操作系统:FreeBSD4.7(4.8)

web服务器:Apache 1.3.27+modssl +mod_php4+mod_gzip+mod_fastcgi +mod_perl +mySQL3.23

ftp服务器:Proftpd1.2.7+proftpd-mod-quotatab-1.2.4+mySQL

mail服务器: iceblood前辈制作的qmail安装包(经过修改)+vqregister-2.5

proxy服务器:使用FreeBSD内置的NAT和PPP拨号+squid

视频点播服务器:Helix Universal Servevr (realserver9.01)

网络环境:我用的是adsl动态拨号方式,因为动态ip所存在的一些问题,我把所有的服务都装在一台机器上,且这台机器要直接与外网相连。静态ip更方便一些。(本文两种方式都会讨论)

第一步:安装系统

关于安装过程网上有很多文章,这里不作详述。仅提出几点建议供大家参考:

1、 采用最小化安装。

2、 安装时启用inetd,并在编辑inetd.conf文件时,把带有“ftp”的行前面的“#”号去掉。这样作是为了以后安装软件时可以用ftp上传文件。

3、 添加一个wheel组的用户,这样在系统工作正常后可以在Windows系统上通过终端登录软件(如SecureCRT)进行所有操作。FreeBSD4.7在最小安装时支持SSH终端登录,所以我们需要使用支持SSH协议的终端软件,如SecureCRT。例如我添加的用户名是ylf,隶属wheel系统组。系统产生一个用户目录/home/ylf。我可以通过SecureCRT以ylf身份登录到系统,然后通过su命令切换到root用户。同时我也可以在ie浏览器内键入ftp://192.168.0.1 ,并输入ylf用户名和密码登录ftp将需要的文件上传到自己的用户目录里。(192.168.0.1是我的服务器连接内网的网卡ip地址)。以下除系统安装部分,我都是采用终端方式操作。

4、 分区时将/home、/usr和/var划的大一些,因为/usr为程序目录,/var要存放日志,/home是用户主目录,我的用户文件如网页、ftp上传文件等都放在这里。还有最好保留一部分空间留作以后需要的时候用。我的机器上有2块硬盘,一快18.2G SCSI硬盘,一块40G IDE硬盘。我是这样划分的。

128M /

20G /home

2G /ftp

256M /tmp

6G /usr

5G /var

其中/ftp是为匿名ftp用户访问专用。剩余空间留作备用。当然如果硬盘空间少的话,做我们的试验也是够用的。

关于安装方面的文章,大家也可以参考delphij写的《FreeBSD服务器的安装与优化》。[url]http://community.freebsdchina.org/catalog.php?forum=34[/url] 一文。

安装完系统后,要重新编译内核。目的是要系统支持Firrwall和提高运行效率。

首先确认系统是否安装了FreeBSD的内核支持。如果是最小安装,则需要运行/stand/sysinstall命令安装内核支持。方法如下:

# /stand/sysinstall

选Configure—Distributions—src—sys,内核文件将被安装在/usr/src/sys目录中。

注意:这之后的过程在终端上操作要方便许多。SecureCRT支持在终端界面上直接拷贝和粘贴文本内容。

转到内核文件目录

# cd /usr/src/sys/i386/conf

编辑内核文件

# vi kernel_wwwx # kernel_wwwx为我的内核文件名

我的内核文件如下:

#

# 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.

device tun 1

options IPFIREWALL #防火墙

options IPFIREWALL_FORWARD #允许透明代理

options IPFIREWALL_VERBOSE #允许防火墙日志

options IPFIREWALL_VERBOSE_LIMIT=100 #限制日志

options IPFIREWALL_DEFAULT_TO_ACCEPT #默认允许所有IP包

options IPDIVERT #启用由ipfw divert使用的转向IP套接字

# To make an SMP kernel, the next two are needed

#options SMP # Symmetric MultiProcessor Kernel

#options APIC_IO # Symmetric (APIC) I/O

device isa

device eisa

device pci

# ATA and ATAPI devices

device ata

device atadisk # ATA disk drives

# SCSI Controllers #没有SCSI设备不需要这段

device ahb # EISA AHA1742 family

device ahc # AHA2940 and onboard AIC7xxx devices

device ahd # AHA39320/29320 and onboard AIC79xx devices

device amd # AMD 53C974 (Tekram DC-390(T))

device isp # Qlogic family

device mpt # LSI-Logic MPT/Fusion

device ncr # NCR/SymBIOS Logic

device sym # NCR/SymBIOS Logic (newer chipsets)

options SYM_SETUP_LP_PROBE_MAP=0x40

# Allow ncr to attach legacy NCR devices when

# both sym and ncr are configured

device adv0 at isa?

device adw

device bt0 at isa?

device aha0 at isa?

device aic0 at isa?

device ncv # NCR 53C500

device nsp # Workbit Ninja SCSI-3

device stg # TMC 18C30/18C50

# 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, 8255

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!

pseudo-device bpf #Berkeley packet filt

排行

  1. alsa声卡驱动的安装
  2. RH8.0中NVIDIA显卡驱动跟ALSA声卡
  3. 探查DNS服务器运行状况
  4. Linux之菜鸟日记(一)
  5. Linux之菜鸟日记(二)
  6. 如何在Linux/390中编译执行C和C+
  7. 自制Liunx的开机画面
  8. Redhat7.0下配置smb.conf
  9. Linux发行版和安装的基本知识
  10. 在Linux下搭建Fortran开发环境
  11. 多线程proz代替fetch用于ports的
  12. Linux简明系统维护手册(2)
  13. Linux简明系统维护手册(3)
  14. 构建Linux下的DNS系统
  15. 搭建Windows下基于Eclipse的PHP开
  16. 十全十美数据完整性检测工具:Tr
  1. Linux中的TAB键妙用
  2. 个性定制Linux
  3. autoconf手册(七)
  4. 构建简单易用的FAX服务器
  5. 将5种操作系统汇于一身
  6. 使用mc恢复被删除文件
  7. 制作LinuxRPM包
  8. RedHat日志文件系统-ext3
  9. redhat7.1gnome汉化及chinput的安
  10. 如何让Linux运行两块以太网卡
  11. Linux之菜鸟日记(一)
  12. Linux之菜鸟日记(二)
  13. Linux进程编程介绍(一)
  14. Linux系统安全
  15. TurbolinuxforiSeries服务器软/硬
  16. 如何在Linux/390中编译执行C和C+
  1. alsa声卡驱动的安装
  2. RH8.0中NVIDIA显卡驱动跟ALSA声卡
  3. 关于GUI、Windowmanager、Deskto
  4. Linux之菜鸟日记(一)
  5. Linux之菜鸟日记(二)
  6. 如何在Linux/390中编译执行C和C+
  7. 自制Liunx的开机画面
  8. Redhat7.0下配置smb.conf
  9. Linux发行版和安装的基本知识
  10. 在Linux下搭建Fortran开发环境
  11. 多线程proz代替fetch用于ports的
  12. Linux简明系统维护手册(2)
  13. Linux简明系统维护手册(3)
  14. 搭建Windows下基于Eclipse的PHP开
  15. 十全十美数据完整性检测工具:Tr
  16. VPS就是这样做出来的

最近更新

  • 推荐阅读
  • Linux|Unix《FreeBSD网站平台建设全过程》FreeBSD网站平台建设全过程
    关于我们 | 版权申明 | 广告服务 | 友情链接 | 网站地图 | 使用帮助 | ©2006-2008 TTADD.COM