[Up]常用資訊

[重點文章] 重點文章 [重點文章] 重點文章

2020年6月30日 星期二

[FreeBSD] FreeBSD 基本安裝

[FreeBSD] FreeBSD 基本安裝

 
#Step: 01 –FreeBSD 基本安裝
FreeBSD 基本安裝


設定 ssh 登入
vi /etc/ssh/sshd_config
===========================
PermitRootLogin yes  ## 開啟root用戶遠端登入
PasswordAuthentication yes ## 開啟ssh密碼登錄
UseDNS no
GSSAPIAuthentication no ## 提升ssh登錄速度
重新載入 sshd
/etc/rc.d/sshd restart

修改 /etc/pkg/FreeBSD.conf

將 quarterly --> latest

安裝更新

# freebsd-update fetch
# freebsd-update install

安裝與配置sudo
pkg install -y sudo

echo '%wheel ALL=(ALL) ALL' >/usr/local/etc/sudoers.d/allow-wheel-user-login

vim /usr/local/etc/sudoer

oscarwu          ALL=(ALL) ALL
%wheel ALL=(ALL) ALL

安裝相關軟體

vi /etc/rc.conf

vi /etc/pkg/FreeBSD.conf

將 quarterly --> latest

#設定固定IP
#ifconfig_em0="inet 192.168.13.4 netmask 255.255.255.0"
#defaultrouter="192.168.13.1"
#

安裝更新

# freebsd-update fetch
# freebsd-update install

# pkg install -y python37
# ln -s /usr/local/bin/python3.7 /usr/local/bin/python
# pkg install -y py37-pip
# pip --version 

# pkg install -y vim
# pkg install -y vim-console
# pkg install -y htop
# pkg install -y bind-tools
# pkg install -y unzip
# pkg install -y rsync
# pkg install -y bash
# pkg install -y most
# pkg install -y bash-completion
# pkg install -y vnstat
# pkg install -y wget
# pkg install -y curl
# pkg install -y git
# pkg install -y node-14.4.0
# pkg install -y yarn
# pkg install -y neovim
# pkg install -y net-snmp

編輯/etc/rc.conf 加上

snmpd_enable="YES"
snmpd_flags="-a"
snmpd_conffile="/usr/local/share/snmp/snmpd.conf /etc/snmpd.conf"
snmptrapd_enable="YES"
snmptrapd_flags="-a -p /var/run/snmptrapd.pid"


https://github.com/junegunn/vim-plug

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
	
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Reload .vimrc and 
:PlugInstall
to install plugins.

# FreeBSD 對 VMwareTools 安裝:

# pkg install -y open-vm-tools-nox11

# vim /etc/rc.conf

加入以下文字:

vmware_guest_vmblock_enable="YES"
vmware_guest_vmhgfs_enable="YES"
vmware_guest_vmmemctl_enable="YES"
vmware_guest_vmxnet_enable="YES"
vmware_guestd_enable="YES"

重新開機:

# reboot

mysql 啟動

/usr/local/etc/mysql/conf.d/

/usr/local/etc/mysql/my.cnf

修改
vi /usr/local/etc/mysql/my.cnf

/var/run/mysql/mysql.sock
設定
socket  = /var/run/mysqld/mysql.sock

mkdir /var/run/mysqld

touch /var/run/mysqld/mysql.sock

chown -R mysql /var/run/mysqld


沒有留言:

張貼留言