[FreeBSD] 安裝基本mrtg主機流量統計圖
Posted on November 8, 2006
| 1 minutes
| 118 words
| appleboy
主機資訊 FreeBSD 6.1-RELEASE 安裝步驟 cd /usr/ports/net-mgmt/net-snmp; make install clean
cd /usr/ports/net-mgmt/mrtg; make install clean 這2個安裝好,其實基本上就已經可以使用了 在 /etc/rc.conf 加上 snmpd_enable="YES"
snmpd_flags="-a -p /var/run/snmpd.pid"
snmptrapd_enable="YES"
snmptrapd_flags="-a -p /var/run/snmptrapd.pid" 修改 snmpd.conf 檔 目錄在 /usr/local/share/snmp/snmpd.conf com2sec local localhost public com2sec lan 192.168.100.0/24 public group RWGroup v1 local group ROGroup v1 lan view all included .1 80 access RWGroup “” any noauth prefix all all all access ROGroup “” any noauth prefix all none none 紅色部份,盡量不要用 public ,因為這樣別人可以猜到你的mrtg設定 修改好存檔
[Read More][FreeBSD] 安裝 sshit 設定教學
Posted on November 3, 2006
| 1 minutes
| 182 words
| appleboy
系統:FreeBSD 6.0-RELEASE 安裝方式: cd /usr/ports/security/sshit/ make install clean 設定檔 /usr/local/etc/sshit.conf # Sample configuration file of sshit.pl # We use pf as firewall on default 看你喜歡用什麼防火牆,我熟悉ipfw FIREWALL_TYPE = ipfw # Number of failed login attempts within time before we block MAX_COUNT = 3 # Time in seconds in which all failed login attempts must occur WITHIN_TIME = 60 # Time in seconds to block ip in firewall 失敗後禁止登入幾秒鐘 RESET_IP = 300 IPFW_CMD = /sbin/ipfw # Make sure you don’t have any important rules here already IPFW_RULE_START = 2100 IPFW_RULE_END = 3100 IPFW2_CMD = /sbin/ipfw IPFW2_TABLE_NO = 0 PFCTL_CMD = /sbin/pfctl PF_TABLE = badhosts vi /etc/syslog.
[Read More][FreeBSD] 系統核心支援ipfw 更新kernel
Posted on October 28, 2006
| 1 minutes
| 47 words
| appleboy
系統預設是不能使用 ipfw 指令,因為系統核心不支援,要使系統支援 ipfw,則需要修改核心
cd /usr/src/sys/i386/conf
vi GENERIC
#在最後面加入
options IPFIREWALL
options IPFIREWALL_DEFAULT_TO_ACCEPT
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=10
options IPDIVERT
#然後存檔
config GENERIC
cd ../compile/GENERIC/
make cleandepend; make depend;
make depend all install
編譯好沒有錯誤之後,就可以重新開機 ipfw list 65535 allow ip from any to any 看到上面訊息,就是成功 我在自己的論壇寫過一遍
http://www.forum.wu-boy.com/t=10210
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-ipfw.html
http://freebsd.lab.mlc.edu.tw/natd/
[FreeBSD] 安裝Awstats 6.6
Posted on October 19, 2006
| 3 minutes
| 602 words
| appleboy
安裝路徑
cd /usr/ports/www/awstats-devel/ 安裝好之後 請在 httpd.conf 最後面加入 # Directives to allow use of AWStats as a CGI # Alias /awstatsclasses “/usr/local/www/awstats/classes/” Alias /awstatscss “/usr/local/www/awstats/css/” Alias /awstatsicons “/usr/local/www/awstats/icons/” ScriptAlias /awstats/ “/usr/local/www/awstats/cgi-bin/” 執行 /usr/local/www/awstats/tools/awstats_configure.pl 會出現錯誤訊息~
Error: Failed to open ‘/usr/local/www/awstats/wwwroot/cgi-bin/awstats.model.conf’ for read. Error: AWStats database directory defined in config file by ‘DirData’ parameter (/var/lib/awstats) does not exist or is not writable. Setup (‘/etc/awstats/awstats.192.168.100.244.conf’ file, web server or permissions) may be wrong. Check config file, permissions and AWStats documentation (in ‘docs’ directory).
[Read More][FreeBSD] Ports 更新 index 或 更新kernel
Posted on September 25, 2006
| 1 minutes
| 38 words
| appleboy
1. cd /usr/ports && make fetchindex
2. portsdb -uU
3. rm -f /var/db/pkg/pkgdb.db
4. pkgdb -Fu
5. cd /usr/src ; make buildworld; make kernel; make installworld; reboot
— 這招很好用 上面步驟如果只需要更新ports tree 只需要 cd /usr/ports && make fetchindex 就可以了
[FC4] snmpd + mrtg 安裝教學「注意事項」
Posted on September 25, 2006
| 1 minutes
| 15 words
| appleboy
其實安裝方面並不難 FreeBSD 就用ports安裝 fc系列 就用 yum 或者是 apt FreeBSD: /usr/ports/net-mgmt/net-snmp /usr/ports/net-mgmt/mrtg http://phorum.study-area.org/viewtopic.php?t=21142&highlight=public+cfgmaker 我找到的資料 ~ 照上面修改大致上ok
[FC4] 限制connection 連線數目「架設war3伺服器」
Posted on September 24, 2006
| 1 minutes
| 115 words
| appleboy
fc4作業系統 預設 有連線數目的限制 還有使用者連線的限制 不過解決方法很容易 http://www.ithome.com.tw/plog/index.php?op=ViewArticle&articleId=761&blogId=131 我查到的解決方式 我改完之後如下
core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 16255 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 819200 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 102400 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ulimit:顯示(或設定)用戶可以使用的資源限制 ulimit -a 顯示用戶可以使用的資源限制 ulimit unlimited 不限制用戶可以使用的資源,但本設定對可打開的最大文件數(max open files) 和可同時執行的最大進程數(max user processes)無效 ulimit -n <可以同時打開的檔案數> 設定用戶可以同時打開的最大檔案數(max open files) 例如:ulimit -n 8192 如果本參數設定過小,對於併發訪問量大的網站,可能會出現too many open files的錯誤 ulimit -u <可以執行的最大併發進程數> 設定用戶可以同時執行的最大進程數(max user processes) 例如:ulimit -u 1024
FreeBSD + Lighttpd + php + mysql 安裝過程
Posted on September 20, 2006
| 1 minutes
| 115 words
| appleboy
系統環境 :FreeBSD 6.0-RELEASE 安裝過程如下:
mysql-server-5.0.24a php5-5.1.6 lighttpd-1.4.11_1 先安裝 lighttpd
cd /usr/ports/www/lighttpd/ make config [X] OPENSSL Enable SSL support [ ] OPENLDAP Enable LDAP support [X] MYSQL Enable MYSQL support [X] IPV6 Enable IPV6 support [X] CML Enable Cache Meta Language support make install clean 安裝 mysql cd /usr/ports/databases/mysql50-server make install clean WITH_CHARSET=utf8 WITH_LINUXTHREADS=yes 安裝 php cd /usr/ports/lang/php5 cd /usr/ports/lang/php5-extensions/ make config 選擇你想要的 extensions 灌好之後 就可以用了 然後打開 家目錄設定 userdir.path = “public_html” userdir.
[Read More]Linux 大量建制帳號
Posted on September 18, 2006
| 1 minutes
| 55 words
| appleboy
| <td bgcolor="#fffff1">
<table width="479" style="table-layout: fixed; height: 86px">
<tr>
<td>
<span class="postbody"><a title="http://phorum.study-area.org/viewtopic.php?t=27276" href="http://phorum.study-area.org/viewtopic.php?t=27276">http://phorum.study-area.org/viewtopic.php?t=27276</a> <a title="http://linux.vbird.org/linux_basic/0410accountmanager.php#manual_amount" href="http://linux.vbird.org/linux_basic/0410accountmanager.php#manual_amount"> http://linux.vbird.org/linux_basic/0410accountmanager.php#manual_amount</a></span>
</td>
</tr>
</table>
</td>
for line in cat account.txt
do account=echo $line | cut -d : -f 1
passwd=echo $line | cut -d : -f 2
useradd -m $account echo $account:$passwd | chpasswd done account.txt 格式: account:password