你好,游客 登录 注册 搜索
背景:
阅读新闻

FreeBSD10.1安装过程图解

[日期:2016-07-06] 来源:Linux社区  作者:Linux [字体:大 中 小]
bash的设置
root@lsgxbsd:~ #  ln -s /usr/local/bin/bash /bin/bash
root@ lsgxbsd :~ #  vi/etc/shells 
----------------------------------------------------------
# $FreeBSD: releng/10.2/etc/shells 59717 2000-04-27 21:58:46Z ache $
#
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
 
/bin/sh
/bin/csh
/bin/tcsh
/bin/bash
/usr/local/bin/bash
/usr/local/bin/rbash
/usr/local/bin/zsh
/usr/local/bin/rzsh
--------------------------------------------------------
root@ lsgxbsd :~ #  chsh -s    /bin/bash lsgx
 
 
 
root@lsgxbsd:~ #  ln -s /usr/local/etc/bash_completion.d /etc/bash_completion.d
root@lsgxbsd:~ #  vi /usr/local/etc/bash_completion
-------------------------------------------------------------------
. /usr/local/share/bash-completion/ bash-completion
-------------------------------------------------------------------
root@lsgxbsd:~ #  ln -s /usr/local/etc/bash_completion /etc/bash_completion
 
 
root@lsgxbsd:~ #  vi /etc/profile
------------------------------------------------------------------------------------------
# $FreeBSD: releng/10.1/etc/profile 208116 2010-05-15 17:49:56Z jilles $
#
# System-wide .profile file for sh(1).
#
# Uncomment this to give you the default 4.2 behavior, where disk
# information is shown in K-Blocks
# BLOCKSIZE=K; export BLOCKSIZE
#
# For the setting of languages and character sets please see
# login.conf(5) and in particular the charset and lang options.
# For full locales list check /usr/share/locale/*
# You should also read the setlocale(3) man page for information
# on how to achieve more precise control of locale settings.
#
# Check system messages
# msgs -q
# Allow terminal messages
# mesg y
 
 
# Beginning of the block added by the lsgx - DO NOT EDIT
 
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
 
if [ "$PS1" ]; then
  if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi
 
# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.
 
if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi
 
# End of the block added by the lsgx
 
----------------------------------------------------------------------------------------
 
root@lsgxbsd:~ #  mkdir /etc/profile.d
root@lsgxbsd:~ #  vi /etc/profile.d/bash_completion.sh
---------------------------------------------------------------------------------------------
# Check for interactive bash and that we haven't already been sourced.
if [ -n "$BASH_VERSION" -a -n "$PS1" -a -z "$BASH_COMPLETION_COMPAT_DIR" ]; then
 
# Check for recent enough version of bash.
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
if [ $bmajor -gt 4 ] || [ $bmajor -eq 4 -a $bminor -ge 1 ]; then
    [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
        . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
    if shopt -q progcomp && [ -r /usr/local/share/bash-completion/bash_completion ]; then
        # Source completion code.
        . /usr/local/share/bash-completion/bash_completion
    fi
fi
unset bash bmajor bminor
 
fi
------------------------------------------------------------------------------------------------
 
root@lsgxbsd:~ #  vi /etc/profile.d/Z97-byobu.sh
---------------------------------------------------------------------------------------------
#!/bin/sh
#    Z97-byobu.sh - allow any user to opt into auto-launching byobu
#    Copyright (C) 2011 Canonical Ltd.
#
#    Authors: Dustin Kirkland <kirkland@byobu.co>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
# Allow any user to opt into auto-launching byobu by setting LC_BYOBU=1
# Apologies for borrowing the LC_BYOBU namespace, but:
#  a) it's reasonable to assume that no one else is using LC_BYOBU
#  b) LC_* is sent and receieved by most /etc/ssh/ssh*_config
if [ -n "$LC_BYOBU" ] && [ "$LC_BYOBU" -gt 0 ] && [ -r "/usr /bin/byobu-launch" ]; then
. /usr /bin/byobu-launch
elif [ "$LC_TERMTYPE" = "byobu" ] && [ -r "/usr/bin/byobu-launch" ]; then
. /usr /bin/byobu-launch
elif [ "$LC_TERMTYPE" = "byobu-screen" ] && [ -r "/usr /bin/byobu-launch" ]; then
export BYOBU_BACKEND="screen"
. /usr/ bin/byobu-launch
elif [ "$LC_TERMTYPE" = "byobu-tmux" ] && [ -r "/usr /bin/byobu-launch" ]; then
export BYOBU_BACKEND="tmux"
. /usr /bin/byobu-launch
fi
 
# vi: syntax=sh ts=4 noexpandtab
---------------------------------------------------------------------------------------------
 
root@lsgxbsd:~ #  vi /etc/bash.bashrc
-------------------------------------------------------------------------------------
# System-wide .bashrc file for interactive bash(1) shells.
 
# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.
 
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
 
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
 
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi
 
# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
 
# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
    ;;
*)
    ;;
esac
 
# enable bash completion in interactive shells
if ! shopt -oq posix; then
  if [ -f /usr/local/share/bash-completion/bash_completion ]; then
    . /usr/local/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
 
# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
    case " $(groups) " in *\ admin\ *)
    if [ -x /usr /local /bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
 
EOF
    fi
    esac
fi
 
# if the command-not-found package is installed, use it
if [ -x /usr /local /lib/command-not-found -o -x /usr /local /share/command-not-found/command-not-found ]; then
function command_not_found_handle {
       # check because c-n-f could've been removed in the meantime
                if [ -x /usr /local /lib/command-not-found ]; then
  /usr /local /lib/command-not-found -- "$1"
                   return $?
                elif [ -x /usr /local /share/command-not-found/command-not-found ]; then
  /usr /local /share/command-not-found/command-not-found -- "$1"
                   return $?
else
  printf "%s: command not found\n" "$1" >&2
  return 127
fi
}
fi
 
# Beginning of the block added by the lsgx - DO NOT EDIT
export LSCOLORS="ExGxFxdxCxegedabagExEx"
export CLICOLOR="yes"
 
export GREP_OPTIONS="--color=auto"
 
# End of the block added by the lsgx
 
-----------------------------------------------------------------------------------------------------
 
 
root@lsgxbsd:~ #  vi .profile
-------------------------------------------------------------------------------------------------------
# $FreeBSD: releng/10.1/etc/root/dot.profile 199243 2009-11-13 05:54:55Z ed $
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin
export PATH
HOME=/root
export HOME
TERM=${TERM:-xterm}
export TERM
PAGER=more
export PAGER
 
# These are normally set through /etc/login.conf.  You may override them here
# if wanted.
# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH
# BLOCKSIZE=K; export BLOCKSIZE
 
# Setting TERM is normally done through /etc/ttys.  Do only override
# if you're sure that you'll never log in via telnet or xterm or a
# serial line.
# TERM=xterm;  export TERM
 
#EDITOR=vi;   export EDITOR
#PAGER=more;   export PAGER
 
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV
 
if [ -x /usr/games/fortune ] ; then /usr/games/fortune freebsd-tips ; fi
 
# Beginning of the block added by the lsgx - DO NOT EDIT
 
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
 
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
 
# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
    fi
fi
 
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
 
 
# Add setting fcitx at 2015-04-08 13:16:26
#export XMODIFIERS="@im=fcitx" 
#export XIM=fcitx
#export XIM_PROGRAM=/usr/bin/fcitx
#export XIM_ARGS=""
#export GTK_IM_MODULE=XIM
#export QT_IM_MODULE=XIM
#export DEPENDS="fcitx"
#/usr/bin/fcitx &
 
# End of the block added by the lsgx
----------------------------------------------------------------------------
 
root@lsgxbsd:~ #  vi .bashrc
-----------------------------------------------------------------------------
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
 
# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac
 
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
 
# append to the history file, don't overwrite it
shopt -s histappend
 
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
 
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
 
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
 
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
 
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi
 
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac
 
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
 
if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
    else
color_prompt=
    fi
fi
 
if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
 
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac
 
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'
 
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi
 
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
 
# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
 
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
 
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi
 
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/local/share/bash-completion/bash_completion ]; then
    . /usr/local/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
 
 
# Beginning of the block added by the lsgx - DO NOT EDIT
 
#  bash-completion  configure
#[[ $PS1 && -f /usr/local/share/bash-completion/bash_completion.sh ]] && \
# source /usr/local/share/bash-completion/bash_completion.sh
 
# Add setting fbterm at 2015-04-08 13:16:26
#[[ $(tty) == \/dev\/tty[0-9]* ]] && fbterm -- tmux
 
#xrdb loading xterm color
#alias xterm='xrdb ~/.Xresources && xterm -e tmux'
 
alias h="history 25"
alias j="jobs -l"
alias la=" ls -aF"
alias lf=" ls -FA"
alias ll=" ls -lAF"
alias vi=" vim"
 
# A righteous umask
umask 22
 
#PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin
#export PATH
 
export PACKAGEROOT="ftp://ftp.freebsdchina.org"
#export PACKAGEROOT="ftp://ftp.tw.freebsd.org"
#export PACKAGESITE="http://mirrors.aliyun.com/freebsd/releases/amd64/9.3-RELEASE/packages/Latest/"
 
export LANG="zh_CN.UTF-8"
export LC_CTYPE="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8" 
 
# End of the block added by the lsgx
 
------------------------------------------------------------------------------
 
root@lsgxbsd:~ # locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_ALL=zh_CN.UTF-8
 
 
samba的配置
root@lsgxbsd:~ # pkg install libiconv
root@lsgxbsd:~ # pkg install samba42
 
 
Message for openldap-client-2.4.40_1:
************************************************************
 
The OpenLDAP client package has been successfully installed.
 
Edit
  /usr/local/etc/openldap/ldap.conf
to change the system-wide client defaults.
 
Try `man ldap.conf' and visit the OpenLDAP FAQ-O-Matic at
  http://www.OpenLDAP.org/faq/index.cgi?file=3
for more information.
 
************************************************************
Message for cyrus-sasl-2.1.26_9:
You can use sasldb2 for authentication, to add users use:
 
saslpasswd2 -c username
 
If you want to enable SMTP AUTH with the system Sendmail, read
Sendmail.README
 
NOTE: This port has been compiled with a default pwcheck_method of
      auxprop.  If you want to authenticate your user by /etc/passwd,
      PAM or LDAP, install ports/security/cyrus-sasl2-saslauthd and
      set sasl_pwcheck_method to saslauthd after installing the
      Cyrus-IMAPd 2.X port.  You should also check the
      /usr/local/lib/sasl2/*.conf files for the correct
      pwcheck_method.
      If you want to use GSSAPI mechanism, install
      ports/security/cyrus-sasl2-gssapi.
      If you want to use LDAP auxprop plugin, install
      ports/security/cyrus-sasl2-ldapdb.
Message for libinotify-20150516:
============================================================================
You might want to consider increasing the kern.maxfiles tunable if you plan
to use this library for applications that need to monitor activity of a lot
of files.
 
For a typical desktop, add the following line to /boot/loader.conf, then
reboot the system:
 
    kern.maxfiles="25000"
=============================================================================
Message for gamin-0.1.10_8:
===============================================================================
 
Gamin will only provide realtime notification of changes for at most n files,
where n is the minimum value between (kern.maxfiles * 0.7) and
(kern.maxfilesperproc - 200). Beyond that limit, files will be polled.
 
If you often open several large folders with Nautilus, you might want to
increase the kern.maxfiles tunable (you do not need to set
kern.maxfilesperproc, since it is computed at boot time from kern.maxfiles).
 
For a typical desktop, add the following line to /boot/loader.conf, then
reboot the system:
 
    kern.maxfiles="25000"
 
The behavior of gamin can be controlled via the various gaminrc files.
See http://www.gnome.org/~veillard/gamin/config.html on how to create
these files.  In particular, if you find gam_server is taking up too much
CPU time polling for changes, something like the following may help
in one of the gaminrc files:
 
# reduce polling frequency to once per 10 seconds
# for UFS file systems in order to lower CPU load
fsset ufs poll 10
 
===============================================================================
Message for samba42-4.2.2_1:
===============================================================================
 
How to start: http://wiki.samba.org/index.php/Samba4/HOWTO
 
* Your configuration is: /usr/local/etc/smb4.conf
 
* All the relevant databases are under: /var/db/samba4
 
* All the logs are under: /var/log/samba4
 
* Provisioning script is: /usr/local/bin/samba-tool
 
%25%25NSUPDATE%25%25You will need to specify location of the 'nsupdate' command in the
%25%25NSUPDATE%25%25smb4.conf file:
%25%25NSUPDATE%25%25
%25%25NSUPDATE%25%25      nsupdate command = /usr/local/bin/samba-nsupdate -g
%25%25NSUPDATE%25%25
For additional documentation check: http://wiki.samba.org/index.php/Samba4
 
Bug reports should go to the: https://bugzilla.samba.org/
 
===============================================================================
 
root@lsgxbsd:~ # vi /etc/rc.conf
---------------------------------------
inetd_enable="YES"
 
# samba configure
#samba_enable="YES"
samba_server_enable="YES"
nmbd_enable="YES"
smbd_enable="YES"
winbindd_enable="YES"
 
------------------------------------------
root@lsgxbsd:~ #  sh /etc/rc 
 
# vi /boot/loader.conf
------------------------------------------
# samba configure
kern.maxfiles="25000"
 
------------------------------------------
 
root@lsgxbsd:~ # vi /etc/inetd.conf 
-------------------------------------------------
netbios-ssn stream tcp nowait root /usr/local/sbin/smbd smbd
netbios-ns dgram udp wait root /usr/local/sbin/nmbd nmbd
#swat stream tcp nowait/400 root /usr/local/sbin/swat swat
--------------------------------------------------
 
root@lsgxbsd:~ # vi /usr/local/etc/smb4.conf 
------------------------------------------------------
[global]
  netbios name = lsebsd.lsgxeva
  #workgroup = WORKGROUP
  workgroup = lsgxeva
  server string = SambaShare
  security = user
  # hosts allow = 192.168.195. 127.
  log file = /var/log/samba4/log.%m
  max log size = 1000
  passdb backend = tdbsam
 
[SambaShare]
   comment = SambaShare
   browseable = yes
   path = /
   # path = /home
   # valid users = @root
   public = yes
   available = yes
   guest ok = no
   writable = yes
   read only = no
   directory mask = 0775
   create mask = 0664
 
------------------------------------------------------
 
# smbpasswd -a lsgx
New SMB password:
Retype new SMB password:
Added user lsgx.
 
# smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root.
 
# pdbedit -L
lsgx:1001:lsgx
root:0:Charlie &
 
重新启动inetd和samba
root@ lsgxbsd:~ #  killall -HUP inetd
root@lsgxbsd:~ #    cd /usr/local/etc/rc.d
root@lsgxbsd:~ #    ./samba_server restart
设置完成之后在windows中,通过\\freebsd\share访问就可以了,OK :-)
 
 
 
nfs的配置
root@lsgxbsd:~ #   pkg install rpc2
root@lsgxbsd:~ # pkg install libnfs
root@lsgxbsd:~ # pkg install unfs3
 
root@lsgxbsd:~ # vi /etc/rc.conf
--------------------------------------------------
# nfs server setting
rpcbind_enable="YES"
rpc_statd_enable="YES"
rpc_lockd_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
mountd_flags="-r"
 
#rpc_lockd_enable="YES"
#rpc_statd_enable="YES"
 
# nfs client setting
nfs_client_enable="YES" 
nfs_client_flags="-n 4" 
----------------------------------------------
root@lsgxbsd:~ #  sh /etc/rc 
 
etc/exports文件指定了哪个文件系统 NFS应该输出(有时被称为“共享”)。 /etc/exports里面每行指定一个输出的文件系统和哪些机器可以访问该文件系统。在指定机器访问权限的同时,访问选项开关也可以被指定。
 
格式:
 
[共享的目录] [主机名1或IP1(参数1,参数2)] [主机名2或IP2(参数3,参数4)]
 
下面是一些NFS共享的常用参数:
 
ro                      只读访问
rw                      读写访问
sync                    所有数据在请求时写入共享
async                   NFS在写入数据前可以相应请求
secure                  NFS通过1024以下的安全TCP/IP端口发送
insecure                NFS通过1024以上的端口发送
wdelay                  如果多个用户要写入NFS目录,则归组写入(默认)
no_wdelay               如果多个用户要写入NFS目录,则立即写入,当使用async时,无需此设置。
hide                    在NFS共享目录中不共享其子目录
no_hide                 共享NFS目录的子目录
subtree_check           如果共享/usr/bin之类的子目录时,强制NFS检查父目录的权限(默认)
no_subtree_check        和上面相对,不检查父目录权限
all_squash              共享文件的UID和GID映射匿名用户anonymous,适合公用目录。
no_all_squash           保留共享文件的UID和GID(默认)
root_squash             root用户的所有请求映射成如anonymous用户一样的权限(默认)
no_root_squas           root用户具有根目录的完全管理访问权限
anonuid=xxx             指定NFS服务器/etc/passwd文件中匿名用户的UID
 anongid=xxx             指定NFS服务器/etc/passwd文件中匿名用户的GID
 
配置文件/etc/exports内容如下:
 
$ cat /etc/exports
 /home/share 192.168.1.15(rw,sync) *(ro)
配置说明: 对192.168.1.15赋予读写权限,其他机器仅有只读权限。
 
Use the file /etc/exports to configure your shares. Example: 
 
/mnt/sda2   192.168.1.2,192.168.1.3,192.168.1.4(ro,sync,no_subtree_check)
/mnt/sda3   192.168.1.2(rw,sync,no_subtree_check)
/mnt/sda4   192.168.1.0/255.255.255.0(rw,sync,no_root_squas)  
 
 
root@lsgxbsd:~ # vi /etc/exports
--------------------------------------
/   -maproot=0 -network 192.168.195.0 -mask 255.255.255.0
--------------------------------------
重新加载export配置文件:
root@lsgxbsd:~ # killall -HUP mountd 或者   root@lsgxbsd:~ #  /etc/rc.d/mountd onereload   或者   root@lsgxbsd:~ #  kill -HUP `cat /var/run/mountd.pid`
 
nfs服务器端运行:
root@lsgxbsd:~ # /etc/rc.d/rpcbind restart
root@lsgxbsd:~ #   nfsd -u -t -n 4 
root@lsgxbsd:~ #  mountd -r
 
//查看当前共享的目录 
root@lsgxbsd:~ # showmount -e 192.168.195.166
 
nfs客户端运行:
root@lsgxbsd:~ #  nfsiod -n 4
 
nfs加锁服务支持:(一般不使用)
root@lsgxbsd:~ #  /etc/rc.d/lockd restart
root@lsgxbsd:~ #  /etc/rc.d/statd restart
 
创建一般挂载的路径文件夹
root@lsgxbsd:~ # mkdir /mnt/nfs
root@lsgxbsd:~ # mkdir /mnt/image
root@lsgxbsd:~ #  chmod 777 /mnt/ nfs
root@lsgxbsd:~ #  chmod 777 /mnt/ image
 
手动挂载nfs文件夹目录
root@lsgxbsd:~ # mount -t nfs -o wsize=1024,rsize=1024 192.168.195.166:/ /mnt/nfs/
root@lsgxbsd:~ # df -h
root@lsgxbsd:~ # ls -alh /mnt/nfs/
root@lsgxbsd:~ # umount /mnt/nfs/
 
 
开机自动挂载nfs文件夹目录:
root@lsgxbsd:~ # vi /etc/fstab
----------------------------------------------
# Device Mountpoint FStype Options Dump Pass#
/dev/da0p2 none swap sw 0 0
proc /proc procfs rw 0 0
linproc /compat/linux/proc linprocfs rw 0 0
fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0
#localhost://mnt/nfsnfsrw,rsize=1024,wsize=102400#
 
----------------------------------------------
 
 
配置/etc/rc.conf
root@lsgxbsd:/mnt # cat /etc/rc.conf
--------------------------------------------------------------
hostname="lsebsd.lsgxeva"
keymap="us.iso"
#ifconfig_em0="DHCP"
ifconfig_em0="inet 192.168.195.166 netmask 255.255.255.0"
ifconfig_em0_ipv6="inet6 accept_rtadv"
#ifconfig_em1="DHCP"
ifconfig_em1="inet 192.168.1.166 netmask 255.255.255.0"
ifconfig_em1_ipv6="inet6 accept_rtadv"
#ifconfig_em2="DHCP"
ifconfig_em2="inet 192.168.2.166 netmask 255.255.255.0"
ifconfig_em2_ipv6="inet6 accept_rtadv"
#ifconfig_em3="DHCP"
ifconfig_em3="inet 192.168.185.166 netmask 255.255.255.0"
ifconfig_em3_ipv6="inet6 accept_rtadv"
defaultrouter="192.168.195.2"
static_routes="net1 net2 net3 net4" 
route_net1="-net 192.168.195.0/24 192.168.195.2" 
route_net2="-net 192.168.1.0/24 192.168.1.1"
route_net3="-net 192.168.2.0/24 192.168.2.1"
route_net4="-net 192.168.185.0/24 192.168.185.201"
local_unbound_enable="YES"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
snd_hda_load="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
 
# Beginning of the block added by the lsgx - DO NOT EDIT
 
hald_enable="YES" 
dbus_enable="YES"
avahi_daemon_enable="YES"
avahi_dnsconfd_enable="YES"
#slim_enable="YES"
 
saver="YES"
allscreens_flags="MODE_332"
blanktime="10"
 
# kldunload linux 
# options COMPAT_LINUX 
linux_enable="YES"
 
# git daemon
git_daemon_enable="YES"
 
# smartmontools configure
smartd_enable="YES"
 
inetd_enable="YES"
 
# samba configure
#samba_enable="YES"
samba_server_enable="YES"
nmbd_enable="YES"
smbd_enable="YES"
winbindd_enable="YES"
 
# nfs server setting
rpcbind_enable="YES"
rpc_statd_enable="YES"
rpc_lockd_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
mountd_flags="-r"
 
#rpc_lockd_enable="YES"
#rpc_statd_enable="YES"
 
# nfs client setting
nfs_client_enable="YES" 
nfs_client_flags="-n 4" 
 
# End of the block added by the lsgx
 
------------------------------------------------------
root@lsgxbsd:~ #  sh /etc/rc 
 
 
 
vsftp安装设置
讓 vsftp 以 inetd 的方式運作
root@lsgxbsd:~ # cd /usr/ports/ftp/vsftpd
root@lsgxbsd:/usr/ports/ftp/vsftpd # make install clean
 
root@lsgxbsd:/usr/ports/ftp/vsftpd # vi /etc/rc.conf
------------------------------------
inetd_enable="YES"
-------------------------------------
 
root@lsgxbsd:/usr/ports/ftp/vsftpd # vi /etc/inetd.conf
-----------------------------------------------------------------------
#ftp    stream  tcp nowait  root    /usr/libexec/ftpd   ftpd -l
#ftp    stream  tcp6    nowait  root    /usr/libexec/ftpd   ftpd -l
ftp stream  tcp nowait  root    /usr/local/libexec/vsftpd   vsftpd
ftp stream  tcp6    nowait  root    /usr/local/libexec/vsftpd   vsftpd
ssh stream  tcp nowait  root    /usr/sbin/sshd      sshd -i -4
ssh stream  tcp6    nowait  root    /usr/sbin/sshd      sshd -i -6
 
-----------------------------------------------------------------------------------
 
root@lsgxbsd:/usr/ports/ftp/vsftpd # vi /usr/local/etc/vsftpd.conf
------------------------------------------------------------------------------------
# Example config file /usr/local/etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to blah FTP service by lsgx at freebsd.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
ls_recurse_enable=NO
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=NO
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
secure_chroot_dir=/usr/local/share/vsftpd/empty
 
# If using vsftpd in standalone mode, uncomment the next two lines:
# listen=YES
# background=YES
 
-----------------------------------------------------------------------
 
root@lsgxbsd:/usr/ports/ftp/vsftpd #  vi /etc/ftpusers
-----------------------------------------
#root
-----------------------------------------
 
重新啟動inted服務,讓配置生效
root@lsgxbsd:/usr/ports/ftp/vsftpd # /etc/rc.d/inetd restart
 
 
配置多个网卡和多个网关
root@lsgxbsd:~ # vi /etc/resolv.conf
-----------------------------------------------------
# Generated by resolvconf
search localdomain
# nameserver 192.168.195.2
# nameserver fe80::861b:5eff:fe6a:58fe%em0
 
nameserver 127.0.0.1
nameserver 192.168.195.2
nameserver 192.168.1.1
nameserver 192.168.2.1
nameserver 192.168.185.201
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
options edns0
 
-----------------------------------------------------------------
 
root@lsgxbsd:~ #  vim /etc/rc.conf
-----------------------------------------------------------------------
#ifconfig_em0="DHCP"
ifconfig_em0="inet 192.168.195.166 netmask 255.255.255.0"
ifconfig_em0_ipv6="inet6 accept_rtadv"
#ifconfig_em1="DHCP"
ifconfig_em1="inet 192.168.1.166 netmask 255.255.255.0"
ifconfig_em1_ipv6="inet6 accept_rtadv"
#ifconfig_em2="DHCP"
ifconfig_em2="inet 192.168.2.166 netmask 255.255.255.0"
ifconfig_em2_ipv6="inet6 accept_rtadv"
#ifconfig_em3="DHCP"
ifconfig_em3="inet 192.168.185.166 netmask 255.255.255.0"
ifconfig_em3_ipv6="inet6 accept_rtadv"
defaultrouter="192.168.195.2"
static_routes="net1 net2 net3 net4"
route_net1="-net 192.168.195.0/24 192.168.195.2"
route_net2="-net 192.168.1.0/24 192.168.1.1"
route_net3="-net 192.168.2.0/24 192.168.2.1"
route_net4="-net 192.168.185.0/24 192.168.185.201"
 
-----------------------------------------------------------------------
root@lsgxbsd:~ #  sh /etc/rc 
 
root@lsgxbsd:~ #  /etc/rc.d/routing restart
root@lsgxbsd:~ #  /etc/rc.d/netif restart
root@lsgxbsd:~ #  /etc/netstart restart
 
 
支持挂载exfat文件系统
$ cd /usr/ports/sysutils/ exfat-utils/
$ sudo make install clean
$ cd /usr/ports/sysutils/ fusefs-exfat/
$ sudo make install clean
$ sudo vim /etc/rc.conf
----------------------------------------
# fuse configure
fuse_enable="YES"
 
----------------------------------------
$ sudo vim /boot/loader.conf 
------------------------------------------
# fuse configure
fuse_load="YES"
 
------------------------------------------
$ sudo camcontrol devlist
$ sudo mount.exfat /dev/da1s4 /mnt/
 
 
 
# pkg  install  nmap
 
# pkg install mysql55-server
Message for mysql55-client-5.5.43_1:
* * * * * * * * * * * * * * * * * * * * * * * *
 
Please be aware the database client is vulnerable
to CVE-2015-3152 - SSL Downgrade aka "BACKRONYM".
You may find more information at the following URL:
 
http://www.vuxml.org/freebsd/36bd352d-299b-11e5-86ff-14dae9d210b8.html
 
Although this database client is not listed as
"affected", it is vulnerable and will not be 
receiving a patch. Please take note of this when
deploying this software.
 
* * * * * * * * * * * * * * * * * * * * * * * *
Message for mysql55-server-5.5.43:
************************************************************************
 
Remember to run mysql_upgrade the first time you start the MySQL server
after an upgrade from an earlier version.
 
************************************************************************
 
# pkg install apache24
Message for apache24-2.4.16:
To run apache www server from startup, add apache24_enable="yes"
in your /etc/rc.conf. Extra options can be found in startup script.
 
Your hostname must be resolvable using at least 1 mechanism in
/etc/nsswitch.conf typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.
 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
- apache24 default build changed from static MPM to modular MPM
- more modules are now enabled per default in the port
- icons and error pages moved from WWWDIR to DATADIR
 
   If build with modular MPM and no MPM is activated in 
   httpd.conf, then mpm_prefork will be activated as default
   MPM in etc/apache24/modules.d to keep compatibility with 
   existing php/perl/python modules!
 
Please compare the existing httpd.conf with httpd.conf.sample
and merge missing modules/instructions into httpd.conf!
 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
# pkg install p5-Apache2-SOAP
Message for ap24-mod_perl2-2.0.9,3:
===================================================================
Simple config:
 
  LoadModule perl_module libexec/apache24/mod_perl.so
  #PerlModule Apache::compat
  # your config comes here
 
For a more detailed version (including more options) refer to:
 
  docs/user/intro/start_fast.pod
 
or online:
 
  http://perl.apache.org/docs/2.0/user/intro/start_fast.html
 
The module can be enabled in
 etc/apache24/modules.d/260_mod_perl.conf
 
===================================================================
 
# pkg install ap24-mod_auth_pam2
# pkg install ap24-mod_authnz_external24
 
# pkg  install  php56
# pkg install php56-extensions
# pkg install php56-soap
 
# pkg install nusoap
# pkg install gsoap
# pkg install p5-SOAP-WSDL
 
# pkg install mod_php56
Message for mod_php56-5.6.13:
***************************************************************
 
Make sure index.php is part of your DirectoryIndex.
 
You should add the following to your Apache configuration file:
 
<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>
 
***************************************************************
 
# pkg  install  phpmyadmin
Message for phpMyAdmin-4.4.14.1:
phpMyAdmin-4.4.14.1 has been installed into:
 
    /usr/local/www/phpMyAdmin
 
Please edit config.inc.php to suit your needs.
 
To make phpMyAdmin available through your web site, I suggest
that you add something like the following to httpd.conf:
 
For Apache versions earlier than 2.4:
 
    Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
 
    <Directory "/usr/local/www/phpMyAdmin/">
Options none
AllowOverride Limit
 
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 .example.com
    </Directory>
 
For Apache version 2.4.x or above:
 
    Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
 
    <Directory "/usr/local/www/phpMyAdmin/">
Options None
AllowOverride Limit
 
Require local
    Require host .example.com
    </Directory>
 
SECURITY NOTE: phpMyAdmin is an administrative tool that has had several
remote vulnerabilities discovered in the past, some allowing remote
attackers to execute arbitrary code with the web server's user credential.
All known problems have been fixed, but the FreeBSD Security Team strongly
advises that any instance be protected with an additional protection layer,
e.g. a different access control mechanism implemented by the web server
as shown in the example.  Do consider enabling phpMyAdmin only when it
is in use.
 
 
# vi /etc/rc.conf
--------------------------------------------
# mysql configure
mysql_enable="YES"
 
# apache24 configure
apache24_enable="YES"
 
# php fpm configure
php_fpm_enable="YES"
 
----------------------------------------------
 
 
gsoap源码编译 (会和使用pkg安装的gsoap造成冲突: pkg install gsoap) 
 
================================================================================
INSTALLATION
================================================================================
 
See README.txt for an overview of the gSOAP software and more details on the
installation in case of a problem.
 
This part explains how gSOAP is built on your platform.
 
Using Autoconf/Automake
-----------------------
 
Requirements to configure and build the package with autoconf/automake:
 
1. Automake tools (make and GNU m4) to configure and build
2. Bison http://www.gnu.org/software/bison or the alternative Yacc
3. Flex http://flex.sourceforge.net 
4a. either OpenSSL (for optional HTTPS) http://www.openssl.org
4b. or GNUTLS (for optional HTTPS) http://www.gnu.org/software/gnutls/
4c. or disable SSL support (./configure --disable-ssl)
5. Zlib (optional, to support compression) http://www.zlib.net
6. Pthreads or win32 threads (optional)
 
See Installation Instructions below.
 
I do not have/want Automake! What should I do?
----------------------------------------------
 
No problem.
 
If autoconf/automake are not available or if 'configure' and 'make' fail for
some reason, you can still build the 'soapcpp2' and 'wsdl2h' tools with the
provided generic makefiles.
 
To do so, use the command line to run 'make' with generic makefiles:
 
$ cd gsoap/src
$ make -f MakefileManual
$ cd gsoap/wsdl
$ make -f MakefileManual
 
This builds 'soapcpp' with 'gcc' and 'wsdl2h' with 'g++' and installs the
binaries in gsoap/bin. Move them to a bin directory or include them in your
executable path.
 
To build 'wsdl2h' with HTTPS enabled (assuming OpenSSL is installed), use:
 
$ cd gsoap/wsdl
$ make -f MakefileManual secure
 
To compile with a different compiler instead of GCC, for example 'clang', use:
 
$ cd gsoap/src
$ make CC=clang -f MakefileManual
$ cd gsoap/wsdl
$ make CC=clang CPP=clang++ -f MakefileManual secure
 
Some systems may require additional libraries to build 'wsdl2h', for example
Sun OS:
 
$ cd gsoap/wsdl
$ make CC=CC CPP=CC SOCKLIB='-lsocket -lnsl -lxnet' -f MakefileManual secure
 
The above commands to build 'soapcpp2' assume you have Bison and Flex
installed. To use Yacc instead, please use:
 
$ cd gsoap/src
$ make YACC='yacc -d -v -s soapcpp2_yacc' CMFLAGS='-DWITH_YACC -DWITH_FLEX' -f MakefileManual
 
If you do not have the Bison tool, please download and install it from here:
 
http://www.gnu.org/software/bison/
 
If you do not have the Flex tool, please download and install it from here:
 
      http://flex.sourceforge.net
 
For your project builds, use the stdsoap2.c and stdsoap2.cpp sources rather
than the libgsoap libs, as the libs are not built. To enable SSL, GZIP, HTTP
cookies, IPv6 support, and/or force C locale usage, use the compiler flags:
 
-DWITH_OPENSSLto enable SSL, link with OpenSSL
-DWITH_GNUTLSto enable SSL, link with GNUTLS
-DWITH_GZIPto enable compression, link with Zlib
-DWITH_COOKIESto enable HTTP cookies
-DWITH_IPV6to enable IPv6
-DWITH_C_LOCALEto force C locale
 
Note: these flags when set must be used to compile ALL your sources to ensure
consistency.
 
What if I cannot install Bison and Flex?
----------------------------------------
 
Included in gsoap/src are the flex-generated file 'lex.yy.c' and
bison-generated files 'soapcpp2_yacc.tab.h' and 'soapcpp2_yacc.tab.c'. These
files may suffice (no guarantee however) to build 'soapcpp2' as follows:
 
$ cd gsoap/src
$ make -f MakefileManual soapcpp2
 
In case the files 'lex.yy.c', 'soapcpp2_yacc.tab.h', and 'soapcpp2_yacc.tab.c'
were deleted in a prior build run, please unarchive the gSOAP package again
to retrieve these original files.
 
Windows Users
-------------
 
Win32 binaries and project code is included in this package. Win32 users can
start right away without autoconf/automake. The 'soapcpp2.exe' binary compiler
and 'wsdl2h.exe' WSDL parser are included in 'gsoap/bin/win32', see also the
'gsoap/VisualStudio2005' folder for the tool project files. The 'soapcpp2.exe'
and 'wsdl2h.exe' tools are command-line based and should be invoked from within
the IDE to process WSDL, XSD, and gSOAP service specification header files:
 
.wsdl .xsd --> wsdl2h.exe --> .h (special .h formatted with gSOAP annotations)
                              .h --> soapcpp2.exe --> .h .c .cpp .xml ...
 
Win32 build needs "ws2_32.lib". To do this in Visual Studio C++ 6.0, go to
"Project", "settings", select the "Link" tab (the project file needs to be
selected in the file view) and add "ws2_32.lib" to the "Object/library modules"
entry
 
Visual Studio 2005: you must install the Platform SDK (R2)
 
Dependences (stdsoap2.h and stdsoap2.c/.cpp include specific comments on this):
 
winsock2.h
ws2tcpip.h
ws2spi.h
Ws2_32.lib
 
Please note that the package includes mvc makefiles to build 'soapcpp2.exe' and
'wsdl2h.exe':
 
gsoap/src/Make_mvc.mak
gsoap/wsdl/Make_mvc.mak
 
Symbian
-------
 
Symbian instructions and example code is located in 'gsoap/Symbian'.
 
Palm
----
 
Palm OS support is no longer available for this release. The latest stable
release with Palm OS support is gSOAP 2.7.8c.
 
Tandem NonStop
--------------
 
See gsoap/TandemNonStop for instructions.
 
Installation Instructions
-------------------------
 
To build gSOAP on your platform using autoconf/automake, please enter the
following commands:
 
$ ./configure
$ make
$ make install
 
This will install the executables and libraries on your system (and you need
root access to do so).
 
To build without the default OpenSSL SSL/TLS support, use:
 
$ ./configure --disable-ssl
$ make
$ make install
 
To build with GNUTLS SSL/TLS support, use:
 
$ ./configure --enable-gnutls
$ make
$ make install
 
IMPORTANT: the WS-Security WSSE plugin requires OpenSSL and will not build with
GNUTLS. This limitation is being addressed, so please check future 2.8.x
releases.
 
To configure and build the examples, use the --enable-samples option:
 
$ ./configure --enable-samples
 
To configure and build the libraries in DEBUG mode, which produces 'SENT.log',
'RECV.log' and 'TEST.log' files for message logs and gSOAP engine event logs,
use:
 
$ ./configure --enable-debug
 
To enable IPV6 support, use:
 
$ ./configure --enable-ipv6
 
If you do not want the libraries to depend on a global namespace table (.nsmap
file content), use:
 
$ ./configure --disable-namespaces
 
However, you MUST set a namespace table at runtime with soap_set_namespaces()
right after initialization with soap_init() or soap_new() to ensure that a
namespace mapping table is used by the engine context.
 
If you want to install the executables in your local folder, enter:
 
$ ./configure
$ make
$ make install exec_prefix=$HOME
 
Summary
-------
 
To build your projects, you need the following executables:
 
wsdl2h the gSOAP WSDL/schema parser and code generator
soapcpp2 the gSOAP stub/skeleton/serialization generator
 
Pre-built executables of these for select platforms can be found in gsoap/bin.
 
You also need the following libraries (built from stdsoap2.c[pp]):
 
libgsoap++.a C++ runtime
libgsoapck++.a C++ runtime with HTTP cookie support
libgsoapssl++.a C++ runtime with cookies, zlib, and SSL
libgsoap.a C runtime
libgsoapck.a C runtime with HTTP cookie support
libgsoapssl.a C runtime with cookies, zlib, and SSL
 
Or you can use the stdsoap2.c and stdsoap2.cpp source directly, but you need to use the propoer -DWITH_X flags to enable support for 'X' (see above).
 
This version of gSOAP requires SSL support with OpenSSL 0.9.6 or later.
 
 
$ ./configure --enable-debug
$ gmake
$ gmake install exec_prefix=$HOME
 
编译 apache2 mod_soap.so 动态链接库模块
# cd ~/work/gsoap-2.8/gsoap/mod_gsoap/mod_gsoap-0.9/apache_20/
# ln -s ../../../stdsoap2.h .
# apxs -a -i -c mod_gsoap.c
 
修改MySql的密码为123456
/usr/local/bin/mysqladmin -u root -p password 123456 
 
mysql设置root远程访问
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
 
# service mysql-server restart
 
 
 
3种方法修改PHP时区
PHP5.2.4之前的版本无需设置时区。下面是修改PHP时区的三个办法。
1、修改PHP.ini这个文件
找到date.timezone这行,去掉前面的分号,改成:
date.timezone = Asia/Shanghai
 
2、修改 .htaccess文件
修改.htaccess文件有两种办法,下面的两条语句只要有一条即可
php_value date.timezone Asia/Shanghai
SetEnv TZ Asia/Shanghai
 
3、修改PHP代码
也是下面的两条语句只要其中的一句即可
date_default_timezone_set('Asia/Shanghai');
ini_set('date.timezone','Asia/Shanghai');
例如: <?php date_default_timezone_set('Asia/Shanghai'); ?>
 
 
phpinfo.php
----------------------------------------------------
<?php
date_default_timezone_set('Asia/Shanghai');
ob_start();
phpinfo();
$body = ob_get_contents();
$body = str_replace("<body><div class=\"center\">","<body><style type='text/css'>table{ width:480px; }</style><div class=\"center\" width='595' style='word-break: break-all'>",$body);
ob_end_clean();
echo $body;
?>
----------------------------------------------------
 
 
root@lsebsd:/usr/local/www/phpMyAdmin # ls -alh config.inc.php
-rw-r--r--  1 root  wheel   6.5K 10  8 23:11 config.inc.php
 
root@lsebsd:/usr/local/www/phpMyAdmin # ls -alh config-db.php 
-rw-r--r--  1 root  wheel   543B 10  8 23:11 config-db.php
 
root@lsebsd:/usr/local/www/phpMyAdmin # cat config.inc.php
--------------------------------------------------------------------
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use setup/
 *
 * All directives are explained in documentation in the doc/ folder
 * or at <http://docs.phpmyadmin.net/>.
 *
 * @package PhpMyAdmin
 */
 
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'lsebsdmyphpmyadmin'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
 
/**
 * 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++;
 
/**
 * Read configuration from dbconfig-common
 * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
 */
/*if (check_file_access('/usr/local/www/phpMyAdmin/config-db.php')) {
    require('/usr/local/www/phpMyAdmin/config-db.php');
}*/
    require('/usr/local/www/phpMyAdmin/config-db.php');
 
/* Configure according to dbconfig-common if enabled */
if (!empty($dbname)) {
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    if (empty($dbserver)) $dbserver = 'localhost';
    $cfg['Servers'][$i]['host'] = $dbserver;
 
    if (!empty($dbport) || $dbserver != 'localhost') {
        $cfg['Servers'][$i]['connect_type'] = 'tcp';
        $cfg['Servers'][$i]['port'] = $dbport;
    }
    //$cfg['Servers'][$i]['compress'] = false;
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    /* Optional: User for advanced features */
    $cfg['Servers'][$i]['controluser'] = $dbuser;
    $cfg['Servers'][$i]['controlpass'] = $dbpass;
    /* Optional: Advanced phpMyAdmin features */
    $cfg['Servers'][$i]['pmadb'] = $dbname;
    $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]['table_uiprefs'] = 'pma_table_uiprefs';
    $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
    $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
    $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
    $cfg['Servers'][$i]['recent'] = 'pma_recent';
 
    /* Uncomment the following to enable logging in to passwordless accounts,
     * after taking note of the associated security risks. */
    // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
 
    /* Advance to next server for rest of config */
    $i++;
}
 
/*
 * Servers configuration
 */
//$i = 0;
 
/*
 * First server
 */
//$i++;
/* Authentication type */
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
//$cfg['Servers'][$i]['connect_type'] = 'tcp';
//$cfg['Servers'][$i]['compress'] = false;
//$cfg['Servers'][$i]['AllowNoPassword'] = false;
 
/*
 * phpMyAdmin configuration storage settings.
 */
 
/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
 
/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $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]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
// $cfg['Servers'][$i]['users'] = 'pma__users';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
 
/*
 * End of servers configuration
 */
 
/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
 
/**
 * Whether to display icons or text or both icons and text in table row
 * action segment. Value can be either of 'icons', 'text' or 'both'.
 */
//$cfg['RowActionType'] = 'both';
 
/**
 * Defines whether a user should be displayed a "show all (records)"
 * button in browse mode or not.
 * default = false
 */
//$cfg['ShowAll'] = true;
 
/**
 * Number of rows displayed when browsing a result set. If the result
 * set contains more rows, "Previous" and "Next".
 * default = 30
 */
//$cfg['MaxRows'] = 50;
 
/**
 * disallow editing of binary fields
 * valid values are:
 *   false    allow editing
 *   'blob'   allow editing except for BLOB fields
 *   'noblob' disallow editing except for BLOB fields
 *   'all'    disallow editing
 * default = blob
 */
//$cfg['ProtectBinary'] = 'false';
 
/**
 * Default language to use, if not browser-defined or user-defined
 * (you find all languages in the locale folder)
 * uncomment the desired line:
 * default = 'en'
 */
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';
 
/**
 * How many columns should be used for table display of a database?
 * (a value larger than 1 results in some information being hidden)
 * default = 1
 */
//$cfg['PropertiesNumColumns'] = 2;
 
/**
 * Set to true if you want DB-based query history.If false, this utilizes
 * JS-routines to display query history (lost by window close)
 *
 * This requires configuration storage enabled, see above.
 * default = false
 */
//$cfg['QueryHistoryDB'] = true;
 
/**
 * When using DB-based query history, how many entries should be kept?
 *
 * default = 25
 */
//$cfg['QueryHistoryMax'] = 100;
 
/**
 * Should error reporting be enabled for JavaScript errors
 *
 * default = 'ask'
 */
//$cfg['SendErrorReports'] = 'ask';
 
/*
 * You can find more configuration options in the documentation
 * in the doc/ folder or at <http://docs.phpmyadmin.net/>.
 */
?>
--------------------------------------------------------------------
 
 
root@lsebsd:/usr/local/www/phpMyAdmin # cat config-db.php 
--------------------------------------------------------------------
<?php
##
## database access settings in php format
## automatically generated from /etc/dbconfig-common/phpmyadmin.conf
## by /usr/sbin/dbconfig-generate-include
## Sat, 18 Jul 2015 09:53:22 +0800
##
## by default this file is managed via ucf, so you shouldn't have to
## worry about manual changes being silently discarded.  *however*,
## you'll probably also want to edit the configuration file mentioned
## above too.
##
$dbuser='phpmyadmin';
$dbpass='123456';
$basepath='';
$dbname='phpmyadmin';
$dbserver='';
$dbport='';
$dbtype='mysql';

本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-07/132969.htm

linux
相关资讯       FreeBSD安装  FreeBSD10.1