Web Server(Nginx为例)
1、为防止跨站感染,要做虚拟主机目录隔离(我是直接利用fpm建立多个程序池达到隔离效果)
2、上传目录、include类的库文件目录要禁止代码执行(Nginx正则过滤)
3、path_info漏洞修正:
if ($request_filename ~* (.*)\.php) {
set $php_url $1;
}
if (!-e $php_url.php) {
return 404;
}
4、重新编译Web Server,隐藏Server信息。
5、打开相关级别的日志,追踪可疑请求,请求者IP等相关信息。
改变目录和文件属性,禁止写入
find -type f -name \*.php -exec chmod 444 {} \;
find -type d -exec chmod 555 {} \;
注:当然要排除上传目录、缓存目录等;
同时最好禁止chmod函数,攻击者可通过chmod来修改文件只读属性再修改文件!
PHP配置
禁用危险函数:
dl,eval,exec,passthru,system,popen,shell_exec,proc_open,proc_terminate,curl_exec,curl_multi_exec,show_source,touch,escapeshellcmd,escapeshellarg
MySQL账号安全:
禁止mysql用户外部链接,程序不要使用root账号,最好单独建立一个有限权限的账号专门用于Web程序。
查杀木马、后门
常见的一句话后门:
grep -r –include=*.php ‘[^a-z]eval($_POST’ . > grep.txt
grep -r –include=*.php ‘file_put_contents(.*$_POST\[.*\]);’ . > grep.txt
把搜索结果写入文件,下载下来慢慢分析,其他特征木马、后门类似。有必要的话可对全站所有文件来一次特征查找,上传图片肯定有也捆绑的,来次大清洗。
查找近2天被修改过的文件:
find -mtime -2 -type f -name \*.php
注意:攻击者可能会通过touch函数来修改文件时间属性来避过这种查找,所以touch必须禁止
最后要及时补上Web程序漏洞
总结
木马、后门查杀是个漫长的过程,网站一旦被入侵任何旮旯拐角都可能留下后门。中途可能和攻击者进行神交,摸清攻击者的性格、习性等,这些都有利于查杀。要现需谨慎地和攻击者交流,期间就有几个攻击者加我QQ和我交流。
也是个很有意思的过程
1、为防止跨站感染,要做虚拟主机目录隔离(我是直接利用fpm建立多个程序池达到隔离效果)
2、上传目录、include类的库文件目录要禁止代码执行(Nginx正则过滤)
3、path_info漏洞修正:
if ($request_filename ~* (.*)\.php) {
set $php_url $1;
}
if (!-e $php_url.php) {
return 404;
}
4、重新编译Web Server,隐藏Server信息。
5、打开相关级别的日志,追踪可疑请求,请求者IP等相关信息。
改变目录和文件属性,禁止写入
find -type f -name \*.php -exec chmod 444 {} \;
find -type d -exec chmod 555 {} \;
注:当然要排除上传目录、缓存目录等;
同时最好禁止chmod函数,攻击者可通过chmod来修改文件只读属性再修改文件!
PHP配置
禁用危险函数:
dl,eval,exec,passthru,system,popen,shell_exec,proc_open,proc_terminate,curl_exec,curl_multi_exec,show_source,touch,escapeshellcmd,escapeshellarg
MySQL账号安全:
禁止mysql用户外部链接,程序不要使用root账号,最好单独建立一个有限权限的账号专门用于Web程序。
查杀木马、后门
常见的一句话后门:
grep -r –include=*.php ‘[^a-z]eval($_POST’ . > grep.txt
grep -r –include=*.php ‘file_put_contents(.*$_POST\[.*\]);’ . > grep.txt
把搜索结果写入文件,下载下来慢慢分析,其他特征木马、后门类似。有必要的话可对全站所有文件来一次特征查找,上传图片肯定有也捆绑的,来次大清洗。
查找近2天被修改过的文件:
find -mtime -2 -type f -name \*.php
注意:攻击者可能会通过touch函数来修改文件时间属性来避过这种查找,所以touch必须禁止
最后要及时补上Web程序漏洞
总结
木马、后门查杀是个漫长的过程,网站一旦被入侵任何旮旯拐角都可能留下后门。中途可能和攻击者进行神交,摸清攻击者的性格、习性等,这些都有利于查杀。要现需谨慎地和攻击者交流,期间就有几个攻击者加我QQ和我交流。
也是个很有意思的过程
这些都是非常基本的命令,希望这篇小短文对Linux新手有帮助:
查看某目录占用空间命令:
# du -sh DirPath
比如: du -sh /home/snail
查看某目录下有多少个文件命令:
# find DirPath -type f | wc -l
比如: find /home/snail -type f | wc -l
如果想查看 src 目录下有多少 C 文件,如下:
# find ./src -type f -name "*.c" | wc -l
find 命令的 -type 后的参数有以下选择,每种都代表不一样的“类型(type)”
-type 文件类型
b 块文件(比如内存)
c 字符文件(比如串口)
d 目录文件(目录也是一种文件)
p 有名管道(FIFO)
f 普通文件
l 符号链接(如果使用 -L 或 -follow 选项则不起作用,除非链接损坏)
s socket文件(比如 /tmp/mysql.sock)
D door (Solaris)
------------------------------------------------------------------------------------------
查看某目录占用空间命令:
# du -sh DirPath
比如: du -sh /home/snail
查看某目录下有多少个文件命令:
# find DirPath -type f | wc -l
比如: find /home/snail -type f | wc -l
如果想查看 src 目录下有多少 C 文件,如下:
# find ./src -type f -name "*.c" | wc -l
find 命令的 -type 后的参数有以下选择,每种都代表不一样的“类型(type)”
-type 文件类型
b 块文件(比如内存)
c 字符文件(比如串口)
d 目录文件(目录也是一种文件)
p 有名管道(FIFO)
f 普通文件
l 符号链接(如果使用 -L 或 -follow 选项则不起作用,除非链接损坏)
s socket文件(比如 /tmp/mysql.sock)
D door (Solaris)
------------------------------------------------------------------------------------------
网站建好后,如何快速的增加网站外链是个让人头疼的问题,特别是一些新手,增加网站外链是SEO过程中必不可少的一部分,每个seoer初入行时便听说过“内容为王,外链为皇”这句话,从这句话我们不难看出,一个网站的优化工作的两个主方向就在于网站内容的建设以及外部链接建设,在完成网站整体布局之后,外链的建设就必须要考虑了,而且外链的建设是一个持续的过程,健康的外链对提升网站关键词排名非常有利。
说到外链,那对外链相关的几个名词做一下解释。
说到外链,那对外链相关的几个名词做一下解释。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>黑色简易的选项卡</title>
<style>
body,ul,li{margin:0;padding:0;}
body{font:12px/1.5 Tahoma;}
#outer{width:450px;margin:10px auto;}
#tab{overflow:hidden;zoom:1;background:#000;border:1px solid #000;}
#tab li{float:left;color:#fff;height:30px;cursor:pointer;line-height:30px;list-style-type:none;padding:0 20px;}
#tab li.current{color:#000;background:#ccc;}
#content{border:1px solid #000;border-top-width:0;}
#content ul{line-height:25px;display:none;margin:0 30px;padding:10px 0;}
</style>
<script>
window.onload = function ()
{
var oLi = document.getElementById("tab").getElementsByTagName("li");
var oUl = document.getElementById("content").getElementsByTagName("ul");
for(var i = 0; i < oLi.length; i++)
{
oLi[i].index = i;
oLi[i].onmouseover = function ()
{
for(var n = 0; n < oLi.length; n++) oLi[n].className="";
this.className = "current";
for(var n = 0; n < oUl.length; n++) oUl[n].style.display = "none";
oUl[this.index].style.display = "block"
}
}
}
</script>
</head>
<body>
<div id="outer">
<ul id="tab">
<li class="current">第一课</li>
<li>第二课</li>
<li>第三课</li>
</ul>
<div id="content">
<ul style="display:block;">
<li>网页特效原理分析</li>
<li>响应用户操作</li>
<li>提示框效果</li>
<li>事件驱动</li>
<li>元素属性操作</li>
<li>动手编写第一个JS特效</li>
<li>引入函数</li>
<li>网页换肤效果</li>
<li>展开/收缩播放列表效果</li>
</ul>
<ul>
<li>改变网页背景颜色</li>
<li>函数传参</li>
<li>高重用性函数的编写</li>
<li>126邮箱全选效果</li>
<li>循环及遍历操作</li>
<li>调试器的简单使用</li>
<li>典型循环的构成</li>
<li>for循环配合if判断</li>
<li>className的使用</li>
<li>innerHTML的使用</li>
<li>戛纳印象效果</li>
<li>数组</li>
<li>字符串连接</li>
</ul>
<ul>
<li>JavaScript组成:ECMAScript、DOM、BOM,JavaScript兼容性来源</li>
<li>JavaScript出现的位置、优缺点</li>
<li>变量、类型、typeof、数据类型转换、变量作用域</li>
<li>闭包:什么是闭包、简单应用、闭包缺点</li>
<li>运算符:算术、赋值、关系、逻辑、其他运算符</li>
<li>程序流程控制:判断、循环、跳出</li>
<li>命名规范:命名规范及必要性、匈牙利命名法</li>
<li>函数详解:函数构成、调用、事件、传参数、可变参、返回值</li>
<li>定时器的使用:setInterval、setTimeout</li>
<li>定时器应用:站长站导航效果</li>
<li>定时器应用:自动播放的选项卡</li>
<li>定时器应用:数码时钟</li>
<li>程序调试方法</li>
</ul>
</div>
</div>
</body>
</html>
兼容火狐的自由展开闭合的层
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>兼容火狐的自由展开闭合的层--青蛙实战|JS特效学院http://www.jsweb8.cn/</title>
<script language="javascript" type="text/javascript">
function k(vd)
{
var ob=document.getElementById(vd);
if(ob.style.display=="block")
{
ob.style.display="none";
var ob2=document.getElementById('s'+vd);
ob2.style.backgroundImage="url(http://www.jsweb8.cn/jsweb8/images/jia.gif)";
}
else
{
ob.style.display="block";
var ob2=document.getElementById('s'+vd);
ob2.style.backgroundImage="url(http://www.jsweb8.cn/jsweb8/images/jian.gif)";
}
}
//DESIGN BY 穿皮鞋的青蛙
//QQ:66118181
//欢迎光临JS特效学院http://www.jsweb8.cn/
</script>
<style type="text/css">
a{color: #000000;text-decoration: none;}
a:hover{color: #ff0000;text-decoration: underline;}
body{font-size:12px;}
.p{margin-left:10px;}
.content{ padding-left:20px;display:none; width:739px; background-color:#f8f8f8;border:#dedede solid 1px; height:auto; overflow:hidden; margin:4px auto; line-height:22px }
.title{cursor:pointer;background-position: 4px;line-height:25px;padding-left:20px;height:25px;width:739px;border:#dedede solid 1px;background-color:#f8f8f8;background-image: url(http://www.jsweb8.cn/jsweb8/images/jia.gif);background-repeat: no-repeat;margin:5px auto ;}
.vessel{padding: 0; width:750px; margin:0 auto}
</style>
</head>
<body >
<div class="vessel">
<div class="title" id="st1" onclick="k('t1')"><a href="#" onFocus="blur()"> [10/11/2008]第一条标题</a></div>
<div class="content" id="t1">
<p><a href="http://www.jsweb8.cn/" target="_blank">第一条内容</a></p>
<p><a href="http://www.jsweb8.cn/" target="_blank">第一条内容</a></p>
</div>
<div class="title" id="st2" onclick="k('t2')"><a href="#" onFocus="blur()"> [27/10/2008]第二条标题</a></div>
<div class="content" id="t2">
<p><a href="http://www.jsweb8.cn/" target="_blank">第二条内容</a></p><p><a href="http://www.jsweb8.cn/" target="_blank">第二条内容</a></p>
</div>
<div class="title" id="st3" onclick="k('t3')"><a href="#" onFocus="blur()"> [13/09/2008]第三条标题</a></div>
<div class="content" id="t3">
<p><a href="http://www.jsweb8.cn/" target="_blank">第三条内容</a></p>
<p><a href="http://www.jsweb8.cn/" target="_blank">第三条内容</a></p>
</div>
<div class="title" id="st4" onclick="k('t4')"><a href="#" onFocus="blur()"> [13/09/2008]第四条标题</a></div>
<div class="content" id="t4">
<p><a href="http://www.jsweb8.cn/" target="_blank">第四条内容</a></p>
<p><a href="http://www.jsweb8.cn/" target="_blank">第四条内容</a></p>
</div>
<div class="title" id="st5" onclick="k('t5')"><a href="#" onFocus="blur()">[01/10/2008]第五条标题</a></div>
<div class="content" id="t5">
<p><a href="http://www.jsweb8.cn/" target="_blank">第五条内容</a></p>
<p><a href="http://www.jsweb8.cn/" target="_blank">第五条内容</a></p>
</div>
</div>
尊重他人劳动成果,转载请注明来源<a href="http://www.jsweb8.cn/" target="_blank">JS特效学院</a>
</body>
</html>
[/coe]
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>兼容火狐的自由展开闭合的层--青蛙实战|JS特效学院http://www.jsweb8.cn/</title>
<script language="javascript" type="text/javascript">
function k(vd)
{
var ob=document.getElementById(vd);
if(ob.style.display=="block")
{
ob.style.display="none";
var ob2=document.getElementById('s'+vd);
ob2.style.backgroundImage="url(http://www.jsweb8.cn/jsweb8/images/jia.gif)";
}
else
{
ob.style.display="block";
var ob2=document.getElementById('s'+vd);
ob2.style.backgroundImage="url(http://www.jsweb8.cn/jsweb8/images/jian.gif)";
}
}
//DESIGN BY 穿皮鞋的青蛙
//QQ:66118181
//欢迎光临JS特效学院http://www.jsweb8.cn/
</script>
<style type="text/css">
a{color: #000000;text-decoration: none;}
a:hover{color: #ff0000;text-decoration: underline;}
body{font-size:12px;}
.p{margin-left:10px;}
.content{ padding-left:20px;display:none; width:739px; background-color:#f8f8f8;border:#dedede solid 1px; height:auto; overflow:hidden; margin:4px auto; line-height:22px }
.title{cursor:pointer;background-position: 4px;line-height:25px;padding-left:20px;height:25px;width:739px;border:#dedede solid 1px;background-color:#f8f8f8;background-image: url(http://www.jsweb8.cn/jsweb8/images/jia.gif);background-repeat: no-repeat;margin:5px auto ;}
.vessel{padding: 0; width:750px; margin:0 auto}
</style>
</head>
<body >
<div class="vessel">
<div class="title" id="st1" onclick="k('t1')"><a href="#" onFocus="blur()"> [10/11/2008]第一条标题</a></div>
<div class="content" id="t1">
<p><a href="http://www.jsweb8.cn/" target="_blank">第一条内容</a></p>
<p><a href="http://www.jsweb8.cn/" target="_blank">第一条内容</a></p>
</div>
<div class="title" id="st2" onclick="k('t2')"><a href="#" onFocus="blur()"> [27/10/2008]第二条标题</a></div>
<div class="content" id="t2">
<p><a href="http://www.jsweb8.cn/" target="_blank">第二条内容</a></p><p><a href="http://www.jsweb8.cn/" target="_blank">第二条内容</a></p>
</div>
<div class="title" id="st3" onclick="k('t3')"><a href="#" onFocus="blur()"> [13/09/2008]第三条标题</a></div>
<div class="content" id="t3">
<p><a href="http://www.jsweb8.cn/" target="_blank">第三条内容</a></p>
<p><a href="http://www.jsweb8.cn/" target="_blank">第三条内容</a></p>
</div>
<div class="title" id="st4" onclick="k('t4')"><a href="#" onFocus="blur()"> [13/09/2008]第四条标题</a></div>
<div class="content" id="t4">
<p><a href="http://www.jsweb8.cn/" target="_blank">第四条内容</a></p>
<p><a href="http://www.jsweb8.cn/" target="_blank">第四条内容</a></p>
</div>
<div class="title" id="st5" onclick="k('t5')"><a href="#" onFocus="blur()">[01/10/2008]第五条标题</a></div>
<div class="content" id="t5">
<p><a href="http://www.jsweb8.cn/" target="_blank">第五条内容</a></p>
<p><a href="http://www.jsweb8.cn/" target="_blank">第五条内容</a></p>
</div>
</div>
尊重他人劳动成果,转载请注明来源<a href="http://www.jsweb8.cn/" target="_blank">JS特效学院</a>
</body>
</html>
[/coe]
终端登录系统后检查日志发现 ip_conntrack: table full, dropping packet. 错误:
# vi /var/log/messages
...
Nov 8 08:54:58 server kernel: ip_conntrack: table full, dropping packet.
Nov 8 08:55:03 server kernel: printk: 49 messages suppressed.
Nov 8 08:55:03 server kernel: ip_conntrack: table full, dropping packet.
Nov 8 08:55:08 server kernel: printk: 49 messages suppressed.
...
# vi /var/log/messages
...
Nov 8 08:54:58 server kernel: ip_conntrack: table full, dropping packet.
Nov 8 08:55:03 server kernel: printk: 49 messages suppressed.
Nov 8 08:55:03 server kernel: ip_conntrack: table full, dropping packet.
Nov 8 08:55:08 server kernel: printk: 49 messages suppressed.
...
在给VPS上的CentOS系统添加自动备份的作业时,执行:crontab -e,然后出现错误:“-bash: crontab: command not found”。
解决该错误,需要安装一个东西:vixie-cron。
执行:
yum install vixie-cron -y
就可以了
解决该错误,需要安装一个东西:vixie-cron。
执行:
yum install vixie-cron -y
就可以了
大家都知道mysql目前(5.1.x是现行用的最多的版本,至于最新版5.5.x有什么新的强大功能,就不得而知了)还是不支持sql语句直接跨服务器查询数据和操作数据的。但是我们要的数据在两个不同的服务器上数据库上,该怎么办?其实办法还是有的,谁叫网络上的牛人多啊。我这里就讲一下通过mysql federated 引擎 变相实现跨服务器的效果。废话少说,直接上操作步骤!
1.root登录mysql,输入show engines 结果如下(如果不尽相同纯属版本问题):
+------------+----------+----------------------------------------------------------------+
| Engine | Support | Comment |
+------------+----------+----------------------------------------------------------------+
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys |
| BerkeleyDB | NO | Supports transactions and page-level locking |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE | YES | Example storage engine |
| ARCHIVE | YES | Archive storage engine |
| CSV | YES | CSV storage engine |
| ndbcluster | DISABLED | Clustered, fault-tolerant, memory-based tables |
| FEDERATED | YES | Federated MySQL storage engine |
| MRG_MYISAM | YES | Collection of identical MyISAM tables |
| ISAM | NO | Obsolete storage engine |
+------------+----------+----------------------------------------------------------------+
如果 federated 显示不为 yes,也不用紧张,速度找到my.cnf文件,改配置文件一般在/etc/my.cnf 这里指linux服务器上的路径。打开编辑,找到[mysqld] 并在下面添加一行 federated 然后保存退出,重启服务,再进mysql,输入show engines 看看是不是 federated 为yes了。 如果一开始就没有federated这个项,就麻烦了。这里不多说了。
2.假设我有两个服务器A(192.168.0.10:3306) 和 B(192.168.0.11:3306)
在A上建数据库DB_A,DB_A上建表TB_A,TB_A上建字段id,name,sex....随意,然后添加一些测试数据。
在B上建数据库DB_B,DB_B上建表TB_A(不过这里的表不要工具建,直接上代码、、)
CREATE TABLE `TB_B` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`sex` varchar(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=federated connection ='mysql://root:123456@192.168.0.10:3306/DB_A/TB_A'
DEFAULT CHARSET=utf8;
注意:新建表的结构要和A服DB_A库TB_A表上的一致哦。。。
3.一切搞定后,在B服DB_B库上输入 select * from DB_B.TB_B 看看什么结果。是不是A服DB_A库TB_A表上的数据都可以在B服务器上显示了!其实原理和同步差不多,然而如果TB_A表上数据有变动的话,TB_B表也会时时跟进的,达到让数据保持一致的效果。既然数据都在一个服务器能显示了。接下来改怎么做,就不用多说了吧。
1.root登录mysql,输入show engines 结果如下(如果不尽相同纯属版本问题):
+------------+----------+----------------------------------------------------------------+
| Engine | Support | Comment |
+------------+----------+----------------------------------------------------------------+
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys |
| BerkeleyDB | NO | Supports transactions and page-level locking |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE | YES | Example storage engine |
| ARCHIVE | YES | Archive storage engine |
| CSV | YES | CSV storage engine |
| ndbcluster | DISABLED | Clustered, fault-tolerant, memory-based tables |
| FEDERATED | YES | Federated MySQL storage engine |
| MRG_MYISAM | YES | Collection of identical MyISAM tables |
| ISAM | NO | Obsolete storage engine |
+------------+----------+----------------------------------------------------------------+
如果 federated 显示不为 yes,也不用紧张,速度找到my.cnf文件,改配置文件一般在/etc/my.cnf 这里指linux服务器上的路径。打开编辑,找到[mysqld] 并在下面添加一行 federated 然后保存退出,重启服务,再进mysql,输入show engines 看看是不是 federated 为yes了。 如果一开始就没有federated这个项,就麻烦了。这里不多说了。
2.假设我有两个服务器A(192.168.0.10:3306) 和 B(192.168.0.11:3306)
在A上建数据库DB_A,DB_A上建表TB_A,TB_A上建字段id,name,sex....随意,然后添加一些测试数据。
在B上建数据库DB_B,DB_B上建表TB_A(不过这里的表不要工具建,直接上代码、、)
CREATE TABLE `TB_B` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`sex` varchar(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=federated connection ='mysql://root:123456@192.168.0.10:3306/DB_A/TB_A'
DEFAULT CHARSET=utf8;
注意:新建表的结构要和A服DB_A库TB_A表上的一致哦。。。
3.一切搞定后,在B服DB_B库上输入 select * from DB_B.TB_B 看看什么结果。是不是A服DB_A库TB_A表上的数据都可以在B服务器上显示了!其实原理和同步差不多,然而如果TB_A表上数据有变动的话,TB_B表也会时时跟进的,达到让数据保持一致的效果。既然数据都在一个服务器能显示了。接下来改怎么做,就不用多说了吧。
网上有诸多介绍源码安装Mysql时开启Federated引擎的方法,诸如:
./confiure --with-plugin-federated
./confiure --with-federated-storage-engine
但本人试验统统报unrecognized options错误,google了半天,居然是Mysql的bug ,至今未修复。
经测试(version:5.1.52)只有--with-plugins=federated能用:
./confiure --with-plugins=federated
安装完成后show engines查看:
+------------+--------+
| Engine | Support |
+------------+--------+
...
| FEDERATED | NO |
...
+------------+--------+
Federated引擎安装成功。
接着将其开启,修改my.cnf,在 [mysqld] 下添加一行:
federated
重启Mysql,完成。
./confiure --with-plugin-federated
./confiure --with-federated-storage-engine
但本人试验统统报unrecognized options错误,google了半天,居然是Mysql的bug ,至今未修复。
经测试(version:5.1.52)只有--with-plugins=federated能用:
./confiure --with-plugins=federated
安装完成后show engines查看:
+------------+--------+
| Engine | Support |
+------------+--------+
...
| FEDERATED | NO |
...
+------------+--------+
Federated引擎安装成功。
接着将其开启,修改my.cnf,在 [mysqld] 下添加一行:
federated
重启Mysql,完成。
假设我这里有大量图像、CSS、javascript等静态文件,分别放在后端服务器 192.168.1.5 和 192.168.1.6上,那么我如何利用nginx的反向代理功能将不同的 http_user_agent 请求发送到指定的服务器上呢?如 "Mozilla" 转发到 192.168.1.5 ,MSIE 转发到 192.168.1.6 。
Nginx web 服务器支持if条件表达式,由此来跳转或者使用不同的配置变量。在本文中需要使用 $http_user_agent 变量,它标记了用户浏览器的类别,版本以及操作系统的一些信息,语法如下:
Nginx web 服务器支持if条件表达式,由此来跳转或者使用不同的配置变量。在本文中需要使用 $http_user_agent 变量,它标记了用户浏览器的类别,版本以及操作系统的一些信息,语法如下: