<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://netflow.kmseh.gov.tw/blog/styles/rss.css" type="text/css"?>
<rss version="0.91">

 <channel>
  <title>Oscar Blog</title>
  <link>http://netflow.kmseh.gov.tw/blog/blog/1</link>
  <description></description>
    <item>
   <title>安裝軟體的選項 make</title>
   <description> 
      &nbsp; 來源:資訊隨筆 (   http://140.111.152.155/blog/post/2/316   )  
 一般常用 ports 來安裝軟體的人，常常會看到類似下面的畫面 
    
 
 
 這一個畫面就是要您選擇編譯套件時所用的參數 
我們可以在安裝 ports 時，先用下面的指令來選擇編譯的參數，或顯示目前使用的參數，以及移除參數。 
 make config ：選擇套件要編譯時的參數 
 make showconfig ：顯示目前使用的參數 
以 lighttpd 為例 
#  make showconfig  
    ===&gt; The following configuration options are available for lighttpd-1.4.18_1: 
&nbsp;&nbsp;&nbsp;&nbsp; BZIP2=on &quot;Enable Bzip2 support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; CML=off &quot;Enable Cache Meta Language support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; FAM=off &quot;Enable fam/gamin support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; GDBM=off &quot;Enable gdbm storage support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; IPV6=off &quot;Enable IPV6 support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; MAGNET=off &quot;Enable magnet support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; MEMCACHE=off &quot;Enable memcached storage support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; MYSQL=on &quot;Enable MYSQL support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; OPENLDAP=on &quot;Enable LDAP support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; OPENSSL=on &quot;Enable SSL support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; VALGRIND=off &quot;Enable valgrind support&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; WEBDAV=off &quot;Enable WebDAV support&quot;  
 
 make rmconfig ：移除參數 
 
這些編譯時所用的參數，都儲存在  /var/db/ports  目錄之下，安裝時要選擇編譯參數的套件都出現在這裡，一個套件就會有一個目錄 
[root@freebsd /var/db/ports]#  ls  
     ImageMagick/&nbsp; isc-dhcp3-server/&nbsp; openldap23/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; phpMyAdmin/&nbsp;&nbsp; rsync/ 
awstats/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lftp/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; openldap24/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; portupgrade/&nbsp; samba3/ 
cacti/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lighttpd/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; php5/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pure-ftpd/&nbsp;&nbsp;&nbsp; vsftpd/ 
gettext/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mrtg/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; php5-extensions/&nbsp; rrdtool/  
 
以 lighttpd 為例，目錄下是一個 options 的檔案，檔案裡面就是編譯時所用的參數 
#  cd /var/db/ports/lighttpd  
#  cat options  
     # This file is auto-generated by 'make config'. 
# No user-servicable parts inside! 
# Options for lighttpd-1.4.18_1 
_OPTIONS_READ=lighttpd-1.4.18_1 
WITH_BZIP2=true 
WITHOUT_CML=true 
WITHOUT_FAM=true 
WITHOUT_GDBM=true 
WITHOUT_IPV6=true 
WITHOUT_MAGNET=true 
WITHOUT_MEMCACHE=true 
WITH_MYSQL=true 
WITH_OPENLDAP=true 
WITH_OPENSSL=true 
WITHOUT_VALGRIND=true 
WITHOUT_WEBDAV=true  
  
 </description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/21</link>
      <pubDate>Fri, 10 Apr 2009 16:27:43 +0800</pubDate>   
  </item>
    <item>
   <title>FreeBSD Ports 的管理</title>
   <description> 
 &nbsp;  來源:  資訊隨筆   (   http://140.111.152.155/blog/post/2/251   )      
 
 
 要執行底下的動作時，都要切換到該軟體在 Ports 的目錄之下 
1.安裝軟體 
 make install ：會自動執行所有的編譯原始碼及設定工作。 
2.Ports 選擇套件要編譯時的參數 
 make config :   選擇套件要編譯時的參數 
 3.移除軟體 
 make deinstall ：可以移除不要安裝的軟體。 
4.重新安裝軟體 
 make reinstall ：重新安裝軟體，執行之前要先用  make deinstall  先把軟體移除。 
5.移除  work  目錄中的檔案 
 make clean ：在安裝過程中，在  work  目錄中會有一些檔案，因為安裝完成之後就用不到了，所以可以用  make clean  指令將這些檔案刪除。  
 
  6.清除  /usr/ports/distfiles  目錄中的檔案 
 make distclean ：軟體安裝時，會在  /usr/ports/distfiles  下載一些軟體的原始程式碼，下次軟體在安裝時會檢查這裡是不是有需要的原始程式碼，如果您的空間不夠用，就可以把這些檔案清除。 
7. make install clean ：安裝軟體完畢後，馬上移除  work  目錄中的檔案，將所有編譯的記錄給清除掉。 
8. make unstall clean distclean ：安裝軟體完畢後，馬上移除  work  目錄中的檔案，將所編譯的記錄給清除掉，再接著把  /usr/ports/distfiles  目錄中的檔案刪除。 
 
如果您當時在安裝軟體時，並沒有加上 clean，之後想要把這些散落在各個軟體目錄之下的 work 目錄清除時，可以用下列的指令： 
#  find /usr/ports -depth -name work -exec rm -rf {} \;   </description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/20</link>
      <pubDate>Fri, 10 Apr 2009 15:54:08 +0800</pubDate>   
  </item>
    <item>
   <title>wwwcount計數器安裝</title>
   <description>  有沒有發現很多的網頁都有一個小小的計數器呢？ 
     目前最有名的計數器套件大概是 wwwcounter 這一套！就我所知的套件最新應該是 wwwcount2.6 版的樣子，不知道有沒有最新的....。  
    
 
    
  1.&nbsp; 下載與解壓縮：    
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# cd   &nbsp;/usr/local 
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# tar  &nbsp;-zxvf wwwcount2.6.tar.gz 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# cd  &nbsp;wwwcount2.6 
2.&nbsp;      修改    /usr/local/wwwcount2.6/builb 
 &nbsp;&nbsp;&nbsp;&nbsp; #vi     build 
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --with-cgi-bin-dir[=DIR]&nbsp;&nbsp;&nbsp;&nbsp; designated directory for CGI programs, 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default is    /var/www/cgi-bin 
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 上面的路徑與你的 apache 預設的 cgi-bin 的目錄有關！ 
 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     --prefix=dir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; counter base directory, default is 
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   /usr/local/etc/Counter     &nbsp; 
      &nbsp;&nbsp;&nbsp;&nbsp; 這是 wwwcount 安裝的目錄，我都喜歡安裝在 /usr/local 底下，所以設定成上面的目錄。 
 
 3.&nbsp;       修改    /usr/local/wwwcount2.6/Config.tmpl 
&nbsp;&nbsp;&nbsp;&nbsp; #vi Config.tmpl 
 
&nbsp;&nbsp;&nbsp;&nbsp; CGIBIN_DIR=&quot;/var/www/cgi-bin&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; BASE_DIR=&quot;/usr/local/etc/Counter&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; CONFIG_FILE=&quot;count.cfg&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 計數器設定檔的檔名  
&nbsp;&nbsp;&nbsp;&nbsp; CONFIG_DIR=&quot;/usr/local/etc/Counter/conf&quot;&nbsp;    計數器設定檔存放的位置 
 &nbsp;&nbsp;&nbsp;&nbsp; DIGIT_DIR=&quot;/usr/local/etc/Counter/digits&quot;&nbsp;&nbsp;  數字圖檔存放的位置  
&nbsp;&nbsp;&nbsp;&nbsp; DATA_DIR=&quot;/usr/local/etc/Counter/data&quot;&nbsp;&nbsp;&nbsp;&nbsp;  計數器  
&nbsp;&nbsp;&nbsp;&nbsp; DATABASE_DIR=&quot;/usr/local/etc/Counter/db&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; COUNT_DATABASE=&quot;Countdb&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; AUTH_DATABASE=&quot;Authdb&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; DB_LOCKFILE=&quot;Count.lck&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; TT_FONT_DIR=&quot;/usr/local/etc/Counter/fonts&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; LOG_DIR=&quot;/usr/local/etc/Counter/logs&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; ERROR_LOG_FILE=&quot;error.log&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; VISITOR_LOG_FILE=&quot;visitor.log&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; RGB_FILE=&quot;./data/rgb.txt&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; RGB_DIR=&quot;/usr/local/etc/Counter&quot; 
&nbsp;&nbsp;&nbsp;&nbsp; RGB_DATABASE=&quot;/usr/local/etc/Counter/db/rgbdb&quot; 
              
  4.&nbsp;       修改    /usr/local/wwwcount2.6/count.cfg 
      &nbsp;&nbsp;&nbsp;&nbsp; #vi count.cfg 
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [options] 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; auto_file_creation=Yes&nbsp; 　檔案自動建立 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strict_mode=No&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 　　 嚴格模式 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allow_rgb_database=Yes　允許xx資料庫 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count_reload=No　　　　計算_重載入 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log_error_messages=No　log錯誤訊息 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log_visitor_info=Yes　　log參觀者資訊 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log_rotation_interval=2592000　log循環間隔(時間)．．．我猜是log檔案每隔重新建立30天(2592000秒＝３０天）, 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果要測你可改少一點比如說1天＝86400 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; show_error_messages_to_browsers=Yes 秀錯誤訊息給瀏覽器        
 
  
 
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [authorized] 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    www.kmseh.gov.tw   &nbsp;&nbsp;&nbsp;&nbsp; WEB-Server 的主機名稱 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; www 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 203.64.152.2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WEB-Server 所使用的IP 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost 
 
 5.&nbsp;      編譯可執行檔！ 
&nbsp;&nbsp;&nbsp; # ./build --with-cgi-bin-dir=/var/www/cgi-bin --without-database 
&nbsp;&nbsp;&nbsp; # ./build --install        
 
 
      &nbsp;&nbsp;&nbsp; *** You are installing Counter as root ***       
 
     
 
 
 ------------------------------------------------------------------------- 
Your configuration is shown below. You are only allowed to change the 
cgi-bin directory. If you want to change it, edit the file Config.tmpl 
and change the variable CGIBIN_DIR to the appropriate directory. Do not change 
anything else.  
 
 
 cgi-bin directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = /var/www/cgi-bin 
conf directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = /usr/local/etc/Counter/conf 
conf file to install&nbsp;&nbsp;&nbsp; = count.cfg 
digit directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = /usr/local/etc/Counter/digits 
data directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = /usr/local/etc/Counter/data 
database directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = /usr/local/etc/Counter/db 
Counter database&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = Countdb 
Auth database&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = Authdb&nbsp;&nbsp;&nbsp;&nbsp; (you have to edit with editdb) 
TrueType font directory = /usr/local/etc/Counter/fonts 
Sample TrueType font&nbsp;&nbsp;&nbsp; = ./data/fonts/trebuc.ttf 
Log directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = /usr/local/etc/Counter/logs 
Error log file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = error.log 
Visitor log file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = visitor.log 
RGB file to install&nbsp;&nbsp;&nbsp;&nbsp; = ./data/rgb.txt  
 
 
 ------------------------------------------------------------------------- 
Press Control-C to abort 
Continue [y|n]?&nbsp;&nbsp;     &lt;== 看看你的設定正不正確，對的話就開始安裝吧！  &nbsp;  
 
  proceeding...   
 
 
 
  &nbsp;&nbsp;&nbsp; Now if you know what user and group id child processes of http 
&nbsp;&nbsp;&nbsp; server use, I can change the ownership and access permission 
&nbsp;&nbsp;&nbsp; accordigly. If you do not know, they are usually defined in the 
&nbsp;&nbsp;&nbsp; file httpd.conf with User and Group. I suggest create a unique 
&nbsp;&nbsp;&nbsp; user and group say httpd and set the User and Group to httpd.   
 
 
 *Do you know the user and group id of httpd' child process [y|n]:? y 
   你知不知道 apache 的使用者名稱與群組！若以&nbsp;OpenBsd 預設的  
   apache 來安裝 WWW 的話，那麼預設的名稱為&nbsp;www    
    *Enter user id of httpd's child process [no default]:? www 
*Enter group id of httpd's child process [no default]:? www  
   上面兩個都需要視你的設定而變，如果你不知道的話，  
那麼進入 httpd.conf 檔案中，去找一下相關的設定就 OK 了！      
 
 
     6. &nbsp;   變更檔案權限： 
#chown www:www /var/www/cgi-bin/Count.cgi 
#chown -R www:www /usr/local/etc/Counter/data   
 
    </description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/19</link>
      <pubDate>Mon, 03 Dec 2007 08:38:11 +0800</pubDate>   
  </item>
    <item>
   <title>在 OpenBSD 安裝 Webmin</title>
   <description> 
 Webmin 是一套圖形化的管理介面，方便管理者可以使用 GUI 介面來管理系統。 
Webmin 官方網站：   http://www.webmin.com/   
 目前最新的版本是 1.390 版  
 
 
   
 
 
	  將壓縮檔複製到/usr/local下並解開 
	      cp webmin-1.390.tar.gz /usr/local 
	tar -zxvf webmin-1.390.tar.gz       
	  進入webmin目錄中 
	      mv webmin-1.390 webmin 
	  cd webmin       
	    執行 
	 ./setup.sh      
	  webmin安裝在那一個目錄若在/etc/webmin則直接按 Enter 鍵 
	  Config file directory [/etc/webmin]: 
	  Log file安裝在那一個目錄若在/var/webmin則直接按 Enter 鍵 
	  Log file directory [/var/webmin]: 
	  perl的絕對路徑若在/usr/bin/perl則直接按 Enter 鍵 
	 Full path to perl (default /usr/bin/perl):   
	預設的埠號為10000則直接按 Enter 鍵，在browser連結時須   http://localhost:10000    
	  若更改埠號為9000則需輸入900 0 再按 Enter 鍵，在browser連結時須  http://localhost:9000   
	  Web server port (default 10000): 
	  Login name 若為admin直接按 Enter 鍵 
	  Login name (default admin): 
	  輸入密碼 
	  Login password: 
	    再輸入一次密碼 
	  Password again:    
	  安裝過程中的一些訊息 
	  *********************************************************************** 
	*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Welcome to the Webmin setup script, version 1.390&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * 
	*********************************************************************** 
	Webmin is a web-based interface that allows Unix-like operating 
	systems and common Unix services to be easily administered.  
 
 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Installing Webmin in /usr/local/webmin ...     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *********************************************************************** 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Webmin uses separate directories for configuration files and log files. 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Unless you want to run multiple versions of Webmin at the same time 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; you can just accept the defaults.     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Config file directory [/etc/webmin]: 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Log file directory [/var/webmin]:     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *********************************************************************** 
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Webmin is written entirely in Perl. Please enter the full path to the 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Perl 5 interpreter on your system.     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Full path to perl (default /usr/bin/perl):     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Testing Perl ... 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Perl seems to be installed ok     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *********************************************************************** 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Operating system name:&nbsp;&nbsp;&nbsp; OpenBSD 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Operating system version: 4.2     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *********************************************************************** 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Webmin uses its own password protected web server to provide access 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to the administration programs. The setup script needs to know : 
&nbsp;&nbsp; &nbsp;&nbsp; - What port to run the web server on. There must not be another 
&nbsp;&nbsp;&nbsp;&nbsp; web server already using this port. 
&nbsp;&nbsp;&nbsp;&nbsp; - The login name required to access the web server. 
&nbsp;&nbsp;&nbsp;&nbsp; - The password required to access the web server. 
&nbsp;&nbsp;&nbsp;&nbsp; - If the webserver should use SSL (if your system supports it). 
&nbsp;&nbsp;&nbsp;&nbsp; - Whether to start webmin at boot time.     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; Web server port (default 10000): 
&nbsp;&nbsp;&nbsp;&nbsp; Login name (default admin): root 
&nbsp;&nbsp;&nbsp;&nbsp; Login password: 
&nbsp;&nbsp;&nbsp;&nbsp; Password again: 
&nbsp;&nbsp;&nbsp;&nbsp; The Perl SSLeay library is not installed. SSL not available. 
&nbsp;&nbsp;&nbsp;&nbsp; Webmin does not support being started at boot time on your system. 
&nbsp;&nbsp;&nbsp;&nbsp; *********************************************************************** 
&nbsp;&nbsp;&nbsp;&nbsp; Creating web server config files.. 
&nbsp;&nbsp;&nbsp;&nbsp; ..done     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; Creating access control file.. 
&nbsp;&nbsp;&nbsp;&nbsp; ..done     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; Inserting path to perl into scripts.. 
&nbsp;&nbsp;&nbsp;&nbsp; ..done     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; Creating start and stop scripts.. 
&nbsp;&nbsp;&nbsp;&nbsp; ..done     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; Copying config files..     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; ..done     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; Creating uninstall script /etc/webmin/uninstall.sh .. 
&nbsp;&nbsp;&nbsp;&nbsp; ..done     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; Changing ownership and permissions .. 
&nbsp;&nbsp;&nbsp;&nbsp; ..done     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; Running postinstall scripts .. 
&nbsp;&nbsp;&nbsp;&nbsp; ..done     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; Attempting to start Webmin mini web server.. 
&nbsp;&nbsp;&nbsp;&nbsp; Starting Webmin server in /usr/local/webmin 
&nbsp;&nbsp;&nbsp;&nbsp; ..done     
 
 
    &nbsp;&nbsp;&nbsp;&nbsp; *********************************************************************** 
&nbsp;&nbsp;&nbsp;&nbsp; Webmin has been installed and started successfully. Use your web 
&nbsp;&nbsp;&nbsp;&nbsp; browser to go to     
 
 
 &nbsp;&nbsp; &nbsp;    http://localhost:10000/     
 
 
    &nbsp;&nbsp;&nbsp; and login with the name and password you entered previously.     
 
 
    &nbsp; 6. 如果開機就要啟動 Webmin，可以修改  /etc/rc.local  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #  vi /etc/rc.local  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 加入下面一行 
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /etc/webmin/start   &nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 手動啟動 Webmin 
&nbsp;&nbsp;&nbsp;&nbsp; #        /etc/webmin/start 
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 重新啟動 Webmin 
&nbsp;&nbsp;&nbsp;&nbsp; #    /etc/webmin/restart    
 </description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/18</link>
      <pubDate>Fri, 30 Nov 2007 11:39:51 +0800</pubDate>   
  </item>
    <item>
   <title>在 mvme88k 安裝 OpenBSD</title>
   <description> 
**先在tftp server端放 tftpboot 及 bsd.rd 檔 
**不要檢測硬體&nbsp;&nbsp;  ctrl + Pause Break   
 
 
3 
187-Diag&gt;SD 
 
 
**安裝 
187-Bug&gt; 
 
 
187-Bug&gt; NIOT 
&nbsp;&nbsp;&nbsp; Controller LUN = 00?   
&nbsp;&nbsp;&nbsp; Device LUN&nbsp;&nbsp;&nbsp;&nbsp; = 00?   
&nbsp;&nbsp;&nbsp; Node Control Memory Address = 01FF0000?   
&nbsp;&nbsp;&nbsp; Client IP Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =0.0.0.0?  163.32.123.199 
 &nbsp;&nbsp;&nbsp; Server IP Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =0.0.0.0?  163.32.123.200  
&nbsp;&nbsp;&nbsp; Subnet IP Address Mask = 255.255.255.0?   
&nbsp;&nbsp;&nbsp; Broadcast IP Address&nbsp;&nbsp; = 255.255.255.255?   
&nbsp;&nbsp;&nbsp; Gateway IP Address&nbsp;&nbsp;&nbsp;&nbsp; =0.0.0.0?  163.32.123.254 
 &nbsp;&nbsp;&nbsp; Boot File Name (&quot;NULL&quot; for None)&nbsp;&nbsp;&nbsp;&nbsp; =?  tftpboot 
 &nbsp;&nbsp;&nbsp; Argument File Name (&quot;NULL&quot; for None) =?  bsd.rd 
 &nbsp;&nbsp;&nbsp; Boot File Load Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =001F0000?  00AF0000  
&nbsp;&nbsp;&nbsp; Boot File Execution Address&nbsp;&nbsp;&nbsp; =001F0000?  00AF0000 
 &nbsp;&nbsp;&nbsp; Boot File Execution Delay&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 00000000?   
&nbsp;&nbsp;&nbsp; Boot File Length&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 00000000?   
&nbsp;&nbsp;&nbsp; Boot File Byte Offset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 00000000?   
&nbsp;&nbsp;&nbsp; BOOTP/RARP Request Retry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 00?   
&nbsp;&nbsp;&nbsp; TFTP/ARP Request Retry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 00?   
&nbsp;&nbsp;&nbsp; Trace Character Buffer Address = 00000000?   
&nbsp;&nbsp;&nbsp; BOOTP/RARP Request Control: Always/When-Needed (A/W)= W?   
&nbsp;&nbsp;&nbsp; BOOTP/RARP Reply Update Control: Yes/No (Y/N)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = Y?  
 
 
(If you change the NIOT configuration, you will be asked whether you want to 
make these changes permanent. Do not answer Y unless you plan to netboot 
this board very often; be sure to have the ENV settings use a correct 
address for the NIOT parameters block in this case. A valid setting is: 
 
 
&nbsp;&nbsp;&nbsp; Network Auto Boot Configuration Parameters Pointer (NVRAM) = 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  00000000? FFFC0080  
 
 
for example. 
 
 
Once the NIOT parameters are set, it should be possible to boot the machine 
from the server with the NBO command:) 
 
 
---------------------------------------------------------- 
如果BOOTP/RARP Reply Update Control: Yes/No (Y/N)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =Y?後多了一行指令: 
Network Auto Boot Configuration Parameters Pointer (NVRAM) =(Y/N)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ?=Y 
(如果打入Y後出現無法存檔訊息, 
方法一:不管他,直接nbo 00 00 ;如仍無法下載時; 
方法二:先參考以下執行env去設定環境後,再niot....) 
&nbsp; 
187-Bug&gt; ENV 
&nbsp;&nbsp;&nbsp; Bug or System environment [B/S] = B?  
&nbsp;&nbsp;&nbsp; Field Service Menu Enable [Y/N] = N? 
 
 
in order to boot directly into the BUG, without executing the complete 
selftest sequence. Do not forget, after changing the ENV parameters, to 
save the changes in NVRAM as suggested by the ENV command itself. 
 
 
If the board has a built-in Ethernet controller, its address must be correct; 
the LSAD command allows the address to be edited. 
 
 
OpenBSD/mvme88k will not run correctly if the clock is stopped (power-saving 
mode). Be sure to check that it is running by setting the current date with 
the SET command. 
 
 
If you plan to permanently boot from the network, make sure your ENV settings 
match the following setup: 
 
 
&nbsp;&nbsp;&nbsp; Network Auto Boot Enable [Y/N]&nbsp;&nbsp; = N? Y 
&nbsp;&nbsp;&nbsp; Network Auto Boot at power-up only [Y/N] = Y? N 
&nbsp;&nbsp;&nbsp; Network Auto Boot Abort Delay&nbsp;&nbsp;&nbsp; = 5? 2 (or any value at your choice) 
&nbsp;&nbsp;&nbsp; Network Auto Boot Configuration Parameters Pointer (NVRAM) = 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 00000000? FFFC0080 
------------------------------------------------------------------------ 
 
 
&nbsp;&nbsp;&nbsp;  187-Bug&gt; NBO 00 00  
 
 
**如果以上指令無法成功請參考再打以下： 
 187-Bug&gt;NBO 00 00 163.32.123.199 163.32.123.200 tftpboot bsd.rd  
(187-Bug&gt;NBO 00 00 主機位址 tftp主機位址 tftpboot bsd.rd) 
 
 
 
**安裝好開機 
 187-Bug&gt;bo  
 </description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/17</link>
      <pubDate>Fri, 30 Nov 2007 11:09:53 +0800</pubDate>   
  </item>
    <item>
   <title>自排車變速箱扭力轉換器鎖定</title>
   <description>  自排車的變速箱，只要車輛在行駛時，扭力轉換器 就是一直都在做動的！ 引擎便是憑藉著扭力轉換器將動力輸出至車輪上。      TCC 指的是的扭力轉換器鎖定離合器，因為扭力轉 換器是藉由液壓油來傳輸動力，所以動力會有較大 的轉換損耗，故電腦會在特定檔位定速行駛時， 讓 TCC 結合直接傳動而避開扭力轉換器的液壓傳送 ，便能減少動力傳輸損耗。     而 2.0 的 M 車在三四檔定速時，TCC 都有接合的 功能，比較細心的會友應該可以發現，剛進入三 或四檔時，若定速行駛一下下後可以發現轉速會 變低一點點，這時就是 TCC 接合了！     而更敏感的會友，甚至能感覺到好像多了一次的 換檔，所以之前才有人問到是否有 3.5 檔囉！   </description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/14</link>
      <pubDate>Fri, 28 Sep 2007 20:59:14 +0800</pubDate>   
  </item>
    <item>
   <title>柴油共軌噴射系統</title>
   <description> 目前各車廠使用的柴噴系統，大都是 BOSCH 與 SIEMENS 所供應的。   主要的系統區分為 BOSCH 1、BOSCH 2、BOSCH FSI、 SIEMENS FCI，還有 VAG 車系用的 PD 或 Non PD。  FOCUS TDCi 的引擎與柴噴系統是使用 SIEMENS FCI， 和 PSA 集團的車款共用。  柴噴系統其實蠻單純的，維修不會太複雜不用擔心， 故障率應該也不會太高，柴油車在歐洲可不算是新鮮 產品囉！  而 FOCUS TDCi 的其他部分和汽油的 FOCUS 都很類似 ，目前 FORD 各保養廠都已經完成 FOCUS TDCi 維修 的教育訓練啦，反而是坊間的維修廠很少有維修柴噴 轎車的能力。  而且柴油車最迷人之處，就是很好改，隨便改改都能 榨出 25~35% 的動力。</description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/13</link>
      <pubDate>Fri, 28 Sep 2007 20:28:14 +0800</pubDate>   
  </item>
    <item>
   <title>bad behavior 安裝</title>
   <description> 我自己架設的部落格前幾天升上了1.2版 因為bad behavior變成一個內定的外掛程式了  所以在按照說明文件，修改每個模板的header.template 在&lt;head&gt;與&lt;/head&gt;中插入  &nbsp;&nbsp;&nbsp; {if !empty($badbehavior)} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {$badbehavior-&gt;showBB2JavaScript()} &nbsp;&nbsp;&nbsp; {/if}  之後，我想知道運作情形，於是在模板的footer.template中加入了 {$badbehavior-&gt;showBB2Status()}  部落格，應該會出現  「Bad Behavior 已經阻擋了 ｘｘｘｘ 個過去 ｘ 天試圖闖關的垃圾迴響與引用。」 </description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/12</link>
      <pubDate>Wed, 26 Sep 2007 12:42:19 +0800</pubDate>   
  </item>
    <item>
   <title>OpenNTPD-網路對時</title>
   <description> 
&nbsp;
 
 
來源:不自量力Weithenn Study Daily 網站地圖 ( http://www.weithenn.idv.tw/cgi-bin/wiki.pl?OpenNTPD-%E7%B6%B2%E8%B7%AF%E5%B0%8D%E6%99%82 )
 
 
【前言】 
 
[OpenNTPD Org]是 OpenBSD 的子計劃，目標就是提供一個安全的 NTP Service；當您的區網有許多伺服器，而每一台伺服器各自去和 stratum 1/2 public ntp servers 對時是浪費網路資源且不智的做法。較好的作法是 DMZ 裡一、二台伺服器 (屆時擔任 NTP Server 角色) 和外面 stratum 1/2 ntp servers 對時，而其它 DMZ 或 LAN 的機器 (屆時擔任 NTP Client 角色) 與之對時。 
 
【作業環境】 
 
FreeBSD 6.2-RELEASE-p6 
 
openntpd-3.9p1_1,2 
 
NTPClock.exe (Windows NTP Client UI Software) 
【安裝及設定】 
 
NTP Server 設定 
 
Step1.安裝 openntpd 
 
安裝過程中系統會自動幫您新增 _ntp 這個 user、group，屆時也會以這帳號來啟動 openntpd 服務。 
 
#cd /usr/ports/net/openntpd //切換至安裝路徑  
#make install clean //安裝並清除安裝過程中不必要的檔案  
 
Step2.設定 ntpd.conf 
 
#vi /usr/local/etc/ntpd.conf //修改 openntpd 設定檔 
listen on 192.168.1.10 //指定屆時 openntpd 的 IP 
server tick.stdtime.gov.tw //指定 time server 
server tock.stdtime.gov.tw 
server clock.stdtime.gov.tw 
server watch.stdtime.gov.tw 
server time.stdtime.gov.tw 
server ntp.ntu.edu.tw 
server 3.tw.pool.ntp.org 
server 1.asia.pool.ntp.org 
server 3.asia.pool.ntp.org 
 
Step3.修改 /etc/rc.conf、syslog.conf 
 
修改 /etc/rc.conf 以便重開機時能自動載入 openntpd 服務 
 
#vi /etc/rc.conf  
openntpd_enable=&quot;YES&quot; 
 
修改 /etc/syslog.conf 以便讓我們了解 NTP Server 去跟外面 Time Server 對時及調整本機時間的訊息 
 
#vi /etc/syslog.conf 
ntp.info /var/log/openntpd.log 
 
請注意：應該要寫 daemon.info 還是 ntp.info 才會有校時資料寫入？跟你安裝的 openntpd 版本有關系，至於新版的 openntpd 為何要設定為 ntp.info 原因請看這篇 [ports/114191: (patch) net/openntpd should use syslog facility LOG_NTP] 
 
openntpd-3.9p1,2 設定 daemon.info /var/log/openntpd.log 
openntpd-3.9p1_1,2 設定 ntp.info /var/log/openntpd.log 
 
加入上列一行後我們先建立 openntpd.log 這個空檔後在 reload syslogd 服務 
 
#touch /var/log/openntpd.log 
#/etc/rc.d/syslogd reload 
 
Step4.啟動 openntpd 服務 
 
#/usr/local/etc/rc.d/openntpd start //啟動 openntpd 服務 
Starting openntpd. 
 
檢查 openntpd 服務是否啟動成功 
 
# ps ax |grep ntpd 
72621 ?? Is 0:00.00 ntpd: [priv] (ntpd) 
72622 ?? S 0:00.16 ntpd: ntp engine (ntpd) 
73161 p3 R+ 0:00.00 grep ntpd 
 
可發現有去跟外面的 Time Server 連接 
 
#sockstat |grep ntpd 
_ntp ntpd 72622 3 dgram -&gt; /var/run/logpriv 
_ntp ntpd 72622 4 udp4 192.168.1.10:54512 220.130.158.51:123 
_ntp ntpd 72622 5 stream -&gt; ?? 
_ntp ntpd 72622 6 udp4 192.168.1.10:123 *:* 
_ntp ntpd 72622 7 udp4 192.168.1.10:51987 220.130.158.71:123 
_ntp ntpd 72622 8 udp4 192.168.1.10:49509 220.130.158.72:123 
_ntp ntpd 72622 9 udp4 192.168.1.10:62446 220.130.158.54:123 
_ntp ntpd 72622 10 udp4 192.168.1.10:51543 192.115.133.35:123 
_ntp ntpd 72622 11 udp4 192.168.1.10:58900 140.112.4.189:123 
_ntp ntpd 72622 12 udp4 192.168.1.10:62115 61.70.206.117:123 
_ntp ntpd 72622 13 udp4 192.168.1.10:52513 60.56.119.79:123 
_ntp ntpd 72622 14 udp4 192.168.1.10:56684 220.130.158.52:123 
root ntpd 72621 3 dgram -&gt; /var/run/logpriv 
root ntpd 72621 4 stream -&gt; ?? 
 
使用 ntptrace 來了解與外部 time server 對時狀況 
 
#ntptrace 220.130.158.72 
220-130-158-72.HINET-IP.hinet.net: stratum 2, offset 0.002189, root distance 0.012691 
 
或使用 ntpq 來了解與外部 time server 對時狀況 
 
#ntpq -p 220.130.158.72 
remote refid st t when poll reach delay offset jitter 
============================================================================== 
+220-130-158-50. .IRIG. 1 u 187 1024 231 20.874 -0.271 499.767 
*220-130-158-70. .IRIG. 1 u 492 1024 67 12.691 2.189 0.957 
+220-130-158-51. 220.130.158.50 2 u - 1024 167 75.498 28.432 13.156 
220-130-158-71. 220.130.158.50 2 u - 1024 377 1.329 -3.495 0.151 
 
Step5.查看 openntpd.log 
 
我們可以查看剛才設定的 openntpd.log 來了解目前本機的時間校對情況 (大約 3 ~ 5 分鐘調整 1 秒)，基本上 openntpd 是慢慢調整時間，若您想一次就調整好可以利用 -s 來一次把時間調到標準 (不知會不會出事？) 
 
#tail /var/log/openntpd.log 
Jul 31 15:09:46 mybsd ntpd[72622]: listening on 192.168.1.10 
Jul 31 15:09:46 mybsd ntpd[72622]: ntp engine ready 
Jul 31 15:10:03 mybsd ntpd[72622]: peer 220.130.158.72 now valid //time server 有效 
Jul 31 15:10:04 mybsd ntpd[72622]: peer 61.70.206.117 now valid 
Jul 31 15:10:06 mybsd ntpd[72622]: peer 220.130.158.52 now valid 
Jul 31 15:11:06 mybsd ntpd[72621]: adjusting local clock by 454.400335s //本機校時狀態 
Jul 31 15:15:25 mybsd ntpd[72621]: adjusting local clock by 453.485940s 
Jul 31 15:18:56 mybsd ntpd[72621]: adjusting local clock by 452.473868s 
Jul 31 15:22:45 mybsd ntpd[72621]: adjusting local clock by 451.561672s 
Jul 31 15:26:03 mybsd ntpd[72621]: adjusting local clock by 450.369801s 
Jul 31 15:29:52 mybsd ntpd[72621]: adjusting local clock by 449.532482s 
Jul 31 15:33:40 mybsd ntpd[72621]: adjusting local clock by 448.585979s 
 
FreeBSD NTP Client 設定 
 
Step1.安裝 openntpd 
 
安裝過程中系統會自動幫您新增 _ntp 這個 user、group，屆時也會以這帳號來啟動 openntpd 服務。 
 
#cd /usr/ports/net/openntpd //切換至安裝路徑  
#make install clean //安裝並清除安裝過程中不必要的檔案 
 
Step2.設定 ntpd.conf 
 
#vi /usr/local/etc/ntpd.conf //修改 openntpd 設定檔 
server 192.168.1.10 //指定我們架設的 time server 
 
Step3.修改 /etc/rc.conf、syslog.conf 
 
修改 /etc/rc.conf 以便重開機時能自動載入 openntpd 服務 
 
#vi /etc/rc.conf  
openntpd_enable=&quot;YES&quot; 
 
修改 /etc/syslog.conf 以便讓我們了解 NTP Server 去跟外面 Time Server 對時及調整本機時間的訊息 
 
#vi /etc/syslog.conf 
ntp.info /var/log/openntpd.log 
 
加入上列一行後我們先建立 openntpd.log 這個空檔後在 reload syslogd 服務 
 
#touch /var/log/openntpd.log 
#/etc/rc.d/syslogd reload 
 
Step4.啟動 openntpd 服務 
 
#/usr/local/etc/rc.d/openntpd.sh start //啟動 openntpd 服務 
Starting openntpd. 
 
檢查 openntpd 服務是否啟動成功 
 
# ps ax |grep ntpd 
5500 ?? Is 0:00.01 ntpd: [priv] (ntpd) 
5501 ?? I 0:00.02 ntpd: ntp engine (ntpd) 
5524 p0 R+ 0:00.00 grep ntpd 
 
可發現有去跟內部的 Time Server 連接 
 
#sockstat |grep ntpd 
_ntp ntpd 5501 3 dgram -&gt; /var/run/logpriv 
_ntp ntpd 5501 4 udp4 172.18.1.12:63701 192.168.1.10:123 
_ntp ntpd 5501 5 stream -&gt; ?? 
root ntpd 5500 3 dgram -&gt; /var/run/logpriv 
root ntpd 5500 4 stream -&gt; ?? 
 
Step5.查看 openntpd.log 
 
我們可以查看剛才設定的 openntpd.log 來了解目前本機的時間校對情況 (大約 3 ~ 5 分鐘調整 1 秒)，基本上 openntpd 是慢慢調整時間，若您想一次就調整好可以利用 -s 來一次把時間調到標準 (不知會不會出事？) 
 
#tail /var/log/openntpd.log 
Aug 1 17:21:08 testbsd ntpd[5443]: ntp engine exiting 
Aug 1 17:21:08 testbsd ntpd[5442]: Terminating 
Aug 1 17:21:08 testbsd ntpd[5501]: ntp engine ready 
Aug 1 17:21:30 testbsd ntpd[5501]: peer 192.168.1.10 now valid 
Aug 1 17:22:24 testbsd ntpd[5500]: adjusting local clock by 398.739917s 
Aug 1 17:25:39 testbsd ntpd[5500]: adjusting local clock by 397.073363s 
 
Solaris 9 NTP Client 設定 
 
Step1.設定 ntp.conf 
 
#cd /etc/inetd ; cp ntp.client ntp.conf //複製 ntp client 範例檔來修改 
#vi ntp.conf //加入如下三行 
server 192.168.1.10 //指定 ntp server  
driftfile /var/ntp/ntp.drift 
logfile /var/ntp/ntp.log 
 
Step2.建立相關檔案 ntp.drift、ntp.log 
 
#touch /var/ntp/ntp.drift 
#touch /var/ntp/ntp.log 
 
Step3.啟動 xnptd 服務 
 
#/etc/init.d/xntpd start //啟動 xnptd 服務 
 
檢查 xntpd 服務是否啟動成功 
 
#ps -ef |grep ntpd 
root 9715 1 0 15:57:23 ? 0:00 /usr/lib/inet/xntpd 
 
使用 ntpq 來了解跟內部 time server 對時狀況 
 
#ntpq -p 
remote refid st t when poll reach delay offset disp 
============================================================================== 
*192.168.1.10 220.130.158.51 3 u 21 64 377 0.46 1.764 0.23 
 
使用 ntptrace 來了解跟內部 time server 對時狀況 
 
# ntptrace -n 127.0.0.1 
127.0.0.1: stratum 4, offset 0.000028, synch distance 0.01624 
192.168.1.10: stratum 3, offset 0.001898, synch distance 0.00569 
220.130.158.51: stratum 2, offset 0.020941, synch distance 0.03044 
220.130.158.50: stratum 1, offset 0.180524, synch distance 1.00000, refid 'IRIG' 
 
使用 snoop 來了解跟內部 time server 對時狀況 
 
#snoop |grep -i ntp 
Using device /dev/bge0 (promiscuous mode) 
192.168.1.11 -&gt; 192.168.1.10 NTP client (Wed Aug 1 11:41:34 2007) 
192.168.1.10 -&gt; 192.168.1.11 NTP server (Wed Aug 1 11:41:34 2007) 
 
Step4.查看 ntp.log、messages 
 
查看 /var/ntp/ntp.log 來了解跟內部 time server 對時狀況 
 
#tail /var/ntp/ntp.log 
1 Aug 16:01:39 xntpd[9715]: synchronized to 192.168.1.10 , stratum=3 
1 Aug 12:47:43 xntpd[8605]: time reset (step) 171.638805 s 
 
查看 /var/ntp/ntp.log 來了解跟內部 time server 對時狀況 
 
#tail -f /var/adm/messages |grep ntp 
Aug 1 14:53:58 sundev ntpdate[9394]: [ID 558275 daemon.notice] adjust time server 192.168.1.10 offset 0.004170 sec 
Aug 1 14:54:00 sundev xntpd[9396]: [ID 702911 daemon.notice] xntpd 3-5.93e Mon Sep 20 15:47:11 PDT 1999 (1) 
Aug 1 14:54:00 sundev xntpd[9396]: [ID 301315 daemon.notice] tickadj = 5, tick = 10000, tvu_maxslew = 495, est. hz = 100 
Aug 1 14:54:00 sundev xntpd[9396]: [ID 798731 daemon.notice] using kernel phase-lock loop 0041 
 
Windows NTP Client 設定 
 
我們可使用由[國家時間與頻率標準實驗室]出的[NTP 校時軟體]目前最新版本為 V2.1 來達成讓 Windows Server 也跟 FreeBSD NTP Server 對時即可。 
 
1.下載    http://www.stdtime.gov.tw/chinese/EXE/NTPClock.exe，並安裝它    
2.在【時間伺服器】欄位上填上 FreeBSD NTP Server IP Address --&gt; 按下【增加】 
3.勾選【信任未同步伺服器時間】 
4.預設為一個小時跟指定的 NTP Server 對時若想馬上對時可按下【立即查尋主機時間】 
 
有關於 NTPClock 軟體的操作可參考[標準時間網路校時客戶端程式 (NTPClock) 操作說明] 
 
【參考】 
 
[潛艦 |    http://to2100.idv.tw    , Network Lab＠FreeBSD . &raquo; FreeBSD Openntpd] 
 
[Setup OpenNTPD - OSWikiHK] 
 
[OpenNTPD Org] 
 
[When {Puffy} Meets ^RedDevil^: FreeBSD Openntpd] 
 
[HOWTO NTP Using OpenNTPD - Gentoo Linux Wiki] 
 
[OpenNTPD OpenBSD Config Files] 
 
[NTPPoolServers &lt; Servers &lt; NTP] 
 
[pool.ntp.org: NTP Servers in Asia, asia.pool.ntp.org] 
 
[pool.ntp.org: NTP Servers in Taiwan, tw.pool.ntp.org] 
 
[Configuring OpenNTPD on OpenBSD 3.7] 
 
[ports/114191: (patch) net/openntpd should use syslog facility LOG_NTP] 
 
[ntp] 
 
[OpenNTPD - Wikipedia, the free encyclopedia] 
 
[Quick HOWTO : Ch24 : The NTP Server - Linux Home Networking] 
 
[docs.sun.com: System Administration Guide: Resource Management and Network Services] 
 
[鳥哥的 Linux 私房菜 -- NTP 時間伺服器] 
 
【Me FAQ】 
 
Q1.openntpd.log內沒有任何訊息寫入？ 
 
Error Message: 
 
當我啟動 openntpd 服務想查看 openntpd.log 時，但該 log 內容都是空的 
 
Ans: 
 
請確定以下事項你作了沒 
 
* 修改完 /etc/syslog.conf 後是否有 reload syslogd 
* 試著 restart openntpd 
 
若還是沒有訊息寫入指定的 log 內就輸出 all.log 看看是否 ok，我的問題是之前修改 syslogd 是寫 daemon.info 但 log 內容都是空的，看了這篇後 [ports/114191: (patch) net/openntpd should use syslog facility LOG_NTP]改為 ntp.info 後 log 就有訊息寫入了。
 
 
 【Log】  
 
 
初稿-2007/07/31 
 </description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/10</link>
      <pubDate>Sun, 19 Aug 2007 22:07:48 +0800</pubDate>   
  </item>
    <item>
   <title>Ports and Packages</title>
   <description> 
&nbsp; 來源:Tzeng, Yi-Feng (   http://std1.mis.yzu.edu.tw/~s882617/FNP2/faq/ports_pkg.php   )  
 
 
 如何只抓取 tarball？ 
 
如果只希望抓取 tarball 下來的話，僅需下 make fetch 即可。 
以 editors/joe 為例的話，則： 
 
cd /usr/ports/editors/joe/ 
make fetch  
 
預設會將 joe 的 tarball 下載至 /usr/ports/distfiles/ 目錄下。  
 
 
如何僅做到解開 tarball的步驟？ 
 
有時候習慣自己 patch/修正 原始碼的時候，很常用到這個功能。 
以 editors/joe 為例的話，則： 
 
cd /usr/ports/editors/joe/ 
make extract  
 
會將 tarball解開至 /usr/ports/editors/joe/work/ 目錄下。  
 
 
如何僅做到解開 tarball 並補上官方提供的 patch？ 
 
此方法與 2 有一些類似，不同於是先補上官方提供的 patch ，再行 patch 自己的修正。 
以 editors/joe 為例的話，則： 
 
cd /usr/ports/editors/joe/ 
make patch  
 
會將 tarball解開至 /usr/ports/editors/joe/work/ 目錄下，並已經 patch 上官方提供的 patch。  
 
 
   
 
 
 如何安裝一個新的 port？ 
 
如果系統上未安裝此軟體，則可以選擇安裝一個新的 port。 
以 editors/joe 為例的話，則： 
 
cd /usr/ports/editors/joe/ 
make install  
 
如此會在系統上安裝一個新的 joe 軟體。如果需要在安裝完成後，一併清除編輯時期所留下來的暫存目錄，則可參考 FAQ 8 的方法，一起使用，如： 
 
cd /usr/ports/editors/joe/ 
make clean  
 
 
 
 
如何安裝一個新的 port，並將打包(package)起來？ 
 
將安裝完成的軟體打包起來，有許多便利性：包括在叢集系統中，可供其它機器使用，或將未來此軟體出問題可重新利用此 package 重新快速安裝。 
以 editors/joe 為例的話，則： 
 
cd /usr/ports/editors/joe/ 
make package  
 
如此會在系統上安裝一個新的 joe 軟體，並將此軟體打包(package)起來。package 預設會在 /usr/ports/editors/joe/ 目錄下，如果希望集中管理的話，建議做如下的步驟：  
mkdir -p /usr/ports/packages/All/  
 
以後打包的 packages 都會存放在此目錄下，並且系統會自動做分類，以方便管理。如果需要在安裝完成後，一併清除編輯 時期所留下來的暫存目錄，則可參考 FAQ 8 的方法，一起使用，如： 
 
cd /usr/ports/editors/joe/ 
make package clean  
 
 
 
 
如何打包一個 port，並將其所有相依的 ports 也打包起來？ 
 
因為 FAQ 5 只有對最終的 port 才進行打包，中間依賴的 ports 並沒有一起打包，這會出現一個常遇到 的問題，就是如果編輯一個 port 需要依賴其它的 ports，那麼必須將其它 ports 也一起打包，否則安裝 packages 會有相 依賴其它 ports 的 packages 的問題。 
以 sysutils/portupgrade 為例的話，則： 
 
cd /usr/ports/sysutils/portupgrade/ 
make DEPENDS_TARGET=package package  
 
如此會在對所有 portupgrade 所相依賴的 ports 一併打包，也包括自己本身。  
 
 
如何對一個已經安裝的 port 打包？ 
 
如果安裝好一個套軟，事前並未打包，事後想打包的話，則： 
以 editors/joe 為例的話 
 
cd /var/db/pkg/ 
pkg_create -b joe-{版本號}  
 
會將已安裝的 port 打包起來，放在 /var/db/pkg/ 目錄下。  
 
 
如何清理 ports 編輯期間所產生的暫存資料？ 
 
在編輯 port 的時候，會有編輯期間所需要的工作目錄(work)，因此通常安裝好一個套件後，會清除此暫存目錄，以節省系 統磁碟空間。 
以 editors/joe 為例的話，則： 
 
cd /usr/ports/editors/joe/ 
make clean  
 
 
 
 
如何在安裝 ports 前查詢所需依賴/相關的套件？ 
 
在安裝 ports 前，可以查詢所需依賴/相關的套件。 
以 mail/p5-Mail-SpamAssassin 為例的話，則： 
 
cd /usr/ports/mail/p5-Mail-SpamAssassin/ 
make all-depends-list #顯示所有相關的套件 
make pretty-print-build-depends-list #顯示編譯期間所需要的套件 
make pretty-print-run-depends-list #顯示此套件要執行時所需要的套件 
 
 
 
 
 
如何移除已安裝的 ports？ 
 
以 editors/joe 為例的話，則： 
 
cd /usr/ports/editors/joe/ 
make deinstall  
 
或是使用 pkg_delete  
cd /var/db/pkg/ 
pkg_delete joe-{version}  
 
有時候套件之間的相依性會導致無法直接移除，如果要強制移除的話，則： 
 
cd /var/db/pkg/ 
pkg_delete -f joe-{version}  
 
但很有可能會導致其它的套件執行起來出現問題。  
 
 
如何一併移除所相依的 ports？ 
 
以 sysutils/portupgrade 為例的話，則： 
 
cd /usr/ports/sysutils/portupgrade/ 
make deinstall-depends  
 
執行此步驟前，請注意是否會移除應該保護的套件。建議先參考 FAQ 9 的方法來檢查。  
 
 
如何重新安裝已安裝過的 ports？ 
 
以 editors/joe 為例的話，則： 
 
cd /usr/ports/editors/joe/ 
make reinstall  
 
 
 
 
如何以關鍵字搜尋 ports？ 
 
如果要從全部的 ports collection 中找尋與關鍵字 &quot;ldap&quot; 有關的 ports，則： 
 
cd /usr/ports/ 
make search key=ldap  
 
如果只要從與 ftp 相關的 ports 下找尋與關鍵字 &quot;ldap&quot; 有關的 ports，則： 
 
cd /usr/ports/ftp/ 
make search key=ldap  
 
還有另一個用法，方法只是將 key 換成 name 。如果已經知道要搜尋 ports 的名稱，或只想找名稱相關的關鍵字 &quot;ldap&quot;， 則： 
 
cd /usr/ports/ 
make search name=ldap  
 
如果只要從 ftp 相關的 ports 下找尋名稱與關鍵字 &quot;ldap&quot; 有關的 ports，則： 
 
cd /usr/ports/ftp/ 
make search name=ldap  
 
 
 
 
如何升級已安裝的 ports？ 
 
如果已經安裝好套件，事後欲升級的話，以 editors/joe 為例，則： 
 
cd /usr/ports/editors/joe/ 
make deinstall 
make install clean  
 
或是  
cd /usr/ports/editors/joe/ 
make reinstall  
 
 
 
 
如何查詢目前系統安裝了哪些套件？ 
 
查詢目前系統已安裝的全部套件： 
 
pkg_info  
pkg_version -v 
 
 
 
如何查詢目前系統有沒有安裝這個關鍵字的套件？ 
 
此方法類似 FAQ 14 ： 
 
pkg_info | grep  
 
 
 
 
如何查詢某個檔案是屬於哪些套件？ 
 
如果想查詢 /usr/local/bin/joe 是屬於哪個套件的話，則： 
 
pkg_info -W /usr/local/bin/joe  
 
如果沒有回傳任何資訊的話，代表著這個檔案是由 FreeBSD 內建的。  
 
 
如何查詢某個套件安裝了哪些檔案？ 
 
如果想查詢目前系統所安裝的 joe 包含了哪些檔案，則： 
 
pkg_info -L /var/db/pkg/joe-{version}  
 
 
 
 
如何安裝舊版的 ports？ 
 
有時候會因為相依性，或是新版有問題，而會想裝舊版本的套件。 
這裡的方法是利用 CVS 的好處，回歸到以前舊版本存在的日子，以安裝舊版本的套件。 
首先，若我們要回復到某一個套件的版本時，需要去查詢 FreeBSD ports CVS repository。 
最常見的就是 Freshports 網站、 FreeBSD ports news group， 或是 FreeBSD ports cvsweb。 
 
查到該套件版本所依存的日子後，就修改 CVS tag。一般預設 ports 的 CVS tag 會寫在 /usr/share/examples/cvsup/ports-supfile ，如要回朔到 2002/10/05 號的話，則： 
 
# vi /usr/share/examples/cvsup/ports-supfile 
****************************************** 
default date=2002.10.05.00.00.00 #將 date 改成當日  
 
然後按照一般 CVSup 的時候一樣，執行 CVSup (make update)，此時的 ports collections 就會回到當時的情形，那麼該套件 舊版本也會出現在 ports collections 中，只要安裝即可。 
 
如果僅是想把某部份的 ports 回朔，則必須加上額外的資訊，如僅希望把 lang/perl5.8 回朔，而得知此屬於 lang 中的一支，則： 
 
# vi /usr/share/examples/cvsup/ports-supfile 
****************************************** 
#ports-all #將 ports-all 標示起來 
ports-lang #加入這行  
 
最後，執行 CVSup，並安裝即可。目前若希望單獨回朔單一的 ports，則比較麻煩。 
 
 
 
如何更新 ports Mk？ 
 
Mk (/usr/ports/Mk/) 是編譯 ports 時所參考的設定，有時若發生 ports collections 太新，而導致 Mk 的內容不符，此時 就是應該更新 Mk 的時候了。 
 
cd /usr/src/ 
make update 
cd /usr/src/share/mk 
make install  
 
 
 
 
如何解決安裝 ports 時出現 sed -i 的錯誤？ 
 
因為 BSD style 的 sed ，也就是 BSD 本身自有的 sed ，與一些 ports 編譯期間所執行的 sed 不一致，所以會導致一些語 法錯誤。此時先安裝 sed_inplace (textproc/sed_inplace)，然後再安裝原本無法安裝的 ports： 
 
cd /usr/ports/???/???/ 
make -DUSE_REINPLACE install  
 
 
 
 
如何列出所有可以升級的 ports？ 
 
ports collection 的更新速度很快，在每次更新 ports collections 後，往往會出現比目前現在安裝的套件還新的版本，可 以令系統自行整理並提供可升級套件的列表： 
 
pkg_version -c  
 
 
 
 
如何得知 ports system 對某個 ports 所提供的編譯參數？ 
 
所有的 ports collections 中所提供的編譯參數都會在對應的 Makefile 檔案內詳述，如 sysutils/portupgrade 的話，則 是位在 /usr/ports/sysutils/portupgrade/Makefile 檔案下。 
可以對此檔案瀏覽以得知編譯時期可以下達的參數，如對 sysutils/portupgrade 有提供 NOPORTDOCS，則： 
 
cd /usr/ports/sysutils/portupgrade/ 
make -DNOPORTDOCS install # make NOPORTDOCS=yes install 亦同  
 
那麼安裝此 ports 時，會將 NOPORTDOCS 所對應的相關參數指定進去。 
有時候設定較人性化的 ports 會在安裝前提供參數供選擇，但是其實大部份的 ports 都沒有提供，因此必須自行去搜尋可編 譯的參數，在此我提供的方式如下： 
 
cd /usr/ports/sysutils/portupgrade/ 
grep defined Makefile  
 
如此幾乎可以知道所有提供的可編譯參數，雖然有時會多出一些不相干的資料，不會這個確實是一個不錯可參考的方式。  
 
 
如何手動加入編譯 ports 的參數？ 
 
在 FAQ 23 中的方法，是 ports collections 有提供的前提之下，有時候並不是所有該軟體所支援的參數 都會收納在 ports collections 中，因此有時候會需要手動加入編譯的參數。 
如 ftp/pure-ftpd 中，如果不想把 inetd 的支援編入的選項，並沒有被 ports collections 所納入，因此必須手動加上這個 編譯參數，如下： 
 
cd /usr/ports/ftp/pure-ftpd/ 
make CONFIGURE_ARGS+=&quot;--without-inetd&quot; install  
 
 
 
 
如何指定 ports 的安裝路徑？ 
 
預設 ports collecions 已安排安裝的路徑 (/usr/local/)，如果不想將套件安裝在預設路徑的話，可以手動指定安裝路徑。 以 editors/joe 為例，則： 
 
cd /usr/ports/editors/joe/ 
make PREFIX=/usr install  
 
那麼 joe 就會將檔案對應在 /usr 目錄下，而不是預設的 /usr/local 目錄下。  
 
 
安裝 ports 出現 FORCE_PKG_REGISTER 的錯誤訊息 
 
請參考 Ohaha 的 FAQ。  
 
 
安裝 ports 出現 Shared object libintl.so.X not found 的錯誤訊息 
 
請參考 Ohaha 的 FAQ。  
 
 
如何安裝 packages？ 
 
目前 FreeBSD 的 packages 是由 .tgz 所打包。如果想安裝一個 packages ，可使用 pkg_add，如安裝一個 joe 的 tgz： 
 
pkg_add joe-{version}.tgz  
 
 
 
 
如何遠端安裝 packages？ 
 
有兩種設定方式，首先是 PACKAGEROOT，如： 
 
setenv PACKAGEROOT ftp://ftp.tw.freebsd.org #設定 PACKAGEROOT 為 ftp.tw.freebsd.org 站台  
 
另一種方式是設定 PACKAGESITE，好處是若該站台的 packages 倉儲並不是符合官方的設定或你想自己指定一個路徑。 
以 ftp.tw.freebsd.org i386 的 current pakcages 為例： 
 
setenv PACKAGESITE ftp://ftp.tw.freebsd.org/pub/FreeBSD/ports/i386/packages-current/Latest/  
 
兩種方式選擇其中一種皆可，接下來的步驟都一樣。 
往後要安裝 packages 的時候，如 portupgrade 的話，則： 
 
pkg_add -vr portupgrade  
 
則系統會自動於 ftp.tw.freebsd.org 抓取所有與 portupgrade 相依的 packages 並安裝。 
 
 
 
如何更新 INDEX 對照表？ 
 
4.x 的 INDEX 位於 /usr/ports/INDEX，5.x 位於 /usr/ports/INDEX-5。 
INDEX 是對照 ports 所有相依等資訊的對照表，若長期未更新的話，會導致 ports 對照失敗。官方有定期更新 INDEX，如果 想自行更新的話，則： 
 
cd /usr/ports/ 
make index  
 
 
 
 
如何針對某些 ports 不做 CVSup？ 
 
若 ports 底下的某些分類完全用不到，則可以在 CVSup 時，不做更新，以節省網路頻寬與時間。 
 
# vi /usr/sup/refuse 
****************************************** 
ports/french 
ports/german 
ports/hebrew 
ports/hungarian 
ports/japanese 
 
 
那麼則上述目錄下的檔案皆不會更新。 
 
如果是想要某些單一的 ports 不做同步，例如想保留舊版不做同步，或新版出現問題時。 
 
# vi /usr/sup/refuse 
****************************************** 
ports/lang/perl5.8  
 
那麼 ports/lang/perl5.8 這個 ports 不會做 CVSup 同步。 
 
這些設定方法支援萬用字元。 
 
# vi /usr/sup/refuse 
****************************************** 
ports/lang/perl* 
ports/po*  
 
 
 
 
如何使用 CVSup 同步 ports collections？ 
 
請參考 gslin 的 用 CVSup 去更新你的 source tree 以及 ports tree。  
 
 
安裝 ports 出現 port is outdated 的錯誤訊息 
 
例如安裝 imap-uw 時，出現以下內容：  
Your installation of the cclient port is outdated. Please delete it before continuing.  
 
表示因為相對應，且已安裝好的 cclient 這個軟體過於老舊，建議先升級這個軟體再行安裝 imap-uw。因此只要先升級 cclient 後，再安裝即可。  
# cd /usr/ports/mail/cclient/ 
# make reinstall 或 # make deinstall &amp;&amp; make install 
# cd /usr/ports/mail/imap-uw/ 
# make install  
 
在FreeBSD6.2下更新了ports後，按照php5-gd，總是在編譯以前編譯xorg-libraries-7.2出錯， 
其實編譯php5-gd不是必須要編譯xorg-libraries-7.2的。只需要打入下面的命令，就可以跳過xorg直接編譯。方便快捷，實用為上。哈哈。 
 
 
 #make WITHOUT_X11=&quot;YES&quot; install 
 
 
安裝 ports 出現 OpenSSL vulnerabilities 的錯誤訊息 
 
在安裝有些套件時，如果有相依於 OpenSSL 時，且判斷系統目前的 OpenSSL 版本有漏洞問題時，會出現如下的訊息：  
Dependency warning: used OpenSSL version contains known vulnerabilities 
Please update or define either WITH_OPENSSL_BASE or WITH_OPENSSL_PORT  
 
一般建議的解決方法有二種。 
 
第一種：升級系統，再安裝該套件 
升級系統可參考 FNP: upgrade core system 或 FNP: upgrade major system。 
然後再安裝該套件，這訊息就不會出現了。 
 
第二種：使該套件相依於 ports tree 中的 OpenSSL 
這種方法會安裝 ports tree 中新版本的 OpenSSL，然後相依於此新版本的 OpenSSL，而不是系統本身內建的 OpenSSL。只要安裝套件時，加入 WITH_OPENSSL_PORT 的參數，即會安裝 ports tree 中的 OpenSSL，並且該套件也會相依於此。方法如下：  
make -DWITH_OPENSSL_PORT install  
 
這裡不建議用參數 WITH_OPENSSL_BASE，因為這表示安裝套件時，是相依於原本系統中可能有漏洞的 OpenSSL，這樣會導致安全性的問題。  
 
 
 http://www.tses.tcc.edu.tw/pc_class_room/ports_pkg.php (utf-8)  
 </description>
   <link>http://netflow.kmseh.gov.tw/blog/post/1/9</link>
      <pubDate>Fri, 22 Jun 2007 14:28:27 +0800</pubDate>   
  </item>
   </channel>
</rss>

