Life is a Struggle

Lighttpd的WordPress的Rewrite规则

换了主机
服务器也从apache换成了Lighttpd
传说具有非常低的内存开销,cpu占用率低,效能好,以及丰富的模块等特点.其静态文件的响应能力远高于Apache,抗压能力一流,希望有机会体会体会
其他暂且不说,首先带来的确是整个blog访问不能 ,一时失察就这么丢这几天也没发现
今天寻思了半天才想起是因为服务器更换Rewrite失效的问题
编辑/etc/lighttpd/lighttpd.conf
加入以下代码,里面也包含了防盗连和301转向
#### WordPress url rewrite
$HTTP["host"] =~ “su.zaichangsha.com$” {
url.rewrite = (
“^/?$” => “/index.php”,
“^/(?.*)$” => “/index.php$1″,
“^/(wp-.+)$” => “$0″,
“^/([^.]+)/?$” => “/index.php?$1″,
)
#### 防盗链
$HTTP["referer"] !~ “^($|(ftp|http)://((.*.)nicelover.cn))” {
url.access-deny = ( “.wmv”, “.avi”, “.mpeg”, “.mpg”, “.mp3″, “.mp4″, “.mov”, “.wma”, “.iso”, “.swf” )
}
#### 301重定向
url.redirect = ( “^/index.php/(.+)” => “/$1″ )
}

phpMyAdmin:”Connection for controluser as defined in your configuration failed”

1. Type nano /etc/phpmyadmin/config.inc.php in the Linux terminal. You can substitute nano for vi or your favorite text editor.
2. Find the two blocks of text that read:
$cfg['Servers'][$i]['controluser'] = $dbuser;
$cfg['Servers'][$i]['controlpass'] = $dbpass;
one is near the top embedded in an if statement, and the other is towards the bottom. The text is not exactly the same for each block, but $cfg['Servers'][$i]['controluser'] is what matters. The block that is actually used by phpMyAdmin depends on your setup, but just for simplicity we will apply the change to both.
3. Just comment out those four lines by adding a // in front of each one.
4. Save, and the error should disappear next time you access phpMyAdmin. If you are still having trouble, feel free to post a comment.

1. Type nano /etc/phpmyadmin/config.inc.php in the Linux terminal. You can substitute nano for vi or your favorite text editor.2. Find the two blocks of text that read:
$cfg['Servers'][$i]['controluser'] = $dbuser;$cfg['Servers'][$i]['controlpass'] = $dbpass;
one is near the top embedded in an if statement, and the other is towards the bottom. The text is not exactly the same for each block, but $cfg['Servers'][$i]['controluser'] is what matters. The block that is actually used by phpMyAdmin depends on your setup, but just for simplicity we will apply the change to both.3. Just comment out those four lines by adding a // in front of each one.4. Save, and the error should disappear next time you access phpMyAdmin. If you are still having trouble, feel free to post a comment.

简而言之 注销

$cfg['Servers'][$i]['controluser'] = ‘pma’;

$cfg['Servers'][$i]['controlpass'] = ”;

即可解决问题,但后患未知,我也只是本地测试时如此应急而已.

返回顶部