FreeBSD全能服务器安装手册v0.0.6
时间:2007-01-04 10:28:06
来源: 作者:whsong 点击:次 出处:技术无忧
关键字:Free
FreeBSD全能服务器安装手册之系统安装篇 注意:本安装文档以FreeBSD5.4为例
启动电源=〉进入bios设置光驱启动=〉将光盘放进光驱=〉重启机器后,机器会从光驱启动并进入FREEBSD5.4的内核并自动启动 光盘里的sysinstall程序。
首先,选择mini安装,这也是作为互联网服务器的通用要求,没人会在服务器上用图形界面的!
第一部:选择安装方式Standard(标准安装) Begin a standard installation (recommended)
lqqqqqqqqqqqqqqqqqqqqqqqq sysinstall Main Menu qqqqqqqqqqqqqqqqqqqqqqqqqk
x Welcome to the FreeBSD installation and configuration tool. Please x
x select one of the options below by using the arrow keys or typing the x
x first character of the option name you're interested in. Invoke an x
x option with [SPACE] or [ENTER]. To exit, use [TAB] to move to Exit. x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x Usage Quick start - How to use this menu system x x
x x Standard Begin a standard installation (recommended) x x
x x Express Begin a quick installation (for experts) x x
x x Custom Begin a custom installation (for experts) x x
x x Configure Do post-install configuration of FreeBSD x x
x x Doc Installation instructions, README, etc. x x
x x Keymap Select keyboard type x x
x x Options View/Set various installation options x x
x x Fixit Repair mode with CDROM/DVD/floppy or start shell x x
x x Upgrade Upgrade an existing system x x
x x Load Config Load default install configuration x x
x x Index Glossary of functions x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ Select ] X Exit Install x
mqqqqqqqqqqqqqqqqqq[ Press F1 for Installation Guide ]qqqqqqqqqqqqqqqqqqj
第二部: 提示信息提示程序将进入fdisk
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Message qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
xIn the next menu, you will need to set up a DOS-style ("fdisk") partitioning x
xscheme for your hard disk. If you simply wish to devote all disk space x
xto FreeBSD (overwriting anything else that might be on the disk(s) selected) x
xthen use the (A)ll command to select the default partitioning scheme followed x
xby a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a x
xpartition marked "unused" and use the (C)reate command. x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq(100%)qqu
x [ OK ] x
mqqqqqqqqqqqqqqqqqqqqqqqqqqq[ Press enter or space ]qqqqqqqqqqqqqqqqqqqqqqqqqqqj
第三部:选择将系统安装到哪个磁盘
qqqqqqqqqqqqqqqqqqqqqqqqqqqqSelect Drivesqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
--Please select the dirve,or drives,on which you wish to perfom
--This operation. If you are attempting to install a boot partition
--On a dirve other than the first one or have multiple operating
--Systems on your machine, you will have the option to install aboot
--Manager later. To select a drive,use the arrow keys to move to it
--and press [SPACE] or [ENTER]. To de-select it,press it again.
--Use [TAB] to get to the buttons and leave this menu.
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq[ ]ad0 ad0qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq[ ]ad1 ad1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqq [ OK ] Cancel qqqqqqqqqqqqqqqqqqqqqqqqq
第四部:我们选择硬盘一,出现以下界面
Disk name: ad0 FDISK Partition Editor
DISK Geometry: 5221 cyls/255 heads/63 sectors = 83875365 sectors (40954MB)
Offset Size(ST) End Name PType Desc Subtype Flags
0 83886080 83886079 - 12 unused 0
The following commands are supported (in upper or lower case):
A = Use Entire Disk G = set Drive Geometry C = Create Slice F = `DD' mode
D = Delete Slice Z = Toggle Size Units S = Set Bootable | = Wizard m.
T = Change Type U = Undo All Changes W = Write Changes
Use F1 or ? to get more help, arrow keys to select.
第五部:选择c建立fb需要的分区;意思是将整个磁盘用于系统
lqqqqqqqqqqqqqqqqqqqq Value Required qqqqqqqqqqqqqqqqqqqqqk
x Please specify the size for new FreeBSD slice in blocks x
x or append a trailing `M' for megabytes (e.g. 20M). x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x83886080 x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第六部:选择ok出现让我们确认分区类型的对话框
qqqqqqqqqqqqqqqqqqqqqqqqqq Value Required qqqqqqqqqqqqqqqqqqqqqqqqqq
x Enter type of partition to create: x
x x
x Pressing Enter will choose the default, a native FreeBSD x
x slice (type 165). Other popular values are 6 for a x
x DOS FAT partition, 131 for a Linux ext2fs partition, or x
x 130 for a Linux swap partition. x
x x
x Note: If you choose a non-FreeBSD partition type, it will not x
x be formatted or otherwise prepared, it will simply reserve space x
x for you to use another tool, such as DOS format, to later format x
The fox and actually use the partition. x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x165 x x
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
x [ OK ] Cancel x
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第七部:选择ok(我们看到所需的bsd分区已经有了!)
Disk name: ad0 FDISK Partition Editor
DISK Geometry: 5221 cyls/255 heads/63 sectors = 83875365 sectors (40954MB)
Offset Size(ST) End Name PType Desc Subtype Flags
0 63 62 - 12 unused 0
63 83875302 83875364 ad0s1 8 freebsd 165
83875365 10715 83886079 - 12 unused 0
The following commands are supported (in upper or lower case):
A = Use Entire Disk G = set Drive Geometry C = Create Slice F = `DD' mode
D = Delete Slice Z = Toggle Size Units S = Set Bootable | = Wizard m.
T = Change Type U = Undo All Changes W = Write Changes
Use F1 or ? to get more help, arrow keys to select.
第八部:选择q完成退出(出现选择启动管理器的界面)
lqqqqqqqqqqqqqqqqq Install Boot Manager for drive ad0? qqqqqqqqqqqqqqqqqqk
x FreeBSD comes with a boot selector that allows you to easily x
x select between FreeBSD and any other operating systems on your machine x
x at boot time. If you have more than one drive and want to boot x
x from the second one, the boot selector will also make it possible x
x to do so (limitations in the PC BIOS usually prevent this otherwise). x
x If you do not want a boot selector, or wish to replace an existing x
x one, select "standard". If you would prefer your Master Boot x
x Record to remain untouched then select "None". x
x x
x NOTE: PC-DOS users will almost certainly require "None"! x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x BootMgr Install the FreeBSD Boot Manager x x
x x Standard Install a standard MBR (no boot manager) x x
x x None Leave the Master Boot Record untouched x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqq[ Press F1 to read about drive setup ]qqqqqqqqqqqqqqqqqj
第九部我们选择BootMgr Install the FreeBSD Boot Manager出现一个让我们确定的界面
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Message qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
xNow you need to create BSD partitions inside of the fdisk partition(s) x
xjust created. If you have a reasonable amount of disk space (200MB or more) x
xand don't have any special requirements, simply use the (A)uto command to x
xallocate space automatically. If you have more specific needs or just don't x
xcare for the layout chosen by (A)uto, press F1 for more information on x
xmanual layout. x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq(100%)qqu
x [ OK ] x
mqqqqqqqqqqqqqqqqqqqqqqqqqqq[ Press enter or space ]qqqqqqqqqqqqqqqqqqqqqqqqqqqj
第十部:我们确定下面开始分区操作
FreeBSD Disklabel Editor
Disk: ad0 Partition name: ad0s1 Free: 83875302 blocks (40954MB)
Part Mount Size Newfs Part Mount Size Newfs
---- ----- ---- ----- ---- ----- ---- -----
The following commands are valid here (upper or lower case):
C = Create D = Delete M = Mount pt. W = Write
N = Newfs Opts Q = Finish S = Toggle SoftUpdates Z = Custom Newfs
T = Toggle Newfs U = Undo A = Auto Defaults R = Delete+Merge
Use F1 or ? to get more help, arrow keys to select.
第十一部:选择c建立根分区大小是512MB
lqqqqqqqqqqqqqqqqqqqqqqqqqqqq Value Required qqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Please specify the partition size in blocks or append a trailing G for x
x gigabytes, M for megabytes, or C for cylinders. x
x 83875302 blocks (40954MB) are free. x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x512MB x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第十二部:选择分区类型
lqqqqqqqqqqqqqqqq Please choose a partition type qqqqqqqqqqqqqqqqk
x If you want to use this partition for swap space, select Swap. x
x If you want to put a filesystem on it, choose FS. x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x FS A file system x x
x x Swap A swap partition. x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第十三部:选择分区挂载点 ‘/’
FreeBSD Disklabel Editor
Disk: ad0 Partition name: ad0s1 Free: 83875302 blocks (40954MB)
Part Mount Size Newfs Part Mount Size Newfs
---- ----- ---- ----- ---- ----- ---- -----
lqqqqqqqqqqqqqqqq Value Required qqqqqqqqqqqqqqqqk
x Please specify a mount point for the partition x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x/ x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
The following commands are valid here (upper or lower case):
C = Create D = Delete M = Mount pt. W = Write
N = Newfs Opts Q = Finish S = Toggle SoftUpdates Z = Custom Newfs
T = Toggle Newfs U = Undo A = Auto Defaults R = Delete+Merge
Use F1 or ? to get more help, arrow keys to select.
第十四部:依照上面的方法我们依次建立以下分区
swap /tmp /var /usr /www
当然你也可以根据自己的需要同时建立其他的分区
以下是我的分区
FreeBSD Disklabel Editor
Disk: ad0 Partition name: ad0s1 Free: 0 blocks (0MB)
Part Mount Size Newfs Part Mount Size Newfs
---- ----- ---- ----- ---- ----- ---- -----
ad0s1a / 512MB UFS2 Y
ad0s1b swap 1024MB SWAP
ad0s1d /var 10240MB UFS2+S Y
ad0s1e /tmp 4048MB UFS2+S Y
ad0s1f /usr 10240MB UFS2+S Y
ad0s1g /www 14890MB UFS2+S Y
The following commands are valid here (upper or lower case):
C = Create D = Delete M = Mount pt. W = Write
N = Newfs Opts Q = Finish S = Toggle SoftUpdates Z = Custom Newfs
T = Toggle Newfs U = Undo A = Auto Defaults R = Delete+Merge
Use F1 or ? to get more help, arrow keys to select.
第十五部:分区结束选择q完成退出接着出现选安装选项
lqqqqqqqqqqqqqqqqqqqqqqqqqqqq Choose Distributions qqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x As a convenience, we provide several "canned" distribution sets. x
x These select what we consider to be the most reasonable defaults for the x
x type of system in question. If you would prefer to pick and choose the x
x list of distributions yourself, simply select "Custom". You can also x
x pick a canned distribution set and then fine-tune it with the Custom item. x
x x
x Choose an item by pressing [SPACE] or [ENTER]. When finished, choose the x
x Exit item or move to the OK button with [TAB]. x
x lqqqqq^(-)qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x [ ] 4 Developer Full sources, binaries and doc but no games x x
x x [ ] 5 X-Developer Same as above + X Window System x x
x x [ ] 6 Kern-Developer Full binaries and doc, kernel sources only x x
x x [ ] 7 X-Kern-Developer Same as above + X Window System x x
x x [ ] 8 User Average user - binaries and doc only x x
x x [ ] 9 X-User Same as above + X Window System x x
x x [ ] A Minimal The smallest configuration possible x x
x x > > B Custom Specify your own distribution set x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ OK ] Cancel x
mqqqqqqqqqqqqq[ Press F1 for more information on these options. ]qqqqqqqqqqqqqqj
第十六部:选择最小化安装A Minimal;并选定安装介质(我们选择CD/DVD安装这也是最快捷最简便的安装方法!也是我推荐的!不过现在你也可以尝试网络安装。)
lqqqqqqqqqqqqqqqqqqqqqqq Choose Installation Media qqqqqqqqqqqqqqqqqqqqqqqk
x FreeBSD can be installed from a variety of different installation x
x media, ranging from floppies to an Internet FTP server. If you're x
x installing FreeBSD from a supported CD/DVD drive then this is generally x
x the best media to use if you have no overriding reason for using other x
x media. x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x 1 CD/DVD Install from a FreeBSD CD/DVD x x
x x 2 FTP Install from an FTP server x x
x x 3 FTP Passive Install from an FTP server through a firewall x x
x x 4 HTTP Install from an FTP server through a http proxy x x
x x 5 DOS Install from a DOS partition x x
x x 6 NFS Install over NFS x x
x x 7 File System Install from an existing filesystem x x
x x 8 Floppy Install from a floppy disk set x x
x x 9 Tape Install from SCSI or QIC tape x x
x x X Options Go to the Options screen x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ OK ] Cancel x
mqqqqqq[ Press F1 for more information on the various media types ]qqqqqqqj
第十七部:对以上选择进行确认(这部确定之后你就没有反悔的机会了,看你的硬盘灯吧!已经开始格式化了!)
qqqqqqqqqqqqqqqqqqqqqqqqUser Confirmation Requestedqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qLast Chance! Are you SURE you want continue the installation?
qif you’re runing this on a disk with data you wish to save
qthen WE STRONGLY YOU TO MAKE PROPER BACKUPS before
qproceeding!
qWe can take no responsibility for lost disk contents!
qqqqqqqqqqqqqqqqqqqqqq [ ]ok [ ]Cancel qqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第十八部:基本系统安装完毕,出现以下提示信息
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Message qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
q Congratulations! You now hanve FreeBSD installed on your system.
q We will now move on to the final configuration questions.
q For any option you do not wish to configure,simply select
q NO.
q If you wish to re-enter this utility after the system is up,you
q May do so by trying: /usr/sbin/sysinstall.
------------------------------------------------------------------------------------------(100﹪)---------------
Qqqqqqqqqqqqqqqqqqqqqqqqqqqqq [ OK ] qqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第十九部:系统提问是否配置网络连接(我们选择是)
Qqqqqqqqqqqqqqqqqqqqq User Confiremation Requested qqqqqqqqqqqqqqqqqqqqqqqqqqqq
Q Would you like to configure any Ethernet or SLIP/PPP network devices ?
Q qqqqqqqqqqqqqqqqqqq [ Yes ] No qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第二十部:系统提示对网卡进行设置(如果你是多个网卡,请根据自己的需要进行选择。我选择的是lnc0)
lqqqqqqqqqqqqqq Network interface information required qqqqqqqqqqqqqqqk
x If you are using PPP over a serial device, as opposed to a direct x
x ethernet connection, then you may first need to dial your Internet x
x Service Provider using the ppp utility we provide for that purpose. x
x If you're using SLIP over a serial device then the expectation is x
x that you have a HARDWIRED connection. x
x x
x You can also install over a parallel port using a special "laplink" x
x cable to another machine running FreeBSD. x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x lnc0 Lance/PCnet (Isolan/Novell NE2100/NE32-VL) ethernet x x
x x plip0 <unknown network interface type> x x
x x sl0 SLIP interface on device /dev/cuaa0 (COM1) x x
x x ppp0 PPP interface on device /dev/cuaa0 (COM1) x x
x x sl0 SLIP interface on device /dev/cuaa1 (COM2) x x
x x ppp0 PPP interface on device /dev/cuaa1 (COM2) x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ OK ] Cancel x
mqqqqqqqqqq[ Press F1 to read network configuration manual ]qqqqqqqqqqj
第二十一部:系统提示是否启用IPv6支持(我们选择)No
lqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqk
x Do you want to try IPv6 configuration of the interface? xi
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x Yes [ No ] xq
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqje
第二十二部:系统再次提示我们是否采用DHCP网络(我们选择NO)
lqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqk
x Do you want to try DHCP configuration of the interface? xi
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x Yes [ No ] xq
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqje
第二十三部:系统提示配置主机名IP地址等信息
lqqqqqqqqqqqqqqqqqqqqqqqqqqq Network Configuration qqqqqqqqqqqqk
x Host: Domain: x
x lqqqqqqqqqqqqqqqqqqqqqqqk lqqqqqqqqqqqqqqqqqqk x
x xwww.inter.cn x xinter.cn x x
x mqqqqqqqqqqqqqqqqqqqqqqqj mqqqqqqqqqqqqqqqqqqj x
x IPv4 Gateway: Name server: x
x lqqqqqqqqqqqqqqqqk lqqqqqqqqqqqqqqqqk x
x x192.168.0.1 x x127.0.0.1 x x
x mqqqqqqqqqqqqqqqqj mqqqqqqqqqqqqqqqqj x
x lqqqqq Configuration for Interface lnc0 qqqqqqk x
x x IPv4 Address: Netmask: x x
x x lqqqqqqqqqqqqqqqqk lqqqqqqqqqqqqqqqqk x x
x x x x x x x x
x x mqqqqqqqqqqqqqqqqj mqqqqqqqqqqqqqqqqj x x
x x Extra options to ifconfig (usually empty): x x
x x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x x
x x x x x x
x mqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqqqqqqqj x
x x
x lqqqqqqk lqqqqqqqqqqk x
x x OK x x CANCEL x x
mqqqqqqqqqqqqqqmqqqqqqjqqqqqqqqqqqqmqqqqqqqqqqjqqqqqqqqqqqqqqqqj
第二十四部:系统提示是否现在激活网络设置(我们选择Yes)
lqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqka
x Would you like to bring the lnc0 interface up right now? xm
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqud
x [ Yes ] No xo
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjw
第二十五部:系统提示是否将本机配置成网关服务器(我们选择No)
qqqqqqqqqqqqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqq Do you want this machine to function as network gateway ?
qqqqqqqqqqqqqqqqqqqqq [ Yes ] [ No ]qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第二十六部:系统提示是否对网络服务进行设置,我们选择No(也就是我们常说的系统底层的超级服务器)
qqqqqqqqqqqqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqqqqqqqqqq
qqq Do you want to configure inetd and the network services that it provides ?
qqqqqqqqqqqqqqqqqqqqqqqq [Yes] [No] qqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第二十七部:系统系提示是否启动SSH登录;我们选择Yes,这也是我喜欢的操作方式。
qqqqqqqqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqqqq
qqq Would you like to enable SSH login ?
qqqqqqqqqqqqqqqqqqqqqqq [ Yes ] [ No ] qqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第二十八部:系统提示是否启动匿名FTP(我们选择No)
qqqqqqqqqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqqqqqqqqqq
qq Do you want to have anonymous FTP access to this machine ?
qqqqqqqqqqqqqqqqqqqqqqqqq [Yes] [No] qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第二十九部:系统提示是否启动NFS服务器(我们选择No)
qqqqqqqqqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqqqqqqqqqq
qq Do you want to configure this machine as an NFS server ?
qqqqqqqqqqqqqqqqqqqqqqq [Yes] [No] qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第三十部:系统提示是否定之控制台(我们选择NO)
qqqqqqqqqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqqqqqqqqqq
qqq Would you like to customize your system console settings ?
qqqqqqqqqqqqqqqqqqqqqqq [Yes] [No] qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第三十一部:系统提示是否配置系统的时区(我们选择Yes)
qqqqqqqqqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqqqqqqqqqq
qqq Would you like to set this machine’s time zone now ?
qqqqqqqqqqqqqqqqqqqqqqq [Yes] [No] qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第三十二部:系统提示是否使用CMOS时间做为本地时间(我们选择Yes)
lqqqqqqqqqq Select local or UTC (Greenwich Mean Time) clock qqqqqqqqqqqk
x Is this machine's CMOS clock set to UTC? If it is set to local time,x
x or you don't know, please choose NO here! x
x x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x Yes [ No ] x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第三十三部:选择时区5 Asia
lqqqqqqq Time Zone Selector qqqqqqqqk
x Select a region x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x 1 Africa x x
x x 2 America -- North and South x x
x x 3 Antarctica x x
x x 4 Arctic Ocean x x
x x 5 Asia x x
x x 6 Atlantic Ocean x x
x x 7 Australia x x
x x 8 Europe x x
x x 9 Indian Ocean x x
x x 0 Pacific Ocean x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
三十四部:选择时区所在的国家9 China
lqqqqqqqqqqqqqqq Countries in Asia qqqqqqqqqqqqqqqk
x Select a country or region x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x 1 Afghanistan x x
x x 2 Armenia x x
x x 3 Azerbaijan x x
x x 4 Bahrain x x
x x 5 Bangladesh x x
x x 6 Bhutan x x
x x 7 Brunei Darussalam x x
x x 8 Cambodia x x
x x 9 China x x
x x 10 Cyprus x x
x x 11 Georgia x x
x x 12 Hong Kong x x
x x 13 India x x
x x 14 Indonesia x x
x x 15 Iran x x
x x 16 Iraq x x
x mqv(+)qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第三十五部:选择的所在城市的时区1 east China - Beijing, Guangdong, Shanghai, etc.
lqqqqqqqqqqqqqqqqqqqqqq China Time Zones qqqqqqqqqqqqqqqqqqqqqqk
x Select a zone which observes the same time as your locality. x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x 1 east China - Beijing, Guangdong, Shanghai, etc. x x
x x 2 Heilongjiang x x
x x 3 central China - Gansu, Guizhou, Sichuan, Yunnan, etc. x x
x x 4 Tibet & most of Xinjiang Uyghur x x
x x 5 southwest Xinjiang Uyghur x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第三十六部:确认时区选择是否正确(我们选择Yes)
lqqqqqqqqqqqqqqqqqqqqqqqqqqqq Confirmation qqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Does the abbreviation `CST' look reasonable? x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ Yes ] No x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第三十七部:系统提示是否安装Linux组件支持(我们选择YES因为以后要用到Linux的软件包,或其他的Linux支持)
lqqqqqqqqqqqqqqqqqqqqqqqqqqqq Confirmation qqqqqqqqqqqqqqqqqqqqqqqqqqqqk
qq Would you like to enable linux binary compatibility ?
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ Yes ] No x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第三十八部:系统提示是否启用对ps/2,serial,or bus 鼠标支持(我们选择No)
lqqqqqqqqqqqqqqqqqqqqqqqqqqqq Confirmation qqqqqqqqqqqqqqqqqqqqqqqqqqqqk
qq Does this system have a PS/2 ,serial, or bus mouse ?
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ Yes ] No x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第三十九部:系统提示是否安装游戏(我们选择No)
qqqqqqqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqqqqqq
qq The FreeBSD package collection is a collection of thousands of ready-to-run
qq Applications,from tex editors to games to WEB servers and more. Would you
qq Like to browse the collection now ?
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqq [Yes] [No] qqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第四十部:系统提示是否增加用户和设置root密码(我们选择Yes)
qqqqqqqqqqqqqqqqqqqq User Confirmation Requested qqqqqqqqqqqqqqqqqqqq
Would you like to add any initial user accounts to the system?
Adding at least one account for yourself at this stage is suggested
since working as the “root” user is dangerous (it is easy to do
things which adversely affect the entire system)
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ Yes ] No x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
第四十一部:选择添加用户
lqqqqqqqqqqqqqq User and group management qqqqqqqqqqqqqqk
x The submenus here allow to manipulate user groups and x
x login accounts. x
x x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x X Exit Exit this menu (returning to previous) x x
x x User Add a new user to the system. x x
x x Group Add a new user group to the system. x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x [ OK ] Cancel x
mqqqqqqq[ Configure your user groups and users ]qqqqqqqqj
第四十二部:添加一个wheel组的用户(用于以后的远程维护,这里需要介绍的是FreeBSD默认是不准许root用户远程登录,并且也只有wheel组的用户才能远程登录,并且能su到root)
Login ID:chb
UID:1001
Group:wheel
Password:123
第四十三部:退出用户添加界面,系统提示设置root密码
----------------------------------------------Message-----------------------------------------------------
---Now you must set the system manger’s password
---This is the passworld you’ll use to log in as “root”
-----------------------------------------------------------------------(100﹪)-----------------------------
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqq [OK] qqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
第四十四部:设置root密码
New Password:*************
Retype New Password: *************
第四十五部:系统提示是否查看最后的设置(由于我们每一部做的都很仔细所以这一部对于我们来说是没有必要的,所以选择No)
------------------------------------------------User Confirmation Requested----------------------------------
---Visit the general configuration menu for a chance to set
---Any last options?
----------------------------------------------------------------------------------------------------------------------
---- [Yes] [No ----
----------------------------------------------------------------------------------------------------------------------
第四十六部:退出安装界面,系统提示我们是否将floppies/CDs/DVDs等安装介质取出(我们按照系统的提示取出安装介质)并选择Yes重启系统。
------------------------------------------------User Confirmation Requested----------------------------------
--Are you sure you wish to exit? The system will reboot
--(be usre to remove any floppies/CDs/DVDs from the drives ).
----------------------------------------------------------------------------------------------------------------------
---- [Yes] [No ----
----------------------------------------------------------------------------------------------------------------------
最后需要注意:系统在第一次安装完,进入系统时,由于我们在安装系统时已经启动了ssh远程登陆,系统会提示对ssh key进行确认(只要输入一个回车就搞定),之后我们就可以通过远程连接ssh进入系统了(ssh的默认端口是22 ssh的连接工具建议选用SSH Secure Shell)
FreeBSD全能服务器安装手册之基础设置篇
###################################基本设置#######################################
setenv PACKAGEROOT "ftp://ftp.tw.freebsd.org" (在FreeBSD默认的c shell 使用此种方法)
设置环境变量使pkg_add –r 源代码安装方式选择较快的服务器下载二进制软件安装
pkg_add -r cvsup-without-gui
下载并安装二进制代码程序cvsup-without-gui(cvsup-without-gui无图形支持在文本方式下工作的软件,用来同步代码及ports用。)
编辑/etc/rc.conf
ee /etc/rc.conf
增加以下(用来停止sendmail)
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
mkdir /usr/home/chb/pkg_info
rehash
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_cvsup-without-gui.txt
(主要是记录安装的软件,用来以后分析软件包的关联性)
################################同步系统代码###################################
cvsup -g -L 2 -h cvsup.tw.FreeBSD.org /usr/share/examples/cvsup/standard-supfile
(注意:standard-supfile这个文件同步前一定要查看里面内容是否正确!即:[*default release=cvs tag= ] 默认的情况下可能会把代码同步到当前的最新版本,当然这个最新版本可能是current版!所以一定要指定!
我的写法是:
*default release=cvs tag=RELENG_5_4 意思是同步到FreeBSD5.4的当前稳定版代码
还有就是值得注意的是:
目前同步代码可以选择两个文件
一是:stable-supfile
二是:standard-supfile
stable-supfile 一般已经指定了同步代码的版本,一般也不需要设定!但是用FreeBSD5.2.1的朋友们就需要注意了因为FreeBSD5.2.1会把代码同步到4系的最新版,我一直没明白FreeBSD开发小组为什么会这么做!一旦没有修改就同步的话,轻则造成部分软件无法使用重则造成内核错误根本就无法进入系统!我可亲身经历过
standard-supfile 我认为同步前最好核对一下里面关于同步代码版本的部分。
至于为什么选择standard-supfile而不选择stable-supfile我可是经过N次的重做才确定用standard-supfile
登陆系统后运行uname –v查看系统版本号你会发现
以standard-supfile同步的系统显示的是FreeBSD 5.4-RELEASE-p4 #0: Sat Jul 16 09:29:22 CST 2005 chb@ns1.tjhaina.net:/usr/obj/usr/src/sys/GENERIC
注意这里的5.4-RELEASE-p4用stable-supfile是不会出现p4的!
当然这只是我个人的做法!)
rehash
##############################同步ports软件包##################################
cvsup -g -L 2 -h cvsup.tw.FreeBSD.org /usr/share/examples/cvsup/ports-supfile
rehash
FreeBSD全能服务器安装手册之内核编译篇
################################编译系统内核###################################
进入内核编辑区域
cd /usr/src
多线程支持加快编译速度(注意:cpu的占用率会升高)
make -j4 buildworld
备份原有内核
cd /usr/src/sys/i386/conf
cp GENERIC /root/GENERIC.OLD
编辑内核
ee NS1
建立内核
cd /usr/src
make buildkernel
安装内核
make installkernel
重新启动计算机
shutdown -r now
mergemaster -p
更新系统配置文件。这个命令后会跟随多个提示问题建议仔细阅读后做出选择,如果是安装系统后第一次同步代码,并是在没有安装任何软件的情况下,可以考虑执行mergemaster –ai
“跳过询问信息选择全部更新”
提示如下:
www# mergemaster -p
*** Creating the temporary root environment in /var/tmp/temproot
*** /var/tmp/temproot ready for use
*** Creating and populating directory structure in /var/tmp/temproot
*** Beginning comparison
*** Temp ./etc/master.passwd and installed have the same CVS Id, deleting
*** Temp ./etc/group and installed have the same CVS Id, deleting
*** Comparison complete
Do you wish to delete what is left of /var/tmp/temproot? [no] yes
//我选择了yes删除/var/tmp/temproot
//将会有以下显示结果
*** /var/tmp/temproot has been deleted
grep: /etc/make.conf: No such file or directory
*** Comparing make variables
*** From /etc/make.conf
*** From /usr/src/share/examples/etc/make.conf
更新系统配置文件
cd /usr/src
make installworld
mergemaster
shutdown -r now
删除/usr/obj(以防影响下一次编译内核)
cd /usr/obj
chflags -R noschg *
rm -rf *
FreeBSD全能服务器安装手册之底层软件安装篇
##############################安装perl5.8.X#####################################
Perl介绍
Perl(Practical Extraction and Report Language)是一种脚本语言。 最初的设计者为拉里•沃尔(Larry Wall),它于1987年12月18日发表。Perl借取了C、sed、awk、shell scripting以及很多其他程序语言的特性。
Perl原名pearl。在这个语言官方发表前,拉里•沃尔发现已经有个程序语言“pearl”,便改变将这个程序语言的名字改成Perl。Perl这个名字,出现了一些backronym的建议,包括充满幽默感的“Pathologically Eclectic Rubbish Lister”。今日,“Practical Extraction and Report Language”出现了在很多有关Perl的资料里,包括官方的man pages。它的名字第一个字母大写(Perl)时就指这个程序语言,无大写字母(perl)时就指它的直译器。将Perl写成“PERL”是不适当的,所为它并非一个缩写字。
Perl具有动态语言的强大灵活的特性,并起提供了许多冗余语法,也因此获得了write-only的“美誉”,因为许多Perl程序的代码令人难以阅读。但Perl同样可以将代码书写得像Python等语言一样优雅。
Perl主要应用在Unix平台和网页中(PHP,CGI)。Perl拥有海量的模块支持,在解决问题时非常方便。CPAN是Perl模块的集中营。和C一样,在Perl界,难以读懂的程序码大赛是个有名的活动。近似难以读懂的程序码,但方向不同,Perl Poetry是可以被perl编译的诗。新的诗经通常会在Perl Monks ([url]http://www.perlmonks.org/index.pl?node=Perl%20Poetry[/url])网站发表。另一个Perl hackers的有趣活动是写JAPHs。
##############################################################################################################################################################
cd /usr/ports/lang/perl5.8
make WITH_DEBUGGING=yes /
WITH_GDBM=yes /
WITHOUT_PERL_MALLOC=yes /
WITHOUT_PERL_64BITINT=yes /
WITH_THREADS=yes /
ENABLE_SUIDPERL=yes
(注意:以上命令及参数是按行输入)
make test
make install
make clean
make rmconfig
rehash
perl -v
ps auwx|grep perl
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_perl5.8.txt
###############更改ports软件包的默认下载路径(因为只有安装了perl后才会有/etc/make.conf)#######
ee /etc/make.conf
添加
MASTER_SITE_OVERRIDE= /
[url]ftp://ftp.tw.FreeBSD.org/pub/FreeBSD/ports/distfiles/$[/url]{DIST_SUBDIR} /
[url]ftp://ftp4.tw.FreeBSD.org/pub/FreeBSD/ports/distfiles/$[/url]{DIST_SUBDIR} /
[url]ftp://ftp10.tw.FreeBSD.org/pub/FreeBSD/ports/distfiles/$[/url]{DIST_SUBDIR} /
[url]ftp://ftp13.tw.FreeBSD.org/pub/FreeBSD/ports/distfiles/$[/url]{DIST_SUBDIR} /
[url]ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/ports/distfiles/$[/url]{DIST_SUBDIR} /
[url]ftp://ftp3.jp.FreeBSD.org/pub/FreeBSD/ports/distfiles/$[/url]{DIST_SUBDIR} /
[url]ftp://ftp5.jp.FreeBSD.org/pub/FreeBSD/ports/distfiles/$[/url]{DIST_SUBDIR} /
[url]ftp://ftp.jaist.ac.jp/pub/FreeBSD/ports/distfiles/$[/url]{DIST_SUBDIR} /
[url]ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/$[/url]{DIST_SUBDIR}
(更改ports默认的下载路径,可以根据自己的实际情况进行设置)
rehash
################################安装openssl####################################
OpenSSL简介
OpenSSL项目是共同努力开发出来的一个健全的、商业级的、全开放的和开放源代码的工具包,实现安全套接层协议(SSL v2/v3)和传输层安全协议(TLS v1)以及形成一个功效完整的通用目的的加密技术库。该项目是由全世界范围内团体的志愿者管理着,他们使用因特网进行交流、策划和开发这个OpenSSL工具和相关的文档。
OpenSSL基于Eric A. Young 和 Tim J. Hudson开发的优秀的SSLeay库([url]http://www.columbia.edu/~ariel/ssleay/[/url])。OpenSSL工具包使用许可类似Apache,这意味着任何人在服从一些简单的许可协议下,可以免费的获取并且应用于商业、非商业目的。
##############################################################################################################################################################cd /usr/ports/security/openssl
make
make install
make clean
make rmconfig
rehash
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_openssl.txt
#################################安装web管理系统##############################
WEBMIN介绍
“Webmin 是一个基于 Web 的 Unix 系统管理界面。借助任何支持表格和表单的浏览器(和 File Manager 模块所需要的 Java),您就可以设置用户帐号、Apache、DNS、文件共享,等等。Webmin 包括一个简单的 Web 服务器和许多 CGI 程序,这些程序可以直接修改系统文件,比如 /etc/inetd.conf 和 /etc/passwd。Web 服务器和所有的 CGI 程序都是用 Perl 5 编写的,没有使用任何非标准 Perl 模块。”
Webmin 事实上可以运行于所有的类 Unix 平台,包括 Linux、AIX、HPUX、Solaris、OS X,等等。它具有一个 Web 前端,可以完成 Linux 中的诸多管理任务。它可以以本地方式或者远程方式运行于任意图形化浏览器中。Webmin 使用 SSL 来保证安全,防止侦听。当您学习 Linux 管理时,Webmin 将为您节省很多时间。Webmin 还可以帮您完成那些还不能自动执行的繁琐的任务。Webmin 是可扩展的。作者提供了一个开发向导,而且已经出现了一些第三方的模块。您也可以设计您自己的模块,以使 Webmin 永远可以按您的需要进行调整。
##############################################################################################################################################################
cd /usr/ports/sysutils/webmin
make
make install
make clean
make rmconfig
配置webmin(用户名、密码、端口等)
/usr/local/lib/webmin/setup.sh
启动webmin
/usr/local/etc/webmin/start
测试webmin
https://计算机名:端口号
或
[url]https://192.168.0.118:10000/[/url]
使webmin同系统一起启动
ee /etc/rc.conf
添加
webmin_enable="YES"
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_webmin.txt
###############################安装expat2#####################################
cd /usr/ports/textproc/expat2
make
make install
make clean
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_expat2.txt
FreeBSD全能服务器安装手册之数据库安装篇
#################################安装数据库mysql4.0############################
MySQL介绍
MySQL是一个开放源码的小型关系型数据库管理系统,开发者为MySQL AB公司。目前MySQL被广泛地应用在Internet上的中小型网站中。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,许多中小型网站为了降低网站总体拥有成本而选择了MySQL作为网站数据库。
MySQL的特性
使用C和C++编写,并使用了多种编译器进行测试,保证源代码的可移植性
支持AIX、FreeBSD、HP-UX、Linux、Mac OS、Novell Netware、OpenBSD、OS/2 Wrap、Solaris、Windows等多种操作系统
为多种编程语言提供了API。这些编程语言包括C、C++、Eiffel、Java、Perl、PHP、Python、Ruby和Tcl等。
支持多线程,充分利用CPU资源
优化的SQL查询算法,有效地提高查询速度
既能够作为一个单独的应用程序应用在客户端服务器网络环境中,也能够作为一个库而嵌入到其他的软件中
提供多语言支持,常见的编码如中文的GB2312、GB18030、BIG5,日文的SJIS等都可以用作数据表名和数据列名
提供TCP/IP、ODBC和JDBC等多种数据库连接途径
提供用于管理、检查、优化数据库操作的管理工具
可以处理拥有上千万条记录的大型数据库
MySQL的应用
与其他的大型数据库例如Oracle、DB2、SQL Server等相比,MySQL自有它的不足之处,如规模小、功能有限(MySQL不支持视图(已经被列入5.1版的开发计划)、存储过程、事件等)等,但是这丝毫也没有减少它受欢迎的程度。对于一般的个人使用者和中小型企业来说,MySQL提供的功能已经绰绰有余,而且由于MySQL是开放源码软件,因此可以大大降低总体拥有成本。
目前Internet上流行的网站构架方式是LAMP(Linux+Apache+MySQL+PHP),即使用Linux作为操作系统,Apache作为Web服务器,MySQL作为数据库,PHP作为服务器端脚本解释器。由于这四个软件都是遵循GPL的开放源码软件,因此使用这种方式不用花一分钱就可以建立起一个稳定、免费的网站系统。
MySql管理
可以使用命令行工具管理MySQL 数据库(命令mysql 和 mysqladmin),你也可以从MySQL 的网站下载图形管理工具MySQL Administrator ([url]http://www.mysql.com/products/administrator[/url]) 和 MySQL Query Browser ([url]http://www.mysql.com/products/query-browser[/url]).
phpMyAdmin是由php写成的,很流行的开源web程序。
hpMyBackupPro, 也是由PHP写成的,可以创建和管理数据库。它可以创建伪cronjobs,可以用来自动在某个时间或周期备份MySQL 数据库
##############################################################################################################################################################
cd /usr/ports/databases/mysql40-server
make WITH_CHARSET=gbk /
WITH_XCHARSET=all /
SKIP_DNS_CHECK=yes /
BUILD_OPTIMIZED=yes /
BUILD_STATIC=yes
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_mysql40-server.txt
%%%%%%%%%%%%安装mysql40组件%%%%%%%%%%%%%%
cd /usr/ports/databases/p5-DBD-mysql40
make
make install
make clean
make rmconfig
%%%%%%%%%%%使mysql40和系统一起启动%%%%%%%%%%%
ee /etc/rc.conf
mysql_enable="YES"
%%%%%%%%%%启动mysql40%%%%%%%%%%%%%%%%%%%
/usr/local/etc/rc.d/mysql-server.sh start
%%%%%%%%%%%设置mysql40的密码%%%%%%%%%%%%%%
/usr/local/bin/mysqladmin -u root password 'password'
%%%%%%%%%%%测试数据库登陆%%%%%%%%%%%%%%%%
mysql -u root -ppassword
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_mysql40.txt
FreeBSD全能服务器安装手册之底层服务器篇
###############################安装web服务器apache1.33######################
APACHE介绍
Apache是一个历史悠久并且功能十分强大的WEB服务器,但其丰富的功能对于一个新手来说往往不知道从何下手。我个人感觉Apache的设计充分体现了模块化设计的优势,通过在动态模块加载(DSO)模式下的安装,任何子应用模块都可以通过配置文件的简单修改进行积木式的灵活配置。安装的过程可以从简单的静态html服务开始,一个模块一个模块的学习使用。从单纯的HTML静态服务(core),到复杂的动态页面服务(core + php, core + resin, core + php + mod_gzip, core + resin + mod_expire)。
##############################################################################################################################################################
cd /usr/ports/www/apache13
make
make install
make clean
%%%%%%%%%%%使apache和系统一起启动%%%%%%%%%%%
ee /etc/rc.conf
添加
apache_enable="YES"
%%%%%%%%%%%%更改apache的相应设置%%%%%%%%%%%
ee /usr/local/etc/apache/httpd.conf
change 330
ServerAdmin you@your.address ==>ServerAdmin b.s.d@163.com
change 348
#ServerName www.example.com==>ServerName www.tjhaina.net
添加 794
AddLanguage zh-cn .zh-cn
添加 822
AddCharset GB2312 .gb2312
添加 976
NameVirtualHost 192.168.0.205 (your hosts ip)
%%%%%%%%%%%%启动apache%%%%%%%%%%%%%%%%%
/usr/local/sbin/apachectl start
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_apache.txt
####################################安装php###################################
PHP介绍
PHP 的全名就蛮有趣的,它是一个递归的缩写名称,"PHP: Hypertext Preprocessor",打开缩写还是缩写。PHP 是一种 HTML 内嵌式的语言 (类似 IIS 上的 ASP)。而 PHP 独特的语法混合了 C、Java、Perl 以及 PHP 式的新语法。它可以比 CGI 或者 Perl 更快速的执行动态网页。
PHP 最初是在公元 1994 年 Rasmus Lerdorf 开始计划发展。在 1995 年以 Personal Home Page Tools (PHP Tools) 开始对外发表第一个版本。在这早期的版本中,提供了访客留言本、访客计数器等简单的功能。随后在新的成员加入开发行列之后,在 1995 年中,第二版的 PHP 问市。第二版定名为 PHP/FI(Form Interpreter)。PHP/FI 并加入了 mSQL 的支持,自此奠定了 PHP 在动态网页开发上的影响力。在 1996 年底,有一万五千个 Web 网站使用 PHP/FI;在 1997 年中,使用 PHP/FI 的 Web 网站成长到超过五万个。而在 1997 年中,开始了第三版的开发计划,开发小组加入了 Zeev Suraski 及 Andi Gutmans,而第三版就定名为 PHP3。
PHP3 跟 Apache 服务器紧密结合的特性;加上它不断的更新及加入新的功能;并且它几乎支持所有主流与非主流数据库;再以它能高速的执行效率,使得 PHP 在 1999 年中的使用网站超过了十五万!!它的源代码完全公开,在 Open Source 意识抬头的今天,它更是这方面的中流砥柱。不断地有新的函数库加入,以及不停地更新的活力,使得 PHP 无论在 UNIX 或是 Win32 的平台上都可以有更多新的功能。它提供丰富的函数,使得在程序设计方面有着更好的支持。
PHP 的第四代 Zend 核心引擎已经进入测试阶段。整个脚本程序的核心大幅改动,让程序的执行速度,满足更快的要求。在最佳化之后的效率,已较传统 CGI 或者 ASP 等程序有更好的表现。而且还有更强的新功能、更丰富的函数库。无论您接不接受,PHP 都将在 Web CGI 的领域上,掀起巅覆性的革命。对于一位专职 Web Master 而言,它将也是必修课程之一。
##############################################################################################################################################################
cd /usr/ports/lang/php4
make
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Options for php4 4.4.2_1 x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x [X] DEBUG Enable debug x x
x x [X] MULTIBYTE Enable zend multibyte support x x
x x [X] IPV6 Enable ipv6 support x x
x x [X] OPENSSL Build static OpenSSL extension x x
x x x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_php4.txt
###################################安装php扩展################################
cd /usr/ports/lang/php4-extensions
make (+ bz2)
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Options for php4-extensions 1.0 x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x [ ] BCMATH bc style precision math functions x x
x x [ ] BZ2 bzip2 library support x x
x x [ ] CALENDAR calendar conversion support x x
x x [ ] CRACK crack support x x
x x [X] CTYPE ctype functions x x
x x [ ] CURL CURL support x x
x x [ ] DBA dba support x x
x x [ ] DBASE dBase library support x x
x x [ ] DBX dbx support x x
x x [ ] DIO Direct I/O support x x
x x [ ] DOMXML DOM support x x
x x [ ] EXIF EXIF support x x
x x [ ] FILEINFO fileinfo support x x
x x [ ] FILEPRO filePro support x x
x x [ ] FRIBIDI FriBidi support x x
x x [ ] FTP FTP support x x
x x [ ] GD GD library support x x
x x [ ] GETTEXT gettext library support x x
x x [ ] GMP GNU MP support x x
x x [ ] ICONV iconv support x x
x x [ ] IMAGICK ImageMagick support x x
x x [ ] IMAP IMAP support x x
x x [ ] INTERBASE Interbase 6 database support (Firebird) x x
x x [ ] LDAP OpenLDAP support x x
x x [ ] MBSTRING multibyte string support x x
x x [ ] MCAL Modular Calendar Access Library support x x
x x [ ] MCRYPT Encryption support x x
x x [ ] MCVE MCVE support x x
x x [ ] MHASH Crypto-hashing support x x
x x [ ] MING ming shockwave flash support x x
x x [ ] MNOGOSEARCH mnoGoSearch support x x
x x [ ] MSSQL MS-SQL database support x x
x x [X] MYSQL MySQL database support x x
x x [ ] NCURSES ncurses support (CLI only) x x
x x [ ] ODBC unixODBC support x x
x x [ ] OPENSSL OpenSSL support x x
x x [ ] ORACLE Oracle support x x
x x [X] OVERLOAD user-space object overloading support x x
x x [ ] PANDA panda support x x
x x [ ] PCNTL pcntl support (CLI only) x x
x x [X] PCRE Perl Compatible Regular Expression support x x
x x [ ] PDF PDFlib support (implies GD) x x
x x [ ] PFPRO PayFlow Pro support x x
x x [ ] PGSQL PostgreSQL database support x x
x x [X] POSIX POSIX-like functions x x
x x [ ] PSPELL pspell support x x
x x [ ] READLINE readline support (CLI only) x x
x x [ ] RECODE recode support x x
x x [X] SESSION session support x x
x x [ ] SHMOP shmop support x x
x x [ ] SNMP SNMP support x x
x x [ ] SOCKETS sockets support x x
x x [ ] SYBASE_CT Sybase database support x x
x x [ ] SYSVMSG System V message support x x
x x [ ] SYSVSEM System V semaphore support x x
x x [ ] SYSVSHM System V shared memory support x x
x x [X] TOKENIZER tokenizer support x x
x x [ ] WDDX WDDX support (implies XML) x x
x x [X] XML XML support x x
x x [ ] XMLRPC XMLRPC-EPI support x x
x x [ ] XSLT XSLT Sablotron support x x
x x [ ] YAZ YAZ support (ANSI/NISO Z39.50) x x
x x [ ] YP YP/NIS support x x
x x [ ] ZIP ZIP support x x
x x [X] ZLIB ZLIB support x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
make install
make clean
make rmconfig
cd /usr/local/etc
cp php.ini-dist php.ini
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_php4-extensions.txt
########################安装phpSysInfo基于php的系统监测#######################
PhpSysInfo简介
简介:PhpSysInfo是用php脚本编写的,能显示关于主机硬件及当前状态的信息。包括运行时间,CPU,内存,SCSI,IDE,PCI,网卡,软驱和显卡等各方面的信息。并且它还可以自定义语言和界面风格等相关内容。是基于web的查看界面。
##############################################################################################################################################################
cd /usr/ports/www/phpSysInfo/
make
make install
make clean
cd /usr/local/www/data/phpSysInfo/
cp config.php.new config.php
chown www:www config.php
(改变config.php的所属组和用户)
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_phpSysInfo.txt
%%%%%%%%%%%%%%%%%测试phpSysInfo%%%%%%%%%%%%%%%%%
[url]http://192.168.0.118/phpSysInfo/index.php[/url]
####################安装phpmyadmin基于php的数据库web管理系统##################
phpMyAdmin是一个用PHP编写的,可以通过互联网控制和操作MySQL。通过phpMyAdmin可以完全对数据库进行操作,例如建立、复制/删除数据等等。
##############################################################################################################################################################
cd /usr/ports/databases/phpmyadmin/
make
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Options for phpMyAdmin 2.8.0.2 x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x [X] BZ2 bzip2 library support x x
x x [X] GD GD library support x x
x x [ ] MYSQLI Improved MySQL support x x
x x [X] OPENSSL OpenSSL support x x
x x [X] PDF PDFlib support (implies GD) x x
x x [X] ZLIB ZLIB support x x
x x [X] MCRYPT MCrypt library support x x
x x [X] MBSTRING Multi-byte character-set string support x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
make install
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Options for php4-gd 4.4.2_1 x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x [X] T1LIB Include T1lib support x x
x x [X] TRUETYPE Enable TrueType string function x x
x x [ ] JIS Enable JIS-mapped Japanese font support x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
x [ OK ] Cancel x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
make clean
make rmconfig
%%%%%%%%%%%%%更改phpMyAdmin的配置%%%%%%%%%%%%
cd /usr/local/www/phpMyAdmin
chmod 755 config.inc.php
ee /usr/local/www/phpMyAdmin/config.inc.php
将84行
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
改成
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
[#将39行
#$cfg['PmaAbsoluteUri'] = ' ';
#改成
#$cfg['PmaAbsoluteUri'] = 'http://192.168.0.205/phpMyAdmin/';
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_phpmyadmin.txt ]
(我现在不建议更改39行的内容虽然phpMyAdmin提示更改!但并没有发现39行对phpMyAdmin的运行有影响!改不好反而使phpMyAdmin不能正常显示)
<?php
/* $Id: config.inc.php,v 2.53 2005/06/07 16:44:39 lem9 Exp $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* phpMyAdmin Configuration File
*
* All directives are explained in Documentation.html
*/
/**
* Sets the php error reporting - Please do not change this line!
*/
if (!isset($old_error_reporting)) {
error_reporting(E_ALL);
@ini_set('display_errors', '1');
}
/**
* Your phpMyAdmin url
*
* Complete the variable below with the full url ie
* [url]http://www.your_web.net/path_to_your_phpMyAdmin_directory/[/url]
*
* It must contain characters that are valid for a URL, and the path is
* case sensitive on some Web servers, for example Unix-based servers.
*
* In most cases you can leave this variable empty, as the correct value
* will be detected automatically. However, we recommend that you do
* test to see that the auto-detection code works in your system. A good
* test is to browse a table, then edit a row and save it. There will be
* an error message if phpMyAdmin cannot auto-detect the correct value.
*
* If the auto-detection code does work properly, you can set to TRUE the
* $cfg['PmaAbsoluteUri_DisableWarning'] variable below.
*/
$cfg['PmaAbsoluteUri'] = '';
/**
* Disable the default warning about $cfg['PmaAbsoluteUri'] not being set
* You should use this if and ONLY if the PmaAbsoluteUri auto-detection
* works perfectly.
*/
$cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;
/**
* Disable the default warning that is displayed on the DB Details Structure page if
* any of the required Tables for the relationfeatures could not be found
*/
$cfg['PmaNoRelation_DisableWarning'] = FALSE;
/**
* The 'cookie' auth_type uses blowfish algorithm to encrypt the password. If
* at least one server configuration uses 'cookie' auth_type, enter here a
* passphrase that will be used by blowfish. The maximum length seems to be 46
* characters.
*/
$cfg['blowfish_secret'] = '';
/**
* Server(s) configuration
*/
$i = 0;
// The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
// and "mysql/db" tables).
// The controluser is also
// used for all relational
// features (pmadb)
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
// with 'config' auth_type)
$cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only
// this db is displayed in left frame
// It may also be an array of db-names, where sorting order is relevant.
$cfg['Servers'][$i]['verbose'] = ''; // Verbose name for this host - leave blank to show the hostname
$cfg['Servers'][$i]['pmadb'] = ''; // Database used for Relation, Bookmark and PDF Features
// (see scripts/create_tables.sql)
// - leave blank for no support
// DEFAULT: 'phpmyadmin'
$cfg['Servers'][$i]['bookmarktable'] = ''; // Bookmark table
// - leave blank for no bookmark support
// DEFAULT: 'pma_bookmark'
$cfg['Servers'][$i]['relation'] = ''; // table to describe the relation between links (see doc)
// - leave blank for no relation-links support
// DEFAULT: 'pma_relation'
$cfg['Servers'][$i]['table_info'] = ''; // table to describe the display fields
// - leave blank for no display fields support
// DEFAULT: 'pma_table_info'
$cfg['Servers'][$i]['table_coords'] = ''; // table to describe the tables position for the PDF schema
// - leave blank for no PDF schema support
// DEFAULT: 'pma_table_coords'
$cfg['Servers'][$i]['pdf_pages'] = ''; // table to describe pages of relationpdf
// - leave blank if you don't want to use this
// DEFAULT: 'pma_pdf_pages'
$cfg['Servers'][$i]['column_info'] = ''; // table to store column information
// - leave blank for no column comments/mime types
// DEFAULT: 'pma_column_info'
$cfg['Servers'][$i]['history'] = ''; // table to store SQL history
// - leave blank for no SQL query history
// DEFAULT: 'pma_history'
$cfg['Servers'][$i]['verbose_check'] = TRUE; // set to FALSE if you know that your pma_* tables
// are up to date. This prevents compatibility
// checks and thereby increases performance.
$cfg['Servers'][$i]['AllowRoot'] = TRUE; // whether to allow root login
$cfg['Servers'][$i]['AllowDeny']['order'] // Host authentication order, leave blank to not use
= '';
$cfg['Servers'][$i]['AllowDeny']['rules'] // Host authentication rules, leave blank for defaults
= array();
$i++;
$cfg['Servers'][$i]['host'] = '';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['controluser'] = '';
$cfg['Servers'][$i]['controlpass'] = '';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['only_db'] = '';
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['pmadb'] = ''; // 'phpmyadmin' - see scripts/create_tables.sql
$cfg['Servers'][$i]['bookmarktable'] = ''; // 'pma_bookmark'
$cfg['Servers'][$i]['relation'] = ''; // 'pma_relation'
$cfg['Servers'][$i]['table_info'] = ''; // 'pma_table_info'
$cfg['Servers'][$i]['table_coords'] = ''; // 'pma_table_coords'
$cfg['Servers'][$i]['pdf_pages'] = ''; // 'pma_pdf_pages'
$cfg['Servers'][$i]['column_info'] = ''; // 'pma_column_info'
$cfg['Servers'][$i]['history'] = ''; // 'pma_history'
$cfg['Servers'][$i]['verbose_check'] = TRUE;
$cfg['Servers'][$i]['AllowRoot'] = TRUE;
$cfg['Servers'][$i]['AllowDeny']['order']
= '';
$cfg['Servers'][$i]['AllowDeny']['rules']
= array();
$i++;
$cfg['Servers'][$i]['host'] = '';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['controluser'] = '';
$cfg['Servers'][$i]['controlpass'] = '';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['only_db'] = '';
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['pmadb'] = ''; // 'phpmyadmin' - see scripts/create_tables.sql
$cfg['Servers'][$i]['bookmarktable'] = ''; // 'pma_bookmark'
$cfg['Servers'][$i]['relation'] = ''; // 'pma_relation'
$cfg['Servers'][$i]['table_info'] = ''; // 'pma_table_info'
$cfg['Servers'][$i]['table_coords'] = ''; // 'pma_table_coords'
$cfg['Servers'][$i]['pdf_pages'] = ''; // 'pma_pdf_pages'
$cfg['Servers'][$i]['column_info'] = ''; // 'pma_column_info'
$cfg['Servers'][$i]['history'] = ''; // 'pma_history'
$cfg['Servers'][$i]['verbose_check'] = TRUE;
$cfg['Servers'][$i]['AllowRoot'] = TRUE;
$cfg['Servers'][$i]['AllowDeny']['order']
= '';
$cfg['Servers'][$i]['AllowDeny']['rules']
= array();
// If you have more than one server configured, you can set $cfg['ServerDefault']
// to any one of them to autoconnect to that server when phpMyAdmin is started,
// or set it to 0 to be given a list of servers without logging in
// If you have only one server configured, $cfg['ServerDefault'] *MUST* be
// set to that server.
$cfg['ServerDefault'] = 1; // Default server (0 = no default server)
$cfg['Server'] = '';
unset($cfg['Servers'][0]);
/**
* Other core phpMyAdmin settings
*/
$cfg['OBGzip'] = 'auto'; // use GZIP output buffering if possible (TRUE|FALSE|'auto')
$cfg['PersistentConnections'] = FALSE; // use persistent connections to MySQL database
$cfg['ExecTimeLimit'] = 300; // maximum execution time in seconds (0 for no limit)
$cfg['SkipLockedTables'] = FALSE; // mark used tables, make possible to show
// locked tables (since MySQL 3.23.30)
$cfg['ShowSQL'] = TRUE; // show SQL queries as run
$cfg['AllowUserDropDatabase'] = FALSE; // show a 'Drop database' link to normal users
$cfg['Confirm'] = TRUE; // confirm 'DROP TABLE' & 'DROP DATABASE'
$cfg['LoginCookieRecall'] = TRUE; // recall previous login in cookie auth. mode or not
$cfg['LoginCookieValidity'] = 1800; // validity of cookie login (in seconds)
$cfg['UseDbSearch'] = TRUE; // whether to enable the "database search" feature
// or not
$cfg['IgnoreMultiSubmitErrors'] = FALSE; // if set to true, PMA continues computing multiple-statement queries
// even if one of the queries failed
$cfg['VerboseMultiSubmit'] = TRUE; // if set to true, PMA will show the affected rows of EACH statement on
// multiple-statement queries. See the read_dump.php file for hardcoded
// defaults on how many queries a statement may contain!
$cfg['AllowArbitraryServer'] = FALSE; // allow login to any user entered server in cookie based auth
// Left frame setup
$cfg['LeftFrameLight'] = TRUE; // use a select-based menu and display only the
// current tables in the left frame.
$cfg['LeftFrameTableSeparator']= '__'; // Which string will be used to generate table prefixes
// to split/nest tables into multiple categories
$cfg['LeftFrameTableLevel'] = '1'; // How many sublevels should be displayed when splitting
// up tables by the above Separator
$cfg['ShowTooltip'] = TRUE; // display table comment as tooltip in left frame
$cfg['ShowTooltipAliasDB'] = FALSE; // if ShowToolTip is enabled, this defines that table/db comments
$cfg['ShowTooltipAliasTB'] = FALSE; // are shown (in the left menu and db_details_structure) instead of
// table/db names. Setting ShowTooltipAliasTB to 'nested' will only
// use the Aliases for nested descriptors, not the table itself.
$cfg['LeftDisplayLogo'] = TRUE; // display logo at top of left frame
$cfg['LeftDisplayServers'] = FALSE; // display server choice at top of left frame
$cfg['DisplayServersList'] = FALSE; // server choice as links
// In the main frame, at startup...
$cfg['ShowStats'] = TRUE; // allow to display statistics and space usage in
// the pages about database details and table
// properties
$cfg['ShowMysqlInfo'] = FALSE; // whether to display the "MySQL runtime
$cfg['ShowMysqlVars'] = FALSE; // information", "MySQL system variables", "PHP
$cfg['ShowPhpInfo'] = FALSE; // information" and "change password" links for
$cfg['ShowChgPassword'] = FALSE; // simple users or not
$cfg['SuggestDBName'] = TRUE; // suggest a new DB name if possible (false = keep empty)
// In browse mode...
$cfg['ShowBlob'] = FALSE; // display blob field contents
$cfg['NavigationBarIconic'] = TRUE; // do not display text inside navigation bar buttons
$cfg['ShowAll'] = FALSE; // allows to display all the rows
$cfg['MaxRows'] = 30; // maximum number of rows to display
$cfg['Order'] = 'ASC'; // default for 'ORDER BY' clause (valid
// values are 'ASC', 'DESC' or 'SMART' -ie
// descending order for fields of type
// TIME, DATE, DATETIME & TIMESTAMP,
// ascending order else-)
// In edit mode...
$cfg['ProtectBinary'] = 'blob'; // disallow editing of binary fields
// valid values are:
// FALSE allow editing
// 'blob' allow editing except for BLOB fields
// 'all' disallow editing
$cfg['ShowFunctionFields'] = TRUE; // Display the function fields in edit/insert mode
$cfg['CharEditing'] = 'input';
// Which editor should be used for CHAR/VARCHAR fields:
// input - allows limiting of input length
// textarea - allows newlines in fields
$cfg['InsertRows'] = 2; // How many rows can be inserted at one time
// For the export features...
$cfg['ZipDump'] = TRUE; // Allow the use of zip/gzip/bzip
$cfg['GZipDump'] = TRUE; // compression for
$cfg['BZipDump'] = TRUE; // dump files
$cfg['CompressOnFly'] = TRUE; // Will compress gzip/bzip2 exports on
// fly without need for much memory.
// If you encounter problems with
// created gzip/bzip2 files disable
// this feature.
// Tabs display settings
$cfg['LightTabs'] = FALSE; // use graphically less intense menu tabs
$cfg['PropertiesIconic'] = TRUE; // Use icons instead of text for the table display of a database (TRUE|FALSE|'both')
$cfg['PropertiesNumColumns'] = 1; // How many columns should be used for table display of a database?
// (a value larger than 1 results in some information being hidden)
$cfg['DefaultTabServer'] = 'main.php';
// Possible values:
// 'main.php' = the welcome page
// (recommended for multiuser setups)
// 'server_databases.php' = list of databases
// 'server_status.php' = runtime information
// 'server_variables.php' = MySQL server variables
// 'server_privileges.php' = user management
// 'server_processlist.php' = process list
$cfg['DefaultTabDatabase'] = 'db_details_structure.php';
// Possible values:
// 'db_details_structure.php' = tables list
// 'db_details.php' = sql form
// 'db_search.php' = search query
// 'db_operations.php' = operations on database
$cfg['DefaultTabTable'] = 'tbl_properties_structure.php';
// Possible values:
// 'tbl_properties_structure.php' = fields list
// 'tbl_properties.php' = sql form
// 'tbl_select.php = select page
// 'tbl_change.php = insert row page
/**
* Export defaults
*/
$cfg['Export']['format'] = 'sql'; // sql/latex/excel/csv/xml/xls/htmlexcel/htmlword
$cfg['Export']['compression'] = 'none'; // none/zip/gzip/bzip2
$cfg['Export']['asfile'] = FALSE;
$cfg['Export']['onserver'] = FALSE;
$cfg['Export']['onserver_overwrite'] = FALSE;
$cfg['Export']['remember_file_template'] = TRUE;
$cfg['Export']['htmlexcel_columns'] = FALSE;
$cfg['Export']['htmlexcel_null'] = 'NULL';
$cfg['Export']['htmlword_structure'] = TRUE;
$cfg['Export']['htmlword_data'] = TRUE;
$cfg['Export']['htmlword_columns'] = FALSE;
$cfg['Export']['htmlword_null'] = 'NULL';
$cfg['Export']['xls_columns'] = FALSE;
$cfg['Export']['xls_null'] = 'NULL';
$cfg['Export']['csv_columns'] = FALSE;
$cfg['Export']['csv_null'] = 'NULL';
$cfg['Export']['csv_separator'] = ';';
$cfg['Export']['csv_enclosed'] = '"';
$cfg['Export']['csv_escaped'] = '//';
$cfg['Export']['csv_terminated'] = 'AUTO';
$cfg['Export']['excel_columns'] = FALSE;
$cfg['Export']['excel_null'] = 'NULL';
$cfg['Export']['excel_edition'] = 'win'; // win/mac
$cfg['Export']['latex_structure'] = TRUE;
$cfg['Export']['latex_data'] = TRUE;
$cfg['Export']['latex_columns'] = TRUE;
$cfg['Export']['latex_relation'] = TRUE;
$cfg['Export']['latex_comments'] = TRUE;
$cfg['Export']['latex_mime'] = TRUE;
$cfg['Export']['latex_null'] = '/textit{NULL}';
$cfg['Export']['latex_caption'] = TRUE;
$cfg['Export']['latex_data_label'] = 'tab:__TABLE__-data';
$cfg['Export']['latex_structure_label'] = 'tab:__TABLE__-structure';
$cfg['Export']['sql_structure'] = TRUE;
$cfg['Export']['sql_data'] = TRUE;
$cfg['Export']['sql_compat'] = 'NONE';
$cfg['Export']['sql_disable_fk'] = FALSE;
$cfg['Export']['sql_use_transaction'] = FALSE;
$cfg['Export']['sql_drop_database'] = FALSE;
$cfg['Export']['sql_drop_table'] = FALSE;
$cfg['Export']['sql_if_not_exists'] = FALSE;
$cfg['Export']['sql_auto_increment'] = TRUE;
$cfg['Export']['sql_backquotes'] = TRUE;
$cfg['Export']['sql_dates'] = FALSE;
$cfg['Export']['sql_relation'] = FALSE;
$cfg['Export']['sql_columns'] = FALSE;
$cfg['Export']['sql_delayed'] = FALSE;
$cfg['Export']['sql_ignore'] = FALSE;
$cfg['Export']['sql_hex_for_binary'] = TRUE;
$cfg['Export']['sql_type'] = 'insert'; // insert/update/replace
$cfg['Export']['sql_extended'] = FALSE;
$cfg['Export']['sql_comments'] = FALSE;
$cfg['Export']['sql_mime'] = FALSE;
$cfg['Export']['sql_header_comment'] = ''; // /n is replaced by new line
/**
* Link to the official MySQL documentation.
* Be sure to include no trailing slash on the path.
* See [url]http://dev.mysql.com/doc/[/url] for more information
* about MySQL manuals and their types.
*/
$cfg['MySQLManualBase'] = 'http://dev.mysql.com/doc/mysql/en';
/**
* Type of MySQL documentation:
* old - old style used in phpMyAdmin 2.3.0 and sooner
* searchable - "Searchable, with user comments"
* chapters - "HTML, one page per chapter"
* big - "HTML, all on one page"
* none - do not show documentation links
*/
$cfg['MySQLManualType'] = 'searchable';
/**
* PDF options
*/
$cfg['PDFPageSizes'] = array('A3', 'A4', 'A5', 'letter', 'legal');
$cfg['PDFDefaultPageSize'] = 'A4';
/**
* Language and charset conversion settings
*/
// Default language to use, if not browser-defined or user-defined
$cfg['DefaultLang'] = 'en-iso-8859-1';
// Force: always use this language - must be defined in
// libraries/select_lang.lib.php
// $cfg['Lang'] = 'en-iso-8859-1';
// Default charset to use for recoding of MySQL queries, does not take
// any effect when charsets recoding is switched off by
// $cfg['AllowAnywhereRecoding'] or in language file
// (see $cfg['AvailableCharsets'] to possible choices, you can add your own)
$cfg['DefaultCharset'] = 'iso-8859-1';
// Allow charset recoding of MySQL queries, must be also enabled in language
// file to make harder using other language files than unicode.
// Default value is FALSE to avoid problems on servers without the iconv
// extension and where dl() is not supported
$cfg['AllowAnywhereRecoding'] = FALSE;
// You can select here which functions will be used for charset conversion.
// Possible values are:
// auto - automatically use available one (first is tested iconv, then
// recode)
// iconv - use iconv or libiconv functions
// recode - use recode_string function
$cfg['RecodingEngine'] = 'auto';
// Specify some parameters for iconv used in charset conversion. See iconv
// documentation for details:
// [url]http://www.gnu.org/software/libiconv/documentation/libiconv/iconv_open.3.html[/url]
$cfg['IconvExtraParams'] = '';
// Available charsets for MySQL conversion. currently contains all which could
// be found in lang/* files and few more.
// Charsets will be shown in same order as here listed, so if you frequently
// use some of these move them to the top.
$cfg['AvailableCharsets'] = array(
'iso-8859-1',
'iso-8859-2',
'iso-8859-3',
'iso-8859-4',
'iso-8859-5',
'iso-8859-6',
'iso-8859-7',
'iso-8859-8',
'iso-8859-9',
'iso-8859-10',
'iso-8859-11',
'iso-8859-12',
'iso-8859-13',
'iso-8859-14',
'iso-8859-15',
'windows-1250',
'windows-1251',
'windows-1252',
'windows-1256',
'windows-1257',
'koi8-r',
'big5',
'gb2312',
'utf-8',
'utf-7',
'x-user-defined',
'euc-jp',
'ks_c_5601-1987',
'tis-620',
'SHIFT_JIS'
);
/**
* Customization & design
*
* The graphical settings are now located in themes/themename/layout.inc.php
*/
$cfg['LeftPointerEnable'] = TRUE; // enable the left panel pointer
// (used when LeftFrameLight is FALSE)
// see also LeftPointerColor
// in layout.inc.php
$cfg['BrowsePointerEnable'] = TRUE; // enable the browse pointer
// see also BrowsePointerColor
// in layout.inc.php
$cfg['BrowseMarkerEnable'] = TRUE; // enable the browse marker
// see also BrowseMarkerColor
// in layout.inc.php
$cfg['TextareaCols'] = 40; // textarea size (columns) in edit mode
// (this value will be emphasized (*2) for sql
// query textareas and (*1.25) for query window)
$cfg['TextareaRows'] = 7; // textarea size (rows) in edit mode
$cfg['LongtextDoubleTextarea'] = TRUE; // double size of textarea size for longtext fields
$cfg['TextareaAutoSelect'] = TRUE; // autoselect when clicking in the textarea of the querybox
$cfg['CharTextareaCols'] = 40; // textarea size (columns) for CHAR/VARCHAR
$cfg['CharTextareaRows'] = 2; // textarea size (rows) for CHAR/VARCHAR
$cfg['CtrlArrowsMoving'] = TRUE; // Enable Ctrl+Arrows moving between fields when editing?
$cfg['LimitChars'] = 50; // Max field data length in browse mode for all non-numeric fields
$cfg['ModifyDeleteAtLeft'] = TRUE; // show edit/delete links on left side of browse
// (or at the top with vertical browse)
$cfg['ModifyDeleteAtRight'] = FALSE; // show edit/delete links on right side of browse
// (or at the bottom with vertical browse)
$cfg['DefaultDisplay'] = 'horizontal'; // default display direction
// (horizontal|vertical|horizontalflipped)
$cfg['DefaultPropDisplay'] = 'horizontal'; // default display direction for altering/
// creating columns (tbl_properties)
// (horizontal|vertical)
$cfg['HeaderFlipType'] = 'css'; // table-header rotation via faking or css? (css|fake)
// NOTE: CSS only works in IE browsers!
$cfg['ShowBrowseComments'] = TRUE; // shows stored relation-comments in 'browse' mode.
$cfg['ShowPropertyComments']= TRUE; // shows stored relation-comments in 'table property' mode.
$cfg['RepeatCells'] = 100; // repeat header names every X cells? (0 = deactivate)
$cfg['QueryFrame'] = TRUE; // displays a link or icon in the left frame to open the querybox, and activates the querybox when clicking on [Edit] on the results page.
$cfg['QueryFrameJS'] = TRUE; // whether to use java script functions for opening a new window for SQL commands.
// if set to 'false', the target of the querybox is always the right frame.
$cfg['QueryWindowWidth'] = 550; // Width of Query window
$cfg['QueryWindowHeight'] = 310; // Height of Query window
$cfg['QueryHistoryDB'] = FALSE; // Set to TRUE if you want DB-based query history.
// If FALSE, this utilizes JS-routines to display
// query history (lost by window close)
$cfg['QueryWindowDefTab'] = 'sql'; // which tab to display in the querywindow on startup
// (sql|files|history|full)
$cfg['QueryHistoryMax'] = 25; // When using DB-based query history, how many entries
// should be kept?
$cfg['BrowseMIME'] = TRUE; // Use MIME-Types (stored in column comments table) for
$cfg['MaxExactCount'] = 20000; // When approximate count < this, PMA will get exact count for
// table rows.
$cfg['WYSIWYG-PDF'] = TRUE; // Utilize DHTML/JS capabilities to allow WYSIWYG editing of
// the PDF page editor. Requires an IE6/Mozilla based browser.
$cfg['NaturalOrder'] = TRUE; // Sort table and database in natural order
//-----------------------------------------------------------------------------
// custom-setup by mkkeck: 2004-05-04
// some specials for new icons and scrollings
// FIXME:
// 2004-05-08 rabus: We need to rearrange these variables.
$cfg['ShowHttpHostTitle'] = TRUE; // show HttpHost in browsers window title (true|false)?
$cfg['SetHttpHostTitle'] = ''; // if ShowHttpHostTitle=true, please set your host (server)
// or an other string, wich should be shown in browsers window title.
// If not set (or empty), the PMA will get your real Host-Adress.
$cfg['ErrorIconic'] = TRUE; // show some icons for warning, error and information messages (true|false)?
$cfg['MainPageIconic'] = TRUE; // show icons in list on main page, on right panel top menu (server db table) and on menu tabs (true|false)?
$cfg['ReplaceHelpImg'] = TRUE; // show help button instead of strDocumentation (true|false)?
// theme manager
$cfg['ThemePath'] = './themes'; // using themes manager please set up here the path to 'themes'
// else leave empty
$cfg['ThemeManager'] = TRUE; // if you want to use selectable themes and if ThemesPath not empty
// set it to true, else set it to false (default is false);
$cfg['ThemeDefault'] = 'original'; // set up default theme, if ThemePath not empty
// you can set up here an valid path to themes or 'original' for
// the original pma-theme
//-----------------------------------------------------------------------------
/**
* Default queries
* %d will be replaced by the database name.
* %t will be replaced by the table name.
* %f will be replaced by a list of field names.
* (%t and %f only applies to DefaultQueryTable)
*/
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
$cfg['DefaultQueryDatabase'] = '';
/**
* SQL Query box settings
* These are the links display in all of the SQL Query boxes
*/
$cfg['SQLQuery']['Edit'] = TRUE; // Edit link to change a query
$cfg['SQLQuery']['Explain'] = TRUE; // EXPLAIN on SELECT queries
$cfg['SQLQuery']['ShowAsPHP'] = TRUE; // Wrap a query in PHP
$cfg['SQLQuery']['Validate'] = FALSE; // Validate a query (see $cfg['SQLValidator'] as well)
$cfg['SQLQuery']['Refresh'] = TRUE; // Refresh the results page
/**
* Webserver upload/save/import directories
*/
$cfg['UploadDir'] = ''; // Directory for uploaded files that can be executed by
// phpMyAdmin. For example './upload'. Leave empty for
// no upload directory support
$cfg['SaveDir'] = ''; // Directory where phpMyAdmin can save exported data on
// server. For example './save'. Leave empty for no save
// directory support.
$cfg['docSQLDir'] = ''; // Directory for docSQL imports, phpMyAdmin can import
// docSQL files from that directory. For example
// './docSQL'. Leave empty for no docSQL import support.
$cfg['TempDir'] = ''; // Directory where phpMyAdmin can save temporary files.
// This is needed for MS Excel export, see documentation
// how to enable that.
/**
* Misc. settings
*/
$cfg['GD2Available'] = 'auto'; // Is GD >= 2 available? Set to yes/no/auto. 'auto'
// does autodetection, which is a bit expensive for
// php < 4.3.0, but it is the only safe vay how to
// determine GD version.
/**
* SQL Parser Settings
*/
$cfg['SQP']['fmtType'] = 'html'; // Pretty-printing style to use on queries (html, text, none)
$cfg['SQP']['fmtInd'] = '1'; // Amount to indent each level (floats ok)
$cfg['SQP']['fmtIndUnit'] = 'em'; // Units for indenting each level (CSS Types - {em,px,pt})
// The graphical settings are now located in themes/themename/layout.inc.php
/**
* If you wish to use the SQL Validator service, you should be
* aware of the following:
* All SQL statements are stored anonymously for statistical purposes.
* Mimer SQL Validator, Copyright 2002 Upright Database Technology.
* All rights reserved.
*/
$cfg['SQLValidator']['use'] = FALSE; // Make the SQL Validator available
$cfg['SQLValidator']['username'] = ''; // If you have a custom username, specify it here (defaults to anonymous)
$cfg['SQLValidator']['password'] = ''; // Password for username
/**
* Developers ONLY!
* To use the following, please install the DBG extension from [url]http://dd.cron.ru/dbg/[/url]
*/
$cfg['DBG']['enable'] = FALSE; // Make the DBG stuff available
$cfg['DBG']['profile']['enable'] = FALSE; // Produce profiling results of PHP
$cfg['DBG']['profile']['threshold'] = 0.5; // Threshold of long running code to display
// Anything below the threshold is not displayed
/**
* MySQL settings
*/
// Column types;
// varchar, tinyint, text and date are listed first, based on estimated popularity
$cfg['ColumnTypes'] = array(
'VARCHAR',
'TINYINT',
'TEXT',
'DATE',
'SMALLINT',
'MEDIUMINT',
'INT',
'BIGINT',
'FLOAT',
'DOUBLE',
'DECIMAL',
'DATETIME',
'TIMESTAMP',
'TIME',
'YEAR',
'CHAR',
'TINYBLOB',
'TINYTEXT',
'BLOB',
'MEDIUMBLOB',
'MEDIUMTEXT',
'LONGBLOB',
'LONGTEXT',
'ENUM',
'SET'
);
// Attributes
// Note: the "ON UPDATE CURRENT_TIMESTAMP" attribute is added dynamically
// for MySQL >= 4.1.2, in tbl_properties.inc.php
$cfg['AttributeTypes'] = array(
'',
'BINARY',
'UNSIGNED',
'UNSIGNED ZEROFILL'
);
// Available functions
if ($cfg['ShowFunctionFields']) {
$cfg['Functions'] = array(
'ASCII',
'CHAR',
'SOUNDEX',
'LCASE',
'UCASE',
'NOW',
'PASSWORD',
'MD5',
'SHA1',
'ENCRYPT',
'RAND',
'LAST_INSERT_ID',
'COUNT',
'AVG',
'SUM',
'CURDATE',
'CURTIME',
'FROM_DAYS',
'FROM_UNIXTIME',
'PERIOD_ADD',
'PERIOD_DIFF',
'TO_DAYS',
'UNIX_TIMESTAMP',
'USER',
'WEEKDAY',
'CONCAT'
);
// Which column types will be mapped to which Group?
$cfg['RestrictColumnTypes'] = array(
'VARCHAR' => 'FUNC_CHAR',
'TINYINT' => 'FUNC_NUMBER',
'TEXT' => 'FUNC_CHAR',
'DATE' => 'FUNC_DATE',
'SMALLINT' => 'FUNC_NUMBER',
'MEDIUMINT' => 'FUNC_NUMBER',
'INT' => 'FUNC_NUMBER',
'BIGINT' => 'FUNC_NUMBER',
'FLOAT' => 'FUNC_NUMBER',
'DOUBLE' => 'FUNC_NUMBER',
'DECIMAL' => 'FUNC_NUMBER',
'DATETIME' => 'FUNC_DATE',
'TIMESTAMP' => 'FUNC_DATE',
'TIME' => 'FUNC_DATE',
'YEAR' => 'FUNC_DATE',
'CHAR' => 'FUNC_CHAR',
'TINYBLOB' => 'FUNC_CHAR',
'TINYTEXT' => 'FUNC_CHAR',
'BLOB' => 'FUNC_CHAR',
'MEDIUMBLOB' => 'FUNC_CHAR',
'MEDIUMTEXT' => 'FUNC_CHAR',
'LONGBLOB' => 'FUNC_CHAR',
'LONGTEXT' => 'FUNC_CHAR',
'ENUM' => '',
'SET' => ''
);
// Map above defined groups to any function
$cfg['RestrictFunctions'] = array(
'FUNC_CHAR' => array(
'ASCII',
'CHAR',
'SOUNDEX',
'LCASE',
'UCASE',
'PASSWORD',
'MD5',
'SHA1',
'ENCRYPT',
'LAST_INSERT_ID',
'USER',
'CONCAT'
),
'FUNC_DATE' => array(
'NOW',
'CURDATE',
'CURTIME',
'FROM_DAYS',
'FROM_UNIXTIME',
'PERIOD_ADD',
'PERIOD_DIFF',
'TO_DAYS',
'UNIX_TIMESTAMP',
'WEEKDAY'
),
'FUNC_NUMBER' => array(
'ASCII',
'CHAR',
'MD5',
'SHA1',
'ENCRYPT',
'RAND',
'LAST_INSERT_ID',
'UNIX_TIMESTAMP',
'COUNT',
'AVG',
'SUM'
)
);
// Default functions for above defined groups
$cfg['DefaultFunctions'] = array(
'FUNC_CHAR' => '',
'FUNC_DATE' => '',
'FUNC_NUMBER' => '',
'first_timestamp' => 'NOW'
);
} // end if
// Search operators
$cfg['NumOperators'] = array(
'=',
'>',
'>=',
'<',
'<=',
'!=',
'LIKE',
'NOT LIKE'
);
$cfg['TextOperators'] = array(
'LIKE',
'LIKE %...%',
'NOT LIKE',
'=',
'!=',
'REGEXP',
'NOT REGEXP'
);
$cfg['EnumOperators'] = array(
'=',
'!='
);
$cfg['NullOperators'] = array(
'IS NULL',
'IS NOT NULL'
);
$cfg['UnaryOperators'] = array(
'IS NULL' => 1,
'IS NOT NULL' => 1
);
/**
* Unset magic_quotes_runtime - do not change!
*/
set_magic_quotes_runtime(0);
/**
* File Revision - do not change either!
*/
$cfg['FileRevision'] = '$Revision: 2.53 $';
?>
FreeBSD全能服务器安装手册之文件服务器篇之B管理界面篇
##################################设置ftp管理界面##############################
require 'language.php';
$LANG = $ZH_CN; //Language (Options are $DUTCH, $ENGLISH, $PT_BR, $RUSSIAN
//$SPANISH, $COREAN, $FRENCH, $HUNGARIAN, $GERMAN
// $TURKISH, $DANISH , $NORWEGIAN or $ZH_CN)
$LocationImages = "images"; // Location of images
$DBHost = "localhost"; // Ip-adres of MySQL server
// (Dont change this if you are using the default database)
$DBLogin = "ftp"; // Username of MySQL user
$DBPassword = "password"; // Password of MySQL user
$DBDatabase = "ftpusers"; // Name of database
$FTPaddress = "192.168.0.205:21"; // Domain name or ip-address of your ftp server
$DEFUserID = "2000"; // nobody // Default user id of virtual ftp user.
$DEFGroupID = "2000"; // guest // Default group is of virtual ftp user.
###############################FTP管理界面源代码##############################
注意:共四个页面、一个样式、图片不付、存放图片的文件夹名为images
(admin.php、config.php、index.php、language.php、style.css)
%%%%%%%%%%%%%%%%%%%% admin.php%%%%%%%%%%%%%%%%%%%%%%
<?php
session_start();
require 'config.php';
if ($_SESSION['Login'] != '1')
{
header("location: index.php");
}else
{
if(!$mysql_ftp = @mysql_connect("$DBHost","$DBLogin","$DBPassword"))
{
echo $Translate[2][$LANG];
}
@mysql_select_db($DBDatabase);
$table_archief = "SELECT * FROM users ORDER BY User ASC";
$query_archief = mysql_query($table_archief);
$length_archief = mysql_numrows($query_archief);
function compare_array($word,$array)
{
$iCounter = 0;
while ($iCounter < count($array))
{
if($word == $array[$iCounter])
{
return $iCounter;
break;
}
$iCounter++;
}
return -1;
}
$filename = $UsersFile;
$fh = fopen($filename,"r");
$iNrofunixusers = 0;
while (!feof ($fh))
{
$line = fgets($fh,4096);
$data = explode(":",$line);
$user = trim($data[0]);
$user_id = trim($data[2]);
if ($user[0] != '#' &&
strlen($user) != 0 &&
strlen($user_id) != 0)
{
if(compare_array($user,$BlacklistUsers) == -1) /* no hit */
{
$unix_users[$iNrofunixusers] [0] = $user;
$unix_users[$iNrofunixusers] [1] = $user_id;
$iNrofunixusers++;
}
}
}
fclose($fh);
$filename = $GroupFile;
$fh = fopen($filename,"r");
$iNrofunixgroups = 0;
while (!feof ($fh))
{
$line = fgets($fh,4096);
$data = explode(":",$line);
$group = trim($data[0]);
$group_id = trim($data[2]);
if ($group[0] != '#' &&
strlen($group) != 0 &&
strlen($group_id) != 0)
{
if(compare_array($group,$BlacklistGroups) == -1) /* no hit */
{
$unix_groups[$iNrofunixgroups] [0] = $group;
$unix_groups[$iNrofunixgroups] [1] = $group_id;
$iNrofunixgroups++;
}
}
}
fclose($fh);
if($_GET['new'] == 1)
$new = 1;
$data_saved=1;
if(isset($_POST['save']))
{
$empty_password = 0;
$vallid_password = 1;
/* Default values, not used in this version but fields exist in database table */
$quotafiles = "0";
$quotasize = "0";
/* check if password if filled */
if (strlen($_POST['password_box']) == 0 || ($_POST['password_box'] == "empty"))
$empty_password = 1;
/* check for vallid password */
if ($_POST['confirm_password_box'] != $_POST['password_box'])
$vallid_password = 0;
$iExistUser=0;
$iCounter=0;
/* Find out of user exist */
while ($iCounter < $length_archief)
{
$bericht_nr = mysql_result($query_archief,$iCounter,"User");
if ($bericht_nr == $_POST['user_box'])
{
$iExistUser=1;
break;
}
$iCounter++;
}
if ($iExistUser == 1)
{
/* update current ftp account */
if ($vallid_password == 0)
{
echo ("<script language=/"java script/" type=/"text/java script/">/n");
echo ("<!--/n/n");
echo (" alert(/"".$Translate[3][$LANG]."/");/n/n");
echo ("-->/n");
echo ("</script>/n");
}else
{
if ($empty_password == 1)
{
echo ("<script language=/"java script/" type=/"text/java script/">/n");
echo ("<!--/n/n");
echo (" alert(/"".$Translate[4][$LANG]."/");/n/n");
echo ("-->/n");
echo ("</script>/n");
/*echo ("Uid=".$_POST['uid_box']."<br>
Gid=".$_POST['gid_box']."<br>
Dir=".$_POST['dir_box']."<br>
QuotaFiles=".$_POST['quotafiles_box']."<br>
QuotaSize=".$_POST['quotasize_box']."<br>
ULBandwidth=".$_POST['ulbandwidth_box']."<br>
DLBandwidth=".$_POST['dlbandwidth_box']."<br>
User=".$_POST['user_box']."<br>/n");*/
if(!mysql_query("UPDATE users SET Uid='".$_POST['uid_box']."',
Gid='".$_POST['gid_box']."',
Dir='".$_POST['dir_box']."',
QuotaFiles='".$_POST['quotafiles_box']."',
QuotaSize='".$_POST['quotasize_box']."',
ULBandwidth='".$_POST['ulbandwidth_box']."',
DLBandwidth='".$_POST['dlbandwidth_box']."'
WHERE User='".$_POST['user_box']."'",$mysql_ftp))
{
echo $Translate[5][$LANG];
}
}else
{
if(!mysql_query("UPDATE users SET Password='".md5($_POST['password_box'])."',
Uid='".$_POST['uid_box']."',
Gid='".$_POST['gid_box']."',
Dir='".$_POST['dir_box']."',
QuotaFiles='".$_POST['quotafiles_box']."',
QuotaSize='".$_POST['quotasize_box']."',
ULBandwidth='".$_POST['ulbandwidth_box']."',
DLBandwidth='".$_POST['dlbandwidth_box']."'
WHERE User='".$_POST['user_box']."'",$mysql_ftp))
{
echo $Translate[5][$LANG];
}else
{
echo ("<script language=/"java script/" type=/"text/java script/">/n");
echo ("<!--/n/n");
echo (" alert(/"".$Translate[6][$LANG]."/");/n/n");
echo ("-->/n");
echo ("</script>/n");
}
}
}
}else
{
// echo ("empty_password = $empty_password <br>/n");
// echo ("vallid_password = $vallid_password <br>/n");
/* Create new User */
if ($vallid_password == 0 || $empty_password == 1)
{
echo ("<script language=/"java script/" type=/"text/java script/">/n");
echo ("<!--/n/n");
echo (" alert(/"".$Translate[3][$LANG]."/");/n/n");
echo ("-->/n");
echo ("</script>/n");
$data_saved = 0;
}else
{
if(!mysql_query("INSERT INTO users (User,Password,Uid,Gid,Dir,QuotaFiles,QuotaSize,ULBandwidth,DLBandwidth)
VALUES ('".$_POST['user_box']."',
'".md5($_POST['password_box'])."',
'".$_POST['uid_box']."',
'".$_POST['gid_box']."',
'".$_POST['dir_box']."',
'".$_POST['quotafiles']."',
'".$_POST['quotasize']."',
'".$_POST['ulbandwidth_box']."',
'".$_POST['dlbandwidth_box']."')",$mysql_ftp))
{
echo $Translate[5][$LANG];
}
}
}
$table_archief = "SELECT * FROM users ORDER BY User ASC";
$query_archief = mysql_query($table_archief);
$length_archief = mysql_numrows($query_archief);
}
if(isset($_GET['delete']))
{
if(!mysql_query("DELETE FROM users WHERE User='".$_GET['user_box']."'",$mysql_ftp))
{
echo $Translate[5][$LANG];
}else
{
$table_archief = "SELECT * FROM users ORDER BY User ASC";
$query_archief = mysql_query($table_archief);
$length_archief = mysql_numrows($query_archief);
}
$new=1;
}
function help($help_text)
{
global $LocationImages;
echo ("<img class=help src=/"$LocationImages/info.gif/" height=/"16/" width=/"16/"");
echo (" title=/"$help_text/" hspace=/"1/" align=/"middle/" border=/"0/">");
}
echo ("<html>/n");
echo ("<head>/n");
echo ("<title>".$Translate[0][$LANG]." (".$Translate[1][$LANG].")</title>/n");
echo ("<meta http-equiv=/"Content-Type/" content=/"text/html; charset=gb2312/">/n");
?>
<script language="java script" type="text/java script">
<!--
function danger_url(user,urlv)
{
var user_input = confirm('<?=$Translate[7][$LANG]?> "'+user+'" <?=$Translate[8][$LANG]?>');
if (user_input == true)
{
location = urlv;
}
}
-->
</script>
<?php
print("<link rel=/"stylesheet/" href=/"style.css/" type=/"text/css/" />/n");
echo ("</head>/n");
echo ("<body bgcolor=/"#FFFFFF/" text=/"#000000/" link=/"#000000/" >/n");
// phpinfo();
echo ("<form action=/"$_SERVER[PHP_SELF]/" method=/"post/" name=/"newuserform/">/n");
echo ("<div align=/"center/">/n");
echo ("<table bgcolor=/"3F4F70/" border=/"0/" cellpadding=/"1/" cellspacing=/"1/" width=/"850/">/n");
echo ("<tr bgcolor=/"#FFFFFF/">/n");
echo ("<td>/n");
echo ("<table border=/"0/" cellpadding=/"0/" cellspacing=/"0/" width=/"850/">/n");
echo ("<tr>/n");
echo ("<td>/n");
echo ("<font size=/"+1/"> ".$Translate[0][$LANG]."</font>/n");
echo ("</td>/n");
echo ("<td align=/"right/">");
echo ("<a href=/"$_SERVER[PHP_SELF]?new=1/">");
echo ("<img hspace=/"1/" src=/"$LocationImages/new_ftpuser.gif/" width=/"16/" height=/"21/" align=/"absmiddle/" border=/"0/">");
echo (" ".$Translate[9][$LANG]." </a>");
echo ("</td>/n");
echo ("</tr>/n");
echo ("</table>/n");
echo ("</td>/n");
echo ("</tr>/n");
echo ("<tr bgcolor=/"#FFFFFF/">/n");
echo ("<td>/n");
echo ("<table width=/"850/" border=/"0/">/n");
echo ("<tr bgcolor=/"#336699/">/n");
echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[10][$LANG]."</b></font></td>");
// echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[11][$LANG]."</b></font></td>");
echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[12][$LANG]."</b></font></td>");
echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[13][$LANG]."</b></font></td>");
echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[14][$LANG]."</b></font></td>");
echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[35][$LANG]."</b></font></td>");
echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[36][$LANG]."</b></font></td>");
echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[15][$LANG]."</b></font></td>");
echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[16][$LANG]."</b></font></td>");
echo ("<td width=/"/" align=/"left/"><font color=#ffffff><b>".$Translate[17][$LANG]."</b></font></td>");
echo ("</tr>/n");
$iCounter = 0;
while ($iCounter < $length_archief)
{
$user = mysql_result($query_archief,$iCounter,"User");
$password = mysql_result($query_archief,$iCounter,"Password");
$uid = mysql_result($query_archief,$iCounter,"Uid");
$gid = mysql_result($query_archief,$iCounter,"Gid");
$dir = mysql_result($query_archief,$iCounter,"Dir");
$quotafiles = mysql_result($query_archief,$iCounter,"QuotaFiles");
$quotasize = mysql_result($query_archief,$iCounter,"QuotaSize");
$ulbandwidth = mysql_result($query_archief,$iCounter,"ULBandwidth");
$dlbandwidth = mysql_result($query_archief,$iCounter,"DLBandwidth");
echo ("<tr bgcolor=/"#C3D6E6/">/n");
echo ("<td align=/"left/"><a href=/"$_SERVER[PHP_SELF]?id=$user/">");
echo ("<img src=/"$LocationImages/ftpuser.gif/" width=/"16/" height=/"18/" alt=/"".$Translate[19][$LANG]."/" border=/"0/">$user</a></td>/n");
echo ("<td align=/"left/">".$uid."</td>/n");
echo ("<td align=/"left/">".$gid."</td>/n");
echo ("<td align=/"left/">".$dir."</td>/n");
echo ("<td align=/"left/">".$quotafiles."</td>/n");
echo ("<td align=/"left/">".$quotasize."</td>/n");
echo ("<td align=/"left/">".$ulbandwidth."</td>/n");
echo ("<td align=/"left/">".$dlbandwidth."</td>/n");
echo ("<td align=/"center/" width=/"100/">");
/* Edit ftp account */
echo ("<a href=/"$_SERVER[PHP_SELF]?id=$user/">");
echo ("<img src=/"$LocationImages/edit.gif/" width=/"16/" height=/"18/" border=/"0/" ");
echo ("title=/"".$Translate[19][$LANG]."/" ");
echo ("alt=/"".$Translate[19][$LANG]."/"></a> ");
/* Delete ftp account */
echo ("<a href=/"$_SERVER[PHP_SELF]/" onClick=/"danger_url('$user',this.href+'?delete=1&user_box=$user');return false;/">");
echo ("<img src=/"$LocationImages/delete.gif/" width=/"15/" height=/"16/" border=/"0/" ");
echo ("title=/"".$Translate[20][$LANG]."/" ");
echo ("alt=/"".$Translate[20][$LANG]."/"></a> ");
// <img src="connect2.gif" width="16" height="18">
/* Open ftp account */
echo ("<a href=/"ftp://$user@".$FTPAddress."/" target=/"_blank/">");
echo ("<img src=/"$LocationImages/connect.gif/" width=/"16/" height=/"18/" border=/"0/" ");
echo ("title=/"".$Translate[21][$LANG]."/" ");
echo ("alt=/"".$Translate[21][$LANG]."/"></a>");
echo ("</td>/n");
echo ("</tr>/n");
$iCounter++;
}
echo ("</table>/n");
echo ("</td>/n");
echo ("</tr>/n");
echo ("</table>/n");
$password = "empty";
if(!empty($_GET['id']))
{
$iCounter=0;
while ($iCounter < $length_archief)
{
$bericht_nr = mysql_result($query_archief,$iCounter,"User");
if ($bericht_nr == $_GET['id'])
{
$user = $bericht_nr;
// $password = mysql_result($query_archief,$iCounter,"Password");
$uid = mysql_result($query_archief,$iCounter,"Uid");
$gid = mysql_result($query_archief,$iCounter,"Gid");
$dir = mysql_result($query_archief,$iCounter,"Dir");
$quotafiles = mysql_result($query_archief,$iCounter,"QuotaFiles");
$quotasize = mysql_result($query_archief,$iCounter,"QuotaSize");
$ulbandwidth = mysql_result($query_archief,$iCounter,"ULBandwidth");
$dlbandwidth = mysql_result($query_archief,$iCounter,"DLBandwidth");
break;
}
$iCounter++;
}
}else if(empty($new))
{
// $_GET['id']
// $_POST['']
$user = $_POST['user_box'];
$password = "empty";
$uid = $_POST['uid_box'];
$gid = $_POST['gid_box'];
$dir = $_POST['dir_box'];
$ulbandwidth = $_POST['ulbandwidth_box'];
$dlbandwidth = $_POST['dlbandwidth_box'];
}else
{
$user = $Translate[22][$LANG];
$password = "";
$uid = $DEFUserID;
$gid = $DEFGroupID;
$dir = "/";
$ulbandwidth = "80";
$dlbandwidth = "5";
}
if(isset($_POST['select_user']) &&
$_POST['select_user'] != $select_user_old &&
!isset($_POST['save']))
{
$uid = $_POST['select_user'];
$password = $_POST['password_box'];
}
if(isset($_POST['select_group']) &&
$_POST['select_group'] != $select_group_old &&
!isset($_POST['save']))
{
$gid = $_POST['select_group'];
$password = $_POST['password_box'];
}
session_register("select_group_old");
session_register("select_user_old");
echo ("<br><br>");
echo ("<table width=/"850/" border=/"0/" cellpadding=/"2/" cellspac