跳至內容
WMの写本
使用者工具
登入
網站工具
搜尋
工具
顯示頁面
舊版
反向連結
最近更新
多媒體管理器
網站地圖
登入
>
最近更新
多媒體管理器
網站地圖
您在這裏:
start
»
computer
»
os
»
freebsd
足跡:
computer:os:freebsd
本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。
======FreeBSD====== * http://twbsd.org/ * [[http://antbsd.twbbs.org/~ant/FNP/|FreeBSD Newbie Project]] * [[http://www.freebsd.org/doc/zh_TW/books/handbook/|FreeBSD 使用手冊]] * [[http://www.study-area.org/2freebsd/|Study Area]] * [[http://pank.org/blog/2009/09/freebsd-utf-8-console-settings.html|FreeBSD UTF-8 Console Settings]] * [[http://bojack.pixnet.net/blog/post/12983723|用 Ports 安裝 Apache + PHP + MySQL]] * [[http://izero.pixnet.net/blog/post/22823528|自己製作的SSL過期怎麼辦?]] ====常用指令==== *依檔案大小排序<code>ls -S</code> *查看硬碟用量<code>df -h</code> *查看資料夾用量<code>du -h</code> *pure-ftpd查看即時狀況<code>pureftp-who</code> *FTP傳輸紀錄<code>tail /var/log/xferlog</code> *CVSUP<code>cvsup -g -L 2</code>接上檔案 ====Ports管理==== * [[http://antbsd.twbbs.org/~ant/FNP/faq/ports_pkg.php#local-time-not-match|安裝 ports 出現 local modification time does not match remote 的錯誤訊息]] *強迫重裝<code>make -DFORCE_PKG_REGISTER reinstall</code> *修正關聯<code>pkgdb -F</code> *更新 <code> portsdb -Fu pkgdb -F portupgrade -aWy portupgrade -arR </code> *Patch libiconv <code> 先到 /usr/ports/converters/libiconv/ 執行 make clean make extract 之後把patch過的big5.h和ces_big5.h放到 /usr/ports/converters/libiconv/work/libiconv-1.9.2/lib 取代掉原有的檔案,之後回到/usr/ports/converters/libiconv/執行 make deinstall make install 這樣就完成了 </code> ===需要裝的=== *portupgrade \\ 升級套件用 *portaudit ===FSCK設定=== *在/etc/rc.conf加入 <code> fsck_y_enable="YES" background_fsck="NO" </code> ====Apache設定==== * 設定檔\\ <code>/usr/local/etc/apache22/httpd.conf</code> * 重新啟動\\ <code>/usr/local/etc/rc.d/apache22 restart</code> ===Logs Rotate==== * apache 的 log 需要定期 rotate ,要不然會爆炸。可以直接透過 newsyslog 來做,直接把下面這兩行加入你的 /etc/newsyslog.conf <code> /var/log/httpd-access.log 644 3 1 @T00 Z /var/log/httpd-error.log 644 3 1 @T00 Z /var/run/httpd.pid </code> ===Virtual Host=== <code> <VirtualHost *:80> ServerAdmin wm@gmail.com DocumentRoot /usr/local/www/apache22/data/ ServerName kidwm.net ErrorLog /var/log/httpd-error.log CustomLog /var/log/httpd-access.log combined </VirtualHost> </code> ===傳輸壓縮==== * mod_deflate\\ http://yblog.org/archive/index.php/5318 <code> <ifmodule mod_deflate.c> DeflateCompressionLevel 9 AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php AddOutputFilter DEFLATE js css </ifmodule> </code> ===Alias轉換=== <code> # phpMyAdmin Alias /phpma/ "/backend/phpma/" <Directory "/backend/phpma"> AllowOverride FileInfo AuthConfig Limit Options Indexes FollowSymlinks MultiViews </Directory> </code> ===擋機器人==== <code> -- <LIMIT GET POST> Order allow,deny Allow from all # baidu Deny from 61.135.0.0/16 # yahoo Deny from 66.196.90.0/24 # yahoo china Deny from 202.160.0.0/16 # openfind Deny from 140.123.101.0/24 # baidu Deny from 202.108.0.0/16 # sogou Deny from 220.181.0.0/16 # openfind Deny from 210.201.54.0/24 </LIMIT> -- </code> ====DNS與named設定==== *<code>rndc-confgen -s 163.19.163.93 -a</code> *注意!named.conf要把listen-on那行comment掉,這樣外部IP的才會處理 *設定檔位置:/etc/namedb/master/kidwm.fwd *啟動: /etc/rc.d/named start ====Mail程式設定==== ===mutt=== * 設定檔在<code>~/.muttrc</code> * 設定檔內容:<code>my_hdr From: "OO, XX" <xxx@CCCA.NCTU.edu.tw> set send_charset="big5" charset-hook us-ascii big5 charset-hook iso-8859-1 big5 set charset=big5 set locale="zh_TW.big5"</code> ====crontab 排程==== * 使用者設定指令:<code>crontab -e</code> * 預設執行的Shell不同,需手動設定<code>SHELL=/bin/tcsh</code> * 執行結果不通知使用者<code>MAILTO=""</code> ====cvsup 更新==== * http://freebsd.lab.mlc.edu.tw/CVSup.htm * <code>cd /usr/ports/net/cvsup-without-gui ; make install clean distclean</code> * <code>SUPHOST= cvsup7.tw.FreeBSD.org</code> * <code>SUPFILE= /usr/share/examples/cvsup/standard-supfile</code> * <code>PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile</code> ====PPPoE設定==== * http://wireless.tkwu.net/forum/showthread.php?threadid=194 * http://eddyshieh.pixnet.net/blog/post/872044 * http://antbsd.twbbs.org/~ant/FNP/Network/pppoe_with_firewall.php * http://bojack.pixnet.net/blog/post/4305438 ====Firewall設定==== 舉例來說, freebsd.nctu 的 /etc/rc.conf <code> firewall_enable="YES" firewall_script="/usr/local/sbin/firewall.sh" </code> 然後寫一個 /usr/local/sbin/firewall.sh 放 rule 就好了 /etc/rc.firewall 是給不會詳細設定的人, 可以簡單用一個選項來選擇目前機器是什麼情況下來啟動 firewall rule <code> -- #!/bin/sh fwcmd="/sbin/ipfw -q" # flush ${fwcmd} -f flush # accept all packet from myself ${fwcmd} add allow ip from any to any via lo0 # mysql ${fwcmd} add deny tcp from any to me 3306 # 52834 ${fwcmd} add allow tcp from any to me 52834 limit src-addr 16 -- end </code> 要加規則就是在 lo0 後面加就好了 ===PF設定=== *在/etc/rc.conf裡面加入<code> pf_enable="YES" pf_rules="/etc/pf.conf" pf_flags="" pflog_enable="YES" pflog_logfile="/var/log/pflog" pflog_flags="" </code> *複製/usr/share/examples/pf/pf.conf這個範例檔到/etc下面 *開始修改/etc/pf.conf * 把<code>#ext_if="ext0"</code>這行取消註解,改成現用的對外網路卡裝置名稱。(忘了裝置名稱可以進rc.conf看一下) * 在#table <spamd-white> persist這行底下加入<code>table <taiwan> persist file "/etc/allow_taiwan"</code> * 最後面加上<code> pass in all pass out all block in on $ext_if proto tcp from any to $ext_if port 22 pass in on $ext_if proto tcp from <taiwan> to $ext_if port 22 keep state </code> * 參考[[http://pank.org/blog/2008/11/get-taiwan-ipv4-addresses-from.html|這篇文章]],將台灣的網段加入/etc/allow_taiwan檔案裡面。 ====安裝更新==== * http://zgod.pixnet.net/blog/post/10385401 * http://blog.outian.net/archives/18 * http://blog.gslin.org/archives/2006/03/20/464/ * http://twntwn.info/blog/ajer001/archives/1616 * http://notexist.wordpress.com/2006/08/23/slzzp%E6%8C%87%E5%B0%8E-makeconf%E8%B7%9Fportupgrade%E7%9B%B8%E9%97%9C/ ====參考資源==== FreeBSD與Postfix http://www.osal.org/index.php?option=com_content&task=view&id=16 in2長輩的裝機筆記 http://in2.wiki.ptt.cc/-installFreeBSD Rafa長輩的UTF8筆記 http://wiki.rafan.org/doc/utf8note [[http://atedev.wordpress.com/2009/11/05/unix-%E7%92%B0%E5%A2%83%E8%A8%AD%E5%AE%9A%E8%B3%87%E6%96%99%E6%95%B4%E7%90%86/|Unix 環境設定資料整理]]
computer/os/freebsd.txt
· 上一次變更: 2010/12/07 11:12 由
wm
頁面工具
顯示頁面
舊版
反向連結
回到頁頂