2012年6月27日 星期三

阻擋spider 124.115



編輯apache22內httpd.conf


AllowOverride None
Order allow,deny
Allow from all
#底下添加,封鎖由124.115所有IP
Deny from 124.115



2012年6月13日 星期三

crontab 的設定,例行性執行

參照:http://carrl.blogspot.tw/2005/03/freebsd-crontab.html
為避免該日誌關閉,故複製其內容,sorry

Linux / FreeBSD OS下 , 要設定某時間自動執行某支程式 , 就要用到 cron , 這也可以稱為"例行性工作"
要設定 cron , 可以使用 crontab 這個指令
crontab [-u user] [-l | -e | -r]
參數說明 :
-u user :只有 root 能下達的參數,視察或編譯其他使用者的 crontab 內容
-l :列出 crontab 的內容
-e :編輯 crontab 的內容
-r :刪除 crontab 的內容

使用 crontab -e 進入編輯模式 , 可以看到類似以下的文字 :
0 12 * * 0 root ntpdate watch.stdtime.gov.tw
代表的意義是 => 每個星期天的 12:00 用 root 身分執行 ntpdate ... 的指令
詳細說明 :
星期身分要執行的指令
012**0rootntpdate watch.stdtime.gov.tw

星期為 0 代表星期天
* 號代表任何時候

使用 crontab -e 是設定個人自己的 "例行性工作"
如果要變更系統用的 "例行性工作" , 那就得要去修改 /etc/crontab 這個檔案了 , 其格式跟上面的說明一樣

==/etc/crontab目前設定值為==

59 * * * 0 root /usr/sbin/ntpdate -s time.stdtim


0 4 * * * root reboot

10 4 * * * root reboot

0 3 * * 3 root clrlog


Mysql Too many connections 解决方法

修改ee /etc/my.cnf

==my.cnf內容新增==
max_connections = 1000

修改完後重啟
/usr/local/etc/rc.d/mysql-server restart

2012年2月12日 星期日

網站主機換IP後設置

1.編輯etc/rc.conf
ifconfig_網路介面卡="inet xxx.xxx.xxx.xxx(欲更改的IP) netmask 255.255.255.0"
defaultrouter="xxx.xxx.xxx.xxx(欲更改的default gateway)"
2.修改etc/hosts
127.0.0.1 localhost
xxx.xxx.xxx.xxx localhost(區網內IP)
xxx.xxx.xxx.xxx localhost(對外WAN IP)
其餘照舊即可