歡迎你

各類文章如有侵犯智慧財產權請來信告知--------607@dlps.tp.edu.tw

分类: FreeBSd预览模式: 普通 | 列表

爆肝升級FreeBSD12

讓我忙了很久,還好現在虛擬技術進步,終於讓我升級8.0------>>12.0
升級步驟差不多,重點是衝突修改

# freebsd-update fetch
# freebsd-update install
# freebsd-update -r 12.0-RELEASE upgrade
處理 merge conflict
衝突請用Vi修改,修改錯誤後面會無法開機,跳大級要修的更多
<<<<<<<<<<<<<<<<
{some code}
----
{new code}
>>>>>>>>>>>>>>>
# freebsd-update install
# shutdown -r now
# freebsd-update install(前面衝突沒有修改好會出錯)


修改後依然無法正常開機
mount /
mount_cd9660 /dev/acd0  /mnt

將有錯誤的檔案找光碟檔案覆蓋
/etc/rc.subr , /etc/defaults/rc.conf
完成開機後慢慢修改其他有問題的地方

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1491

freebsd9升級freebsd11

freebsd9升級freebsd11 放太久升級花費更多時間,一直無法升到12

升級順序
9.0----->9.1----->10.0----->10.1----->10.2----->11.0----->11.1
想要升到12卻一直無法成功(要修改的東西太多,服務少重新安裝比較快)

升級步驟
# freebsd-update fetch
# freebsd-update install
# freebsd-update -r 11.0-RELEASE upgrade
處理 merge conflict
衝突請用Vi修改,修改錯誤後面會無法開機,跳大級要修的更多(重新安裝有時會比較快)
<<<<<<<<<<<<<<<<
{some code}
----
{new code}
>>>>>>>>>>>>>>>
# freebsd-update install
# shutdown -r now
# freebsd-update install(前面衝突沒有修改好會出錯)

執行主要及次要版號升級
# pkg-static upgrade -f
# portmaster -af (安裝pkg install portmaster)
# freebsd-update install

更新ports
# portsnap fetch extract
# portsnap fetch update

# pkg
# pkg upgrade

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1459

Redis installed on FreeBSD

ntopng 安裝時需要安裝redis server
# pkg update
# pkg upgrade -y
# pkg install -y redis

/etc/rc.conf 加 redis_enable="YES"

確定是否啟用
sysrc redis_enable="YES"

檢查是否正在listenin
sockstat -4l

查看更多...

Tags: freebsd redis

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4021

使用 pkg 管理套件

# cd /usr/ports/ports-mgmt/pkg
# make
# make install clean

make install  FORCE_PKG_REGISTER="yes"  //安裝過的套件需要強制安裝

升級原舊版套件到既有系統pkg_換pkg
# pkg2ng
升級已安裝套件
#pkg upgrade
查詢已安裝在系統上的軟體是否有任何已知的漏洞
#pkg audit -F
自動移除不用的相依套件
#pkg autoremove
移除過時的套件
# pkg clean -a
安裝套件
pkg install <套件>

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2309

網路流量

pftop

#cd /usr/ports/sysutils/pftop
#make install clean

Trafshow

#cd /usr/ports/net/trafshow
#make install clean

Bandwidthd

#usr/ports/net-mgmt/bandwidthd
#make install clean
分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2883

升級

# freebsd-update upgrade -r 版本別-RELEASE

#freebsd-update install

以 Portupgrade 來升級已安裝的 Ports

# cd /usr/ports/ports-mgmt/portupgrade
# make install clean

# portupgrade -a              //升級系統上所有已裝的過舊 ports

#portupgrade -R   XXXXX  //升級某特定程式

# portupgrade -P XXXXX  //用 package 而非 port 來安裝 -PP強制用ports安裝

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1686

使用 Portmaster 升級 Port

# cd /usr/ports/ports-mgmt/portmaster
# make install clean

搜尋是否有新版
# portmaster -L

升級所有過時的 Port
# portmaster -a

升級並重新編譯所有 Port
# portmaster -af


分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2941

freebsd 系統及網路查詢

#sockstat                    //主機啟動服務及通訊 Port

#netstat                     //查詢網路連線狀況

#systat                      //查看、觀察系统状况
icmp, icmp6,ifstat, iostat, ip, ip6, mbufs, netstat, pigs, swap, tcp, vmstat

systat -tcp 1

#iftop
cd /usr/ports/net-mgmt/iftop
make install

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1815

核心編譯

#cd /usr/src

#make buildkernel KERNCONF=GENERIC      //核心編譯(預設核心)

#make installkernel KERNCONF=GENERIC    //安裝

#rm -rf /usr/obj/usr/src/sys/GENERIC         //刪除暫存

#reboot

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1696

openjdk6

pkg install openjdk6


        mount -t fdescfs fdesc /dev/fd
        mount -t procfs proc /proc


/etc/fstab

        fdesc   /dev/fd         fdescfs         rw      0       0
        proc    /proc           procfs          rw      0       0

修改conf/server.xml

<Engine>
    <Host attrs ...>
        <Context attrs ...>
        </Context>
    </Host>
</Engine>

改成
<Context path="/顯示" docBase="資料位置"
                  debug="5" reloadable="true" crossContext="true"...

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2076

portsnap

2013/3/23未來更新ports tree時,皆應使用portsnap,cvsup/csup已停止使用

修改 /etc/portsnap.conf
SERVERNAME=portsnap.tw.freebsd.org

# portsnap fetch                  //第一次

# portsnap extract              //第一次
      
#portsnap fetch update      //更新整個ports

# portsnap update             //日後更新

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2309

freebsd apache svn

1.cd /usr/ports/www/apache22
2.make WITH_BERKELEYDB=db42 install clean
3.cd /usr/ports/devel/subversion
4.make -DWITH_SVNSERVE_WRAPPER -DWITH_MOD_DAV_SVN -DWITH_APACHE2_APR install clean

SVN 基本環境
1.mkdir -p 放主目錄
2.mkdir -p /etc 放設定
3.svnadmin create 初始化
4.chown -R www:www

設定 Apache2
<Directory />
AllowOverride All
order allow,deny
Allow from All
</Directory>

設定 virtual host
<VirtualHost *:80>
DocumentRoot /主目錄前一層
ServerName localhost
<Location /svn>
DAV svn
  SVNParentPath  /主目錄前一層
AuthType Basic
AuthName “Svn ”
AuthUserFile /etc/svn-auth-file
AuthzSVNAccessFile /svn-access-file
Require valid-user
</Location>
</VirtualHost>

建立存取帳號
1.htpasswd -c /svn-auth-file USER1
2.htpasswd /svn-auth-file USER2
建立存取權限
/svn-access-file
[/]
USER1 = rw
USER2 = r

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2655

cvsup

#cd /usr                          //切換路徑
#rehash                           //才不會出現指令無效訊息 (csup: Command not found.)
cvsup -g -L 2  /xxxx/ports-supfile

#cd /usr/ports ; make fetchindex

#portsclean -CDLP

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2098

freeBSD更新

更新
# freebsd-update fetch
# freebsd-update install

升級8.1
# freebsd-update -r 8.1-RELEASE upgrade
freebsd-update install


升級8.2
# freebsd-update -r 8.2-RELEASE upgrade
freebsd-update install
分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2961

OpenNMS安裝----freebsd7.3

Building On FreeBSD7.3 From OpenNMS

環境
install Tomcat6
cd /usr/ports
make search key='tomcat'
找到install位置安裝

install PostgreSQL
參考資料庫安裝


下載OpenNMS
http://www.geeklan.co.uk/files/opennms/opennms-165-freebsd-port.tgz

解壓縮
tar -zxvf opennms-164-freebsd-port.tgz -C /usr/ports/net-mgmt/

要更新ports树,否则你安装会遇到很多麻烦

install opennms
cd /usr/ports/net-mgmt/opennms
make install

安装jdk
安装过程需要准备几个文件,缺的文件,系统会提示你去哪里下载,安装上面的提示下载就是了,比较麻烦。下载了以后把它们放到/usr/ports/distfiles/里面

安裝後的訊息!請跟著步驟作!

Once everything has been built & installed the following message will be shown on your screen:
1st run
${OPENNMSHOME}/bin/runjava -s------------->/usr/local/opennms/bin/runjava -s
Then create
${OPENNMSHOME}/etc/opennms.conf
& add
START_TIMEOUT=0 to it
then run
${OPENNMSHOME}/bin/install -dis
to initialise the DB
edit /etc/rc.conf & add
opennms_enable="YES"
& run
%%PREFIX%%/etc/rc.d/opennms start--------->/usr/local/etc/rc.d/opennms start
you should now be able to login to opennms by pointing your browser to
http://localhost:8980------------------>後來發現應http://localhost:8980/opennms/
u: admin
p: admin


Please make sure the hostname that your system is configured with is either resolvable via dns or locally via /etc/hosts
otherwise you will have issues trying to start OpenNMS.


查看更多...

Tags: OpenNMS

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6156

資料庫

一、mysql
      cd /usr/ports/databases/mysql50-server
      make WITH_CHARSET=big5 WITH_XCHARSET=all install clean
      cd /usr/ports/databases/php5-mysql
      make install clean
      
      vi  /etc/rc.conf
      mysql_enable="yes"
      /usr/local/etc/rc.d/mysql-server start
      
      設定sql
      /usr/local/bin/mysql mysql
     Update user SET password=password('XXXXXXXXXX') where user='root';
     FLUSH PRIVILEGES;
    

二、PostgreSQL
      cd /usr/ports/databases/postgresql82-server
      make install clean
      cd /usr/ports/databases/php5-pgsql
      make install clean
      
      vi  /etc/rc.conf
      postgresql_enable="YES"
      ...

查看更多...

Tags: 資料庫

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 3291

apache2/httpd.conf初步設定

 

/usr/local/etc/apache2/httpd.conf
Timeout 設定連線逾時
Timeout 300
 
KeepAlive 是否使用保持連線
KeepAlive On
 
MaxKeepAliveRequests 最多有幾個保持連線
MaxKeepAliveRequests 200
 
KeepAliveTimeout 保持連線的逾時時間
KeepAliveTimeout 15
 
User Group 設定執行時的使用者及群組
User www
Group www
 
ServerAdmin 設定郵件
ServerAdmin you@example.com
 
ServerName 設定主機名稱
ServerName XXX.XXX.XXX:80
 
DocumentRoot 設定網頁根目錄
DocumentRoot "/usr/local/www/apach22/data"
 
<Directory> </Directory> 設定目錄權限
<Directory />
    AllowOverride None
    order deny,allow
    Deny from all
</Directory>
AllowOverride 設定 .htaccess 中可以使用的項目
Order 設定 Allow 及 Deny 的順序,目錄中設定允許 (Allow) 及拒絕 (Deny) 的規則先後順序
我們先設定了 order 為 Deny, Allow,再設定允許所有連線
 
 
UserDir 設定使用者個人網頁
<IfModule mod_userdir.c>
UserDir public_html
 
UserDir disabled root toor daemon ..... pop www nobody mailnull smmsp
 
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS PROPFIND>
        order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
</IfModule>
 
 
DirectoryIndex 設定預設網頁檔名
DirectoryIndex index.php index.htm index.html index.html.var
 
 
HostnameLookups 設定將客戶端 IP 轉為 hostname
將這個功能設為 On 會造成連線的效率變慢很多
HostnameLookups Off
 
 
ErrorLog 指定錯誤記錄檔位置
ErrorLog /var/log/httpd-error.log
設定 Apache 連線記錄檔的位置
CustomLog /var/log/httpd-access.log combined
 
Alias 設定別名
Alias /mp3/ /home/alex/mp3/
 
ScriptAlias 設定 CGI 目錄
ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/"
 
分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 9539

freebsd7.0軟體安裝

1、確認 /usr/ports
     沒有的話使用 /stand/sysinstall 來安裝 ports 的目錄
       以 root 執行 /stand/sysinstall
     選擇 Configure 後按 Enter
     選擇 Distributions 後按 Enter
     選擇 ports 後按空白鍵
       選擇 Exit 後按 Enter
     選擇你要從 CDROM 或 FTP 安裝等
       跟著選單照做,最後離開 sysinstall
2、cd /usr/ports/net/cvsup-without-gui
     make install clean
     cp /usr/share/examples/cvsup/ports-supfile /root/
     cvsup -g -L 2 /root/ports-supfile

查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 3029

apache-php-mysql

apache
cd /usr/ports/www/apache22
make install clean

php
cd /usr/ports/lang/php5
make install clean

cd /usr/ports/lang/php5-extensions
make install clean

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2335

修改環境

安裝gunls
cd  /usr/ports/misc/gnuls
make  install

修改root環境
vi /root/.cshrc
alias ls    'gnuls -ah --color --show-control-chars'
alias ping    'ping -t 4'

kbdcontrol  -r  fast
set prompt = "`hostname -s`# "-------->set prompt = "%B%n@%m [%/] # "


修改user環境
vi /etc/csh.cshrc
setenv LC_CTYPE en_US.ISO_8859-1
alias ls    'gnuls -ah --color --show-control-chars'
set prompt = "%B%n@%m [%/] $ "
set autolist


查看更多...

分类:FreeBSd | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2521