#crontab -e
在第一行加入MAILTO=""
2012年10月13日 星期六
2012年10月11日 星期四
HTML 常用的META
語系
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-TW" />
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Language" content="ja" />
適用於FB分享
<meta property="og:site_name" content="/>
<meta property="og:url" content="">
<meta property="og:title" content="">
<meta property="og:description" content="">
https://developers.facebook.com/docs/opengraphprotocol/
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-TW" />
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Language" content="ja" />
適用於FB分享
<meta property="og:site_name" content="/>
<meta property="og:url" content="">
<meta property="og:title" content="">
<meta property="og:description" content="">
https://developers.facebook.com/docs/opengraphprotocol/
2012年10月6日 星期六
CentOS 6 安裝 MRTG
#安裝基本套件
yum -y install perl gd libpng zlib mrtg httpd net-snmp net-snmp-utils
#設定與啟動 SNMP
vim /etc/snmp/snmpd.conf
#增加下列兩行
view systemview included .1.3.6.1.2.1.2.2.1.10
view systemview included .1.3.6.1.2.1.2.2.1.16
啟動 SNMP
$service snmpd restart
設定開機啟動
#chkconfig snmpd on
#設定 MRTG
vi /etc/mrtg/mrtg.cfg
#增加以下數行
Language: big5
Target[eth0]: 2:public@127.0.0.1
MaxBytes[eth0]: 1250000
Title[eth0]: Traffic Analysis
PageTop[eth0]: <H1>127.0.0.1 eth0</H1>
#產生基本網頁
#執行 3 次下面指令, 產生基本網頁
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
#產生 MRTG 首頁
indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
#設定排程
crontab -e
*/5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
#開放其他機器查詢MRTG&調整編碼
vi /etc/httpd/conf.d/mrtg.conf
#原參數
Alias /mrtg /var/www/mrtg
<Location /mrtg>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</Location>
#增加允許瀏覽的主機或網段
Alias /mrtg /var/www/mrtg
<Location /mrtg>
# Order deny,allow
# Deny from all
AddDefaultCharset big5
Allow from 192.168.0.0/255.255.255.0
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</Location>
--
官方網頁
http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html
yum -y install perl gd libpng zlib mrtg httpd net-snmp net-snmp-utils
#設定與啟動 SNMP
vim /etc/snmp/snmpd.conf
#增加下列兩行
view systemview included .1.3.6.1.2.1.2.2.1.10
view systemview included .1.3.6.1.2.1.2.2.1.16
啟動 SNMP
$service snmpd restart
設定開機啟動
#chkconfig snmpd on
#設定 MRTG
vi /etc/mrtg/mrtg.cfg
#增加以下數行
Language: big5
Target[eth0]: 2:public@127.0.0.1
MaxBytes[eth0]: 1250000
Title[eth0]: Traffic Analysis
PageTop[eth0]: <H1>127.0.0.1 eth0</H1>
#產生基本網頁
#執行 3 次下面指令, 產生基本網頁
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
#產生 MRTG 首頁
indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
#設定排程
crontab -e
*/5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
#開放其他機器查詢MRTG&調整編碼
vi /etc/httpd/conf.d/mrtg.conf
#原參數
Alias /mrtg /var/www/mrtg
<Location /mrtg>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</Location>
#增加允許瀏覽的主機或網段
Alias /mrtg /var/www/mrtg
<Location /mrtg>
# Order deny,allow
# Deny from all
AddDefaultCharset big5
Allow from 192.168.0.0/255.255.255.0
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</Location>
--
官方網頁
http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html
CentOS MySQL 調整
1、複製my-large.cnf文件到/etc/my.cnf cp /usr/share/doc/mysql-server-5.1.61/my-large.cnf /etc/my.cnf 2、打開my.cnf修改編碼 vi /etc/my.cnf
[client]
character-set-server = utf8
[mysql]
character-set-server = utf8
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
3、重啟MySQL服務 service mysqld restart 4、登錄mysql看看修改成功否 show variables like 'character%'; 5.更新密碼 UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
CentOS 啟用memcached
#yum install -y memcached php5-memcache
#vi /etc/php.ini
session.save_handler = files
修改成
session.save_handler = memcache
session.save_path="tcp://127.0.0.1:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
#vi /etc/sysconfig/memcached
#service memcached restart
#service httpd restart
查看狀態
memcached-tool 127.0.0.1:11211 stats
memcached-tool 127.0.0.1:11211 display
memcached-tool 127.0.0.1:11211 dump
設定開機啟用
chkconfig memcached on
可以解決session 檔案過多,造成效能下降的狀況
#vi /etc/php.ini
session.save_handler = files
修改成
session.save_handler = memcache
session.save_path="tcp://127.0.0.1:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
#vi /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS=""
#service memcached restart
#service httpd restart
查看狀態
memcached-tool 127.0.0.1:11211 stats
memcached-tool 127.0.0.1:11211 display
memcached-tool 127.0.0.1:11211 dump
設定開機啟用
chkconfig memcached on
可以解決session 檔案過多,造成效能下降的狀況
訂閱:
意見 (Atom)