日期:2014-05-16  浏览次数:20685 次

FreeBSD8_mysql5_php_nginx安装

1.freebsd最小化安装
??? sysinstall安装port
??? #sysinstall
??? ?Custum选择ports安装选项
??? ?Configure->Distributions->DVD/CD
2.安装axel(多线程下载工具,加速下载)
??? cd /usr/ports/ftp/axel/
??? make install
??? vi /etc/make.conf
??? #加入以下内容(注意加入粘贴以下内容时要把每行后面的空格去掉,不然ports安装软件时报错)
??? ?FETCH_CMD=axel
??? ?FETCH_BEFORE_ARGS= -n 10 -a
??? ?FETCH_AFTER_ARGS=
??? ?DISABLE_SIZE=yes
??? ?MASTER_SITE_OVERRIDE?=\
??? ?http://ports.hshh.org/${DIST_SUBDIR}/\
??? ?http://ports.cn.freebsd.org/${DIST_SUBDIR}/\
??? ?ftp://ftp.freeBSDchina.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
??? ?MASTER_SITE_OVERRIDE?=${MASTER_SITE_BACKUP}

3.使用portsnap升级port目录树
??? vi /etc/portsnap.conf
??? 把SERVERNAME=portsnap.freebsd.org
??? 修改成:
??? SERVERNAME=portsnap.hshh.org
??? 首次使用portsnap执行
??? portsnap fetch extract
??? 再次更新使用
??? portsnap fetch update
???
4.安装bash
??? cd /usr/ports/shells/bash3
??? make install
??? 修改登陆使用bash
??? chsh -s /usr/local/bin/bash
??? #使bash下显示中文
??? ??? vi ~/.login_conf
??? #添加下面
??? ??? me:\
??? :lang=zh_CN.UTF-8:\
??? :setenv=LC_ALL=zh_CN.UTF-8:\
??? :setenv=LC_COLLATE=zh_CN.UTF-8:\
??? :setenv=LC_CTYPE=zh_CN.UTF-8:\
??? :setenv=LC_MESSAGES=zh_CN.UTF-8:\
??? :setenv=LC_MONETARY=zh_CN.UTF-8:\
??? :setenv=LC_NUMERIC=zh_CN.UTF-8:\
??? :setenv=LC_TIME=zh_CN.UTF-8:\
??? :charset=UTF-8:\
??? :xmodifiers="@im=gcin": #Set gcin as the XIM Input Server

??? 4.1使bash像linux下显示不同颜色
??? ??? cd /usr/ports/misc/gnuls
??? ??? make install clean??? ??? ???
??? ??? -------------------------------???
??? ??? vim ~/.profile
??? ??? 则修改.shrc文件加入下列:
??? ??? alias ls='gnuls --color'
??? ??? alias ls='ls -FG'
5.

6.安装vim编辑器
??? cd /usr/ports/editors/vim-lite
??? make -DWITHOUT_X11 install
??? #进入当前用户~目录建立.vimrc配置文件
??? ??? vim /root/.vimrc
??? ??? #添加下列
??? ??? ??? syntax on
??? ??? ??? set nocompatible
??? ??? ??? set number
??? ??? ??? set autoindent
??? ??? ??? set smartindent
??? ??? ??? set expandtab????
??? ??? ??? set tabstop=4
??? ??? ??? set shiftwidth=4
??? ??? ??? set showmatch
??? ??? ??? set cursorline
??? ??? ??? set nobackup
??? ??? ??? set ruler
??? ??? ??? set fileencodings=utf-8,gb2312,gbk,gb18030
??? ??? ??? set termencoding=utf-8
??? ??? ??? set fileformats=unix
??? ??? ??? set encoding=prc
??? ??? ??? set hlsearch???
??? ??? ??? set incsearch
??? ??? ??? set fdm=indent???
??? cp /root/.vimrc ~
???
7.安装sudo不用登陆root用户执行wheel组权限操作
??? cd /usr/ports/security/sudo
??? make install
??? sudo的配置文件在/usr/local/etc/sudoers里面。sudo的配置文件不应直接编辑,而应使用 visudo 来进行修改
??? %wheel ALL=(ALL) ALL
??? 这个命令指定了wheel这个组的所有者可以使用全部的权限。
??? Defaults:M-gtuiw timestamp_timeout=0, runaspw, passwd_tries=1
??? 这个命令设置密码在一段时间后自动退出
???
???
???
8.安装mysql
??? 8.1 添加mysql用户
??? ??? ??? sudo sysinstall->configure->adduser mysql:mysql
??? ??? ???
??? 8.2??? ports安装mysql
??? ??? ??? ??? cd /usr/ports/databases/mysql55-server
??? ??? ???? ??? make WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_PROC_SCOPE_PTH=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes SKIP_DNS_CHECK=yes WITHOUT_INNODB=no install clean
??? ??? ??? ??? #成功后显示如下信息
??? ??? ??? ??? #Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
??? ??? ??? ??? #the first time you start the MySQL server after an upgrade from an
??? ??? ??? ??? #earlier version.
??? 8.3 创建MySQL数据库存放目录
??? ??? ??? ??? mkdir -p /usr/local/data0/mysql/3306/data/
??? ??? ??? ??? mkdir -p /usr/local/data0/mysql/3306/binlog/
??? ??? ??? ??? mkdir -p /usr/local/data0/mysql/3306/relaylog/
??? ??? ??? ??? chown -R mysql:mysql /usr/local/data0/mysql/<