Feb 08 2007
Add a e1000 netcard in esx 3.01
Add ethernet0.virtualDev = “e1000″ to your .vmx file, and you can use the Intel adapter (virtual)
Feb 08 2007
Add ethernet0.virtualDev = “e1000″ to your .vmx file, and you can use the Intel adapter (virtual)
Feb 07 2007
FreeBSD设置了PasswordAuthentication no还可以用password登陆?
配置ssh用key登陆,生成SSH钥
# ssh-keygen -t dsa
# cd ~/.ssh
# cp id_dsa.pub authorized_keys
# vi /etc/ssh/sshd_config
设 PasswordAuthentication no
重启sshd服务
# /etc/rc.d/sshd restart
但是还可以用password登陆,同时用key也可以?
Protocol 2 #仅仅是2, SSH2 服务。
PasswordAuthentication no
PermitEmptyPasswords no
最关键的是下面
# Change to no to disable PAM authentication
ChallengeResponseAuthentication no
# Set this to ‘no’ to disable PAM authentication (via challenge-response)
# and session processing.
UsePAM no
# 只要这两个设置为no,就解决问题,只能用公钥认证登陆
Feb 05 2007
关键词工具
Google Adwords关键词工具
查询指定关键词的扩展匹配,搜索量,趋势和受欢迎度.
https://adwords.google.com/select/KeywordToolExternal
百度相关搜索
按热门程序排序,列出指定关键词相关的扩展匹配及热门程度
http://d.baidu.com/rs.php
关键词密度分析工具
分析指定关键词在指定页面中出现的次数,及相应的百分比密度
中文:http://tool.cndw.com/Seo/Key_Density.asp
英文:http://www.keyworddensity.com/
关键词热门排行及指数
百度排行榜:http://top.baidu.com
Yahoo排行榜:http://misc.yahoo.com.cn/top_index.html
搜狗指数:http://www.sogou.com/top/?IPLOC=CN1102
搜搜龙虎榜:http://www.soso.com/lhb/s_i_sosolhb.shtml
Google工具
Google Sitemaps
Google推出的一项免费服务,一个杰出的SEO工具
http://www.google.com/webmasters/sit…_CN/about.html
Google Analytics
Google推出的免费分析服务.在市场营销和内容优化上提供很多专业报表.对搜索引擎营销有很大帮助.
http://www.google.com/analytics/zh-CN/
Google Dance 查询工具
不仅可以查询Dance情况,还可以通过E-mail及时获得每月google dance通知
http://www.seochat.com/googledance/
查看在GOOGLE各服务器上的PR值
利用这个工具,可以判断PR是否更新,预测更新后的PR值
http://www.seochat.com/seo-tools/future-pagerank
Google PR历史更新时间表
看看Google 2000看至今更新PR的具体时间和周期时长
http://www.seocompany.ca/pagerank/pa…date-list.html
链接工具
链接广泛度检测工具
反向链接查询工具.同时支持Google,百度,Yahoo等8个搜索引擎
http://tool.cndw.com/LinkIn/Index.asp
查询Google中链接的工具.可以抓取文本标题和链接.中文标题显示的是乱码
http://www.webconfs.com/google-backlink-checker.php
Yahoo新推出的链接检查工具,可以查询网站中所有被检索的页面以及反向链接情况
http://siteexplorer.search.yahoo.com/
同时查询Google,Yahoo,MSN中的链接数量
http://www.trafficzap.com/linkpopularity.php
无效链接检查工具
检查指定页面内的链接.包括链接有效性检查,链接文字,链接类型
http://www.seores.com/search/checkurl.asp
W3C GLink Checker
http://validator.w3.org/checklink
其他工具
国外主要搜索引擎和人工目录的关系表
一个Flash,解析国外主流搜索引擎与人工目录的关系,对海外推广很有帮助
http://www.seobbs.net/read.php?tid=911
网站历史查询工具
美国互联网档案馆(The Internet Archive)保存了自1996年开始,借助Alexa搜索引擎获取的网站资料
http://web.archive.org/collections/web/advanced.html
分类目录收录查询
检查网站是否登录多个重要分类目录
http://www.123promotion.co.uk/directory/index.php
Alexa世界排名查询
http://alexa.chinaz.com/Index.asp
本文由樂思蜀整理,转发请注明出处及链接!
原发:点石互动
Feb 02 2007
2.) 安装PHP 5.2.0
[root@localhost]#./configure –prefix=/usr/local/server/php –with-mysql
–with-apxs2=/usr/local/server/apache/bin/apxs –with-freetype-dir=/usr/ –with-png-dir=/usr/
–with-gd=/usr/ –with-jpeg-dir=/usr/ –with-zlib –enable-magic-quotes –with-iconv
–without-sqlite –without-pdo-sqlite –with-pdo-mysql –disable-dom –disable-simplexml
–enable-roxen-zts
[root@localhost]#make && make install
备注:如果不需要gd或者pdo等模块,请自行去掉。
3.) 安装eAccelerator-0.9.5
[root@localhost]#cd eAccelerator-0.9.5
[root@localhost]#export PHP_PREFIX=/usr/local/server/php
[root@localhost]#$PHP_PREFIX/bin/phpize
[root@localhost]#./configure –enable-eaccelerator=shared –with-php-config=$PHP_PREFIX/bin/php-config
[root@localhost]#make && make install
4.) 安装memcache模块
[root@localhost]#cd memcache-2.1.0
[root@localhost]#export PHP_PREFIX=/usr/local/server/php
[root@localhost]#$PHP_PREFIX/bin/phpize
[root@localhost]#./configure –enable-eaccelerator=shared –with-php-config=$PHP_PREFIX/bin/php-config
[root@localhost]#make && make install
5.) 修改 php.ini 配置
然后修改 php.ini,修改/加入类似以下内容:
extension_dir = “/usr/local/server/php/lib/”
extension=”eaccelerator.so”
eaccelerator.shm_size=”32″ ;设定eaccelerator的共享内存为32MB
eaccelerator.cache_dir=”/usr/local/server/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”*.php”
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”3600″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
eaccelerator.log_file = “/usr/local/server/apache/logs/eaccelerator_log”
eaccelerator.allowed_admin_path = “/usr/local/server/apache/htdocs/ea_admin”
extension=”memcache.so”
在这里,最好是在apache的配置中增加默认文件类型的cache机制,即利用apache的expires模块,新增类似如下几行:
ExpiresActive On
ExpiresByType text/html “access plus 10 minutes”
ExpiresByType text/css “access plus 1 day”
ExpiresByType image/jpg “access 1 month”
ExpiresByType image/gif “access 1 month”
ExpiresByType image/jpg “access 1 month”
ExpiresByType application/x-shockwave-flash “access plus 3 day”
这么设置是由于我的这些静态文件通常很少更新,因此我选择的是”access”规则,如果更新相对比较频繁,可以改用”modification”规则;或者也可以用”access”规则,但是在文件更新的时候,执行一下”touch”命令,把文件的时间刷新一下即可。
Feb 02 2007
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
//===========================================
// 程序: mysql-Based Session Class
// 功能: 基于mysql存储的 Session 功能类
// 作者: yejr
// 网站: http://imysql.cn
// 时间: 2007-01-05
//===========================================
/**
* 类名: MySQL Session Class
* 功能: 自主实现基于MySQL HEAP表存储的 Session 功能
* 描述: 这个类就是实现Session的功能,基本上是通过设置客户端的Cookie来保存SessionID,
* 然后把用户的数据保存在服务器端,最后通过Cookie中的Session Id来确定一个数据是否是用户的,
* 然后进行相应的数据操作
*
* 注意: 本类调用了PEAR::DB类,如果有自己的DB类,则可以稍微修改一下代码
*
* 备注:数据表初始化SQL语句:
* CREATE TABLE `sessions` (
* `sid` varchar(32) NOT NULL default ”,
* `session` longtext,
* `flush_dt` int unsigned NOT NULL default ‘0′,
* PRIMARY KEY (`sid`),
* KEY `last` (`flush_dt`)
* ) ENGINE=HEAP;
*/
//设定 SESSION 有效时间,单位是 秒
define(’SESS_LIFTTIME’, 3600);
define(’DB_DSN’, ‘mysql://root:@localhost/test’);
define(’DB_NAME’,'test’);
require_once(’DB.php’);
$gDb = new DB;
$gDb = DB::connect(DB_DSN, TRUE);
if (PEAR::isError($gDb))
{
die($gDb->getMessage());
}
if (!defined(’MySQLSession’))
{
define(’MySQLSession’, TRUE);
class Usess
{
static $mSessSavePath;
static $mSessName;
static $mSessMaxTime;
static $mTblSess = ’sessions’;
static $mTblSessMap;
static $mDb;
// {{{ 初始化构造函数
/**
* 构造函数
*
* @param string $login_user 登录用户
* @param int $login_type 用户类型
* @param string $login_sess 登录Session值
* @return Esession
*/
public function __construct()
{
self::$mSessMaxTime = SESS_LIFTTIME;
self::$mTblSessMap = array(
’sid’ => ’sid’,
‘data’ => ’session’,
‘last’ => ‘flush_dt’,
);
}
// }}}
/** {{{ sessOpen($pSavePath, $name)
*
* @param String $pSavePath
* @param String $pSessName
*
* @return Bool TRUE/FALSE
*/
public function sessOpen($pSavePath = ”, $pSessName = ”)
{
global $gDb;
self::$mDb = $gDb;
self::$mSessSavePath = $pSavePath;
self::$mSessName = $pSessName;
self::sessGc();
return TRUE;
}
// }}}
/** {{{ sessClose()
*
* @param NULL
*
* @return Bool TRUE/FALSE
*/
public function sessClose()
{
return TRUE;
}
// }}}
/** {{{ sessRead($wSid)
*
* @param String $wSid
*
* @return Bool TRUE/FALSE
*/
public function sessRead($wSid = ”)
{
global $db;
$wSql = sprintf(”SELECT * FROM `%s`.`%s` WHERE `%s` = ‘%s’;”,
DB_NAME,
self::$mTblSess,
self::$mTblSessMap['sid'],
$wSid
);
//这里一定要用 DB_FETCHMODE_ASSOC,否则取回的数组只能用数字做下标
if (!PEAR::isError($row = self::$mDb->getRow($wSql, null, DB_FETCHMODE_ASSOC)))
{
//session已经存在了
if (is_array($row) && 1 <= count($row))
{
return $row[self::$mTblSessMap['data']];
}
else
{
$wSql = sprintf(”INSERT INTO `%s`.`%s` VALUES (’%s’, ”, UNIX_TIMESTAMP(NOW()));”,
DB_NAME,
self::$mTblSess,
$wSid
);
if (!PEAR::isError(self::$mDb->query($wSql)))
{
return TRUE;
}
}
}
return FALSE;
}
// }}}
/** {{{ sessWrite($wSid, $wData)
*
* @param String $wSid
* @param String $wData
*
* @return Bool TRUE/FALSE
*/
public function sessWrite($wSid = ”, $wData = ”)
{
$wData = mysql_escape_string($wData);
$wSql = sprintf(”UPDATE `%s`.`%s` SET `%s` = ‘%s’, `%s` = UNIX_TIMESTAMP(NOW()) WHERE `%s` = ‘%s’;”,
DB_NAME,
self::$mTblSess,
self::$mTblSessMap['data'],
$wData,
self::$mTblSessMap['last'],
self::$mTblSessMap['sid'],
$wSid
);
if (!PEAR::isError(self::$mDb->query($wSql)))
{
return TRUE;
}
return FALSE;
}
// }}}
/** {{{ sessDestroy($wSid)
*
* @param String $wSid
*
* @return Bool TRUE/FALSE
*/
public function sessDestroy($wSid = ”)
{
$wSql = sprintf(”DELETE FROM `%s`.`%s` WHERE `%s` = ‘%s’;”,
DB_NAME,
self::$mTblSess,
$wSid
);
if (!PEAR::isError(self::$mDb->query($wSql)))
{
return TRUE;
}
return FALSE;
}
// }}}
/** {{{ sessGc()
*
* @param NULL
*
* @return Bool TRUE/FALSE
*/
public function sessGc()
{
global $db;
//计算出过期时间
$last = time() - self::$mSessMaxTime;
$wSql = sprintf(”DELETE FROM `%s`.`%s` WHERE `%s` < $last;”, DB_NAME, self::$mTblSess, self::$mTblSessMap['last']);
if (!PEAR::isError(self::$mDb->query($wSql)))
{
return TRUE;
}
return FALSE;
}
// }}}
/** {{{ initSess()
*
* @param NULL
*
* @return Bool TRUE/FALSE
*/
public function initSess()
{
$domain = ”;
//不使用 GET/POST 变量方式
ini_set(’session.use_trans_sid’, 0);
//设置垃圾回收最大生存时间
ini_set(’session.gc_maxlifetime’, SESS_LIFTTIME);
//使用 COOKIE 保存 SESSION ID 的方式
ini_set(’session.use_cookies’, 1);
ini_set(’session.cookie_path’, ‘/’);
//多主机共享保存 SESSION ID 的 COOKIE
ini_set(’session.cookie_domain’, $domain);
//将 session.save_handler 设置为 user,而不是默认的 files
session_module_name(’user’);
//定义 SESSION 各项操作所对应的方法名:
session_set_save_handler(
array(’Usess’, ’sessOpen’), //对应于静态方法 My_Sess::open(),下同。
array(’Usess’, ’sessClose’),
array(’Usess’, ’sessRead’),
array(’Usess’, ’sessWrite’),
array(’Usess’, ’sessDestroy’),
array(’Usess’, ’sessGc’)
);
session_start();
return TRUE;
}
// }}}
}//end class
}//end define
$sess = new Usess;
$sess->initSess();
?>