<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[零度の热情]]></title> 
<link>http://www.hdj.me/index.php</link> 
<description><![CDATA[__遇见，半空蜜糖。]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[零度の热情]]></copyright>
<item>
<link>http://www.hdj.me/post/winserver-base-settings.php</link>
<title><![CDATA[windows服务器基本安全策略]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Fri, 25 Jun 2010 01:34:15 +0000</pubDate> 
<guid>http://www.hdj.me/post/winserver-base-settings.php</guid> 
<description>
<![CDATA[ 
	1、更改终端连接端口。<br/>2、更改超管名字，新建一个administrator无权限用户。<br/>3、更改SQL远程访问。<br/>4、禁止执行cmd.exe,reg.exe程序，需要的时候开启。<br/>5、启用网络TCP/IP筛选，在这里开放自己用的端口，如80,3306等。
]]>
</description>
</item><item>
<link>http://www.hdj.me/read.php/278.htm</link>
<title><![CDATA[Windows出新0day了]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Fri, 11 Jun 2010 08:59:34 +0000</pubDate> 
<guid>http://www.hdj.me/read.php/278.htm</guid> 
<description>
<![CDATA[ 
	很久没有出过这种级别的漏洞了。利用方法简直就是用几个小把戏组合成的大魔术，体现出相当程度的智慧之美。具体见http://seclists.org/fulldisclosure/2010/Jun/205。<br/><br/>简单地说，攻击者利用这个漏洞可以在你的电脑上执行任意程序，譬如说一个木马。<br/><br/>漏洞影响Windows XP和Windows 2003。Windows 2000、Windows Vista、Windows 7、Windows Server 2008不受影响。<br/><br/>解决方案就是暂时去掉hcp协议。如果你的操作系统是Windows XP或Windows 2003，可以按照下面的样子，打开命令提示符，执行两条命令。第一条的作用是备份，第二条是删除。等微软出了补丁，如果愿意，双击备份出来的hcp_backup.reg即可恢复hcp协议。<br/><br/>C:&#92; 命令提示符<br/><br/>Microsoft Windows XP [版本 5.1.2600]<br/>(C) 版权所有 1985-2001 Microsoft Corp.<br/><br/>C:&#92;> reg export HKEY_CLASSES_ROOT&#92;HCP hcp_backup.reg<br/>操作成功完成。<br/><br/>C:&#92;> reg delete HKEY_CLASSES_ROOT&#92;HCP /f<br/>操作成功完成。
]]>
</description>
</item><item>
<link>http://www.hdj.me/read.php/275.htm</link>
<title><![CDATA[linux挂载新设备及2T分区解决办法]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Fri, 04 Jun 2010 09:46:46 +0000</pubDate> 
<guid>http://www.hdj.me/read.php/275.htm</guid> 
<description>
<![CDATA[ 
	1、给硬盘分区<br/><br/>fdisk /dev/sdc<br/>Command (m for help): n<br/>Command action<br/>e extended<br/>p primary partition (1-4)<br/>输入：e<br/>Partition number (1-4): 1<br/>First cylinder (1-9729, default 1):回车<br/>Last cylinder or +size or +sizeM or +sizeK (1-9729, default 9729):回车<br/>Command (m for help):w(保存退出)<br/><br/>* fdisk或cfdisk不支持超过2T的分区，如果遇到超过2T的情况改用parted<br/>安装parted<br/>apt-get install parted<br/><br/>parted<br/>(parted)select /dev/sdc<br/>(parted)mklabel gpt<br/>(parted)mkpart primary xfs 0 -1 #把设备分成一个分区<br/>(parted)print #查看分区信息<br/>(parted)quit #退出<br/><br/>分区完成后用fdisk -l /dev/sdc 看到的结果并不正确。<br/><br/><br/>2、格式化硬盘<br/><br/>fdisk -l<br/>mkfs -t ext3 /dev/sdc1<br/>Writing superblocks and filesystem accounting information:直接回车。<br/><br/><br/>3、挂载<br/>mount /dev/sdc1 /home/mysql<br/><br/><br/>４、开机直接挂载<br/>编辑/etc/fstab　文件<br/>添加：/dev/sdc1 /home/mysql ext3 defaults 1 1<br/><br/>重启则发选已经挂载上去。<br/>
]]>
</description>
</item><item>
<link>http://www.hdj.me/read.php/263.htm</link>
<title><![CDATA[500 Internal Server Error原因]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Mon, 22 Feb 2010 06:23:32 +0000</pubDate> 
<guid>http://www.hdj.me/read.php/263.htm</guid> 
<description>
<![CDATA[ 
	今天在维护数据的时候，上传文件时遇到了500 Internal Server Error，查了一下<a href="/read.php/262.htm" target="_blank">服务器状态代码</a>，得到了一个很郁闷的答案：<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">500&nbsp;&nbsp;Internal Server Error&nbsp;&nbsp;服务器遇到了意料不到的情况，不能完成客户的请求。&nbsp;&nbsp;</div></div><br/><br/>后来上谷哥去百度了一下，传说有可能是硬盘空间满了导致的，用“鸭子”（du -ck）查看了一下，果然有一个分区的状态是100%。<br/><br/>估想了一下，应该是nginx的日志导致的，果然不出所料！<br/><br/>第一次自己解决问题，泪牛满面！
]]>
</description>
</item><item>
<link>http://www.hdj.me/read.php/262.htm</link>
<title><![CDATA[服务器状态代码含义]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Mon, 22 Feb 2010 06:22:34 +0000</pubDate> 
<guid>http://www.hdj.me/read.php/262.htm</guid> 
<description>
<![CDATA[ 
	<div class="quote"><div class="quote-title">引用</div><div class="quote-content">100&nbsp;&nbsp;Continue&nbsp;&nbsp;初始的请求已经接受，客户应当继续发送请求的其余部分。（HTTP 1.1新）&nbsp;&nbsp;<br/>101&nbsp;&nbsp;Switching Protocols&nbsp;&nbsp;服务器将遵从客户的请求转换到另外一种协议（HTTP 1.1新）&nbsp;&nbsp;<br/>200&nbsp;&nbsp;OK&nbsp;&nbsp;一切正常，对GET和POST请求的应答文档跟在后面。<br/>201&nbsp;&nbsp;Created&nbsp;&nbsp;服务器已经创建了文档，Location头给出了它的URL。&nbsp;&nbsp;<br/>202&nbsp;&nbsp;Accepted&nbsp;&nbsp;已经接受请求，但处理尚未完成。&nbsp;&nbsp;<br/>203&nbsp;&nbsp;Non-Authoritative Information&nbsp;&nbsp;文档已经正常地返回，但一些应答头可能不正确，因为使用的是文档的拷贝（HTTP 1.1新）。&nbsp;&nbsp;<br/>204&nbsp;&nbsp;No Content&nbsp;&nbsp;没有新文档，浏览器应该继续显示原来的文档。如果用户定期地刷新页面，而Servlet可以确定用户文档足够新，这个状态代码是很有用的。&nbsp;&nbsp;<br/>205&nbsp;&nbsp;Reset Content&nbsp;&nbsp;没有新的内容，但浏览器应该重置它所显示的内容。用来强制浏览器清除表单输入内容（HTTP 1.1新）。&nbsp;&nbsp;<br/>206&nbsp;&nbsp;Partial Content&nbsp;&nbsp;客户发送了一个带有Range头的GET请求，服务器完成了它（HTTP 1.1新）。&nbsp;&nbsp;<br/>300&nbsp;&nbsp;Multiple Choices&nbsp;&nbsp;客户请求的文档可以在多个位置找到，这些位置已经在返回的文档内列出。如果服务器要提出优先选择，则应该在Location应答头指明。&nbsp;&nbsp;<br/>301&nbsp;&nbsp;Moved Permanently&nbsp;&nbsp;客户请求的文档在其他地方，新的URL在Location头中给出，浏览器应该自动地访问新的URL。&nbsp;&nbsp;<br/>302&nbsp;&nbsp;Found&nbsp;&nbsp;类似于301，但新的URL应该被视为临时性的替代，而不是永久性的。注意，在HTTP1.0中对应的状态信息是“Moved Temporatily”。 出现该状态代码时，浏览器能够自动访问新的URL，因此它是一个很有用的状态代码。<br/>注意这个状态代码有时候可以和301替换使用。例如，如果浏览器错误地请求http://host/~user（缺少了后面的斜杠），有的服务器返回301，有的则返回302。<br/>严格地说，我们只能假定只有当原来的请求是GET时浏览器才会自动重定向。请参见307。<br/><br/>303&nbsp;&nbsp;See Other&nbsp;&nbsp;类似于301/302，不同之处在于，如果原来的请求是POST，Location头指定的重定向目标文档应该通过GET提取（HTTP 1.1新）。&nbsp;&nbsp;<br/>304&nbsp;&nbsp;Not Modified&nbsp;&nbsp;客户端有缓冲的文档并发出了一个条件性的请求（一般是提供If-Modified-Since头表示客户只想比指定日期更新的文档）。服务器告诉客户，原来缓冲的文档还可以继续使用。&nbsp;&nbsp;<br/>305&nbsp;&nbsp;Use Proxy&nbsp;&nbsp;客户请求的文档应该通过Location头所指明的代理服务器提取（HTTP 1.1新）。&nbsp;&nbsp;<br/>307&nbsp;&nbsp;Temporary Redirect&nbsp;&nbsp;和302（Found）相同。许多浏览器会错误地响应302应答进行重定向，即使原来的请求是POST，即使它实际上只能在POST 请求的应答是303时才能重定向。由于这个原因，HTTP 1.1新增了307，以便更加清除地区分几个状态代码：当出现303应答时，浏览器可以跟随重定向的GET和POST请求；如果是307应答，则浏览器只能跟随对GET请求的重定向。（HTTP 1.1新）&nbsp;&nbsp;<br/>400&nbsp;&nbsp;Bad Request&nbsp;&nbsp;请求出现语法错误。&nbsp;&nbsp;<br/>401&nbsp;&nbsp;Unauthorized&nbsp;&nbsp;客户试图未经授权访问受密码保护的页面。应答中会包含一个WWW-Authenticate头，浏览器据此显示用户名字/密码对话框，然后在填写合适的Authorization头后再次发出请求。&nbsp;&nbsp;<br/>403&nbsp;&nbsp;Forbidden&nbsp;&nbsp;资源不可用。服务器理解客户的请求，但拒绝处理它。通常由于服务器上文件或目录的权限设置导致。&nbsp;&nbsp;<br/>404&nbsp;&nbsp;Not Found&nbsp;&nbsp;无法找到指定位置的资源。这也是一个常用的应答。&nbsp;&nbsp;<br/>405&nbsp;&nbsp;Method Not Allowed&nbsp;&nbsp;请求方法（GET、POST、HEAD、DELETE、PUT、TRACE等）对指定的资源不适用。（HTTP 1.1新）&nbsp;&nbsp;<br/>406&nbsp;&nbsp;Not Acceptable&nbsp;&nbsp;指定的资源已经找到，但它的MIME类型和客户在Accpet头中所指定的不兼容（HTTP 1.1新）。&nbsp;&nbsp;<br/>407&nbsp;&nbsp;Proxy Authentication Required&nbsp;&nbsp;类似于401，表示客户必须先经过代理服务器的授权。（HTTP 1.1新）&nbsp;&nbsp;<br/>408&nbsp;&nbsp;Request Timeout&nbsp;&nbsp;在服务器许可的等待时间内，客户一直没有发出任何请求。客户可以在以后重复同一请求。（HTTP 1.1新）&nbsp;&nbsp;<br/>409&nbsp;&nbsp;Conflict&nbsp;&nbsp;通常和PUT请求有关。由于请求和资源的当前状态相冲突，因此请求不能成功。（HTTP 1.1新）&nbsp;&nbsp;<br/>410&nbsp;&nbsp;Gone&nbsp;&nbsp;所请求的文档已经不再可用，而且服务器不知道应该重定向到哪一个地址。它和404的不同在于，返回407表示文档永久地离开了指定的位置，而404表示由于未知的原因文档不可用。（HTTP 1.1新）&nbsp;&nbsp;<br/>411&nbsp;&nbsp;Length Required&nbsp;&nbsp;服务器不能处理请求，除非客户发送一个Content-Length头。（HTTP 1.1新）&nbsp;&nbsp;<br/>412&nbsp;&nbsp;Precondition Failed&nbsp;&nbsp;请求头中指定的一些前提条件失败（HTTP 1.1新）。&nbsp;&nbsp;<br/>413&nbsp;&nbsp;Request Entity Too Large&nbsp;&nbsp;目标文档的大小超过服务器当前愿意处理的大小。如果服务器认为自己能够稍后再处理该请求，则应该提供一个Retry-After头（HTTP 1.1新）。&nbsp;&nbsp;<br/>414&nbsp;&nbsp;Request URI Too Long&nbsp;&nbsp;URI太长（HTTP 1.1新）。&nbsp;&nbsp;<br/>416&nbsp;&nbsp;Requested Range Not Satisfiable&nbsp;&nbsp;服务器不能满足客户在请求中指定的Range头。（HTTP 1.1新）&nbsp;&nbsp;<br/>500&nbsp;&nbsp;Internal Server Error&nbsp;&nbsp;服务器遇到了意料不到的情况，不能完成客户的请求。&nbsp;&nbsp;<br/>501&nbsp;&nbsp;Not Implemented&nbsp;&nbsp;服务器不支持实现请求所需要的功能。例如，客户发出了一个服务器不支持的PUT请求。&nbsp;&nbsp;<br/>502&nbsp;&nbsp;Bad Gateway&nbsp;&nbsp;服务器作为网关或者代理时，为了完成请求访问下一个服务器，但该服务器返回了非法的应答。&nbsp;&nbsp;<br/>503&nbsp;&nbsp;Service Unavailable&nbsp;&nbsp;服务器由于维护或者负载过重未能应答。例如，Servlet可能在数据库连接池已满的情况下返回503。服务器返回503时可以提供一个Retry-After头。&nbsp;&nbsp;<br/>504&nbsp;&nbsp;Gateway Timeout&nbsp;&nbsp;由作为代理或网关的服务器使用，表示不能及时地从远程服务器获得应答。（HTTP 1.1新）&nbsp;&nbsp;<br/>505&nbsp;&nbsp;HTTP Version Not Supported&nbsp;&nbsp;服务器不支持请求中所指明的HTTP版本。（HTTP 1.1新）() </div></div>
]]>
</description>
</item><item>
<link>http://www.hdj.me/read.php/260.htm</link>
<title><![CDATA[粗心笔记之斜杠之祸]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Thu, 11 Feb 2010 04:33:49 +0000</pubDate> 
<guid>http://www.hdj.me/read.php/260.htm</guid> 
<description>
<![CDATA[ 
	Linux同步小工具rsync是一个不错的东西，根据文件列表的HASH算法进行文件同步。具体用法我就不说了，参考man。<br/><br/>不过却因为一个“/”，把哥害惨了！<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">/usr/bin/rsync -vzrtopg --progress --delete -e "ssh -p 22" root@server1:/home/web/path<strong><span style="color: #DC143C;">/</span></strong> /home/web</div></div><br/><br/>结果把我本地服务器/home/web目录下的所有文件都清了。<br/><br/>正确的写法应该是不包含以上命令中的红色斜杠。
]]>
</description>
</item><item>
<link>http://www.hdj.me/read.php/258.htm</link>
<title><![CDATA[tar打包小技巧——去掉指定目录]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Thu, 11 Feb 2010 00:07:45 +0000</pubDate> 
<guid>http://www.hdj.me/read.php/258.htm</guid> 
<description>
<![CDATA[ 
	打包的时候，如果你想去掉指定的一些目录，可以使用参数--exclude。<br/>有些版本的tar必须把--exclude参数放到目录前面，像以下格式。<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">tar cjvf www.deeka.cn.tar.gz --exclude "www.deeka.cn/down/*" --exclude "www.deeka.cn/mp3/*" www.deeka.cn/ </div></div><br/>但有些版本支持放在后面，如<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">tar cjvf www.deeka.cn.tar.gz www.deeka.cn/ --exclude "www.deeka.cn/down/*" --exclude "www.deeka.cn/mp3/*"</div></div><br/>但详细版本还没考究，如果知道的同学，请于评论告知我一声：）
]]>
</description>
</item><item>
<link>http://www.hdj.me/read.php/254.htm</link>
<title><![CDATA[为PHP编译ImageMagick扩展]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Tue, 02 Feb 2010 05:17:02 +0000</pubDate> 
<guid>http://www.hdj.me/read.php/254.htm</guid> 
<description>
<![CDATA[ 
	## 下载ImageMagick及imagick<br/>wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz<br/>wget http://pecl.php.net/get/imagick-3.0.0b2.tgz<br/><br/>## 检测系统是否已经安装<br/>convert -version<br/><br/>## 编译安装ImageMagick, 貌似apt-get install imagemagick也可以<br/>tar -xzvf ImageMagick.tar.gz<br/>./configure LDFLAGS="-L/usr/lib" CPPFLAGS="-I/usr/include" --prefix=/usr/local/ImageMagick --enable-shared --enable-lzw<br/>make<br/>make install<br/><br/>## 测试<br/>/usr/local/ImageMagick/bin/convert -version<br/>/usr/local/ImageMagick/bin/convert logo: logo.gif<br/><br/>## 编译安装php扩展<br/>tar xvf imagick-3.0.0b2.tgz<br/>cd imagick-3.0.0b2<br/>/usr/local/webserver/php/bin/phpize<br/>./configure --with-imagick=/usr/local/ImageMagick --with-php-config=/usr/local/webserver/php/bin/php-config<br/>make<br/>make install<br/><br/>## 修改php.ini<br/>vim /usr/local/webserver/php/etc/php.ini<br/>extension="imagick.so"<br/><br/>## 重启php<br/>killall -9 php-cgi && /usr/local/webserver/php/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 512 -u www-data -f /usr/local/webserver/php/bin/php-cgi<br/><br/>通过php转换ICO为PNG<br/><div class="code">&lt;?php<br/>&nbsp;&nbsp;&nbsp;&nbsp;//读取ico为二进制格式<br/>&nbsp;&nbsp;&nbsp;&nbsp;$imageStr = file_get_contents(&#039;a.ico&#039;);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//声明Imagick<br/>&nbsp;&nbsp;&nbsp;&nbsp;$im = new Imagick();<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//声明解决方式<br/>&nbsp;&nbsp;&nbsp;&nbsp;$im-&gt;setFormat(&#039;ico&#039;);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//读取<br/>&nbsp;&nbsp;&nbsp;&nbsp;$im-&gt;readImageBlob($imageStr);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//声明写方式<br/>&nbsp;&nbsp;&nbsp;&nbsp;$im-&gt;setImageFormat(&#039;png&#039;);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//生成新图像<br/>&nbsp;&nbsp;&nbsp;&nbsp;$im-&gt;writeImages(&quot;a.png&quot;, true);<br/>?&gt; <br/></div>
]]>
</description>
</item><item>
<link>http://www.hdj.me/read.php/241.htm</link>
<title><![CDATA[top进程字段]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Tue, 07 Jul 2009 01:00:56 +0000</pubDate> 
<guid>http://www.hdj.me/read.php/241.htm</guid> 
<description>
<![CDATA[ 
	PID<br/>进程id编号<br/><br/>USER&nbsp;&nbsp;&nbsp;&nbsp;<br/>进程所有者的用户名<br/><br/>PRI<br/>进程的优先级<br/><br/>SIZE<br/>进程大小，包括它的代码、栈和数据区域，以千字节为单位<br/><br/>RSS<br/>进程使用的内存总量，以千字节为单位<br/><br/>SHARE<br/>进程使用的共享内存数量<br/><br/>STAT<br/>进程的状态，通常R表示运行，S表示休眠<br/><br/>%CPU<br/>自从最近的屏幕更新以来，这个进程使用的CPU百分比<br/><br/>%MEM<br/>这个进程使用的内存百分比<br/><br/>TIME<br/>自从进程启动以来，这个进程使用的CPU时间量<br/><br/>CPU<br/>最近执行进程的CPU<br/><br/>COMMAND<br/>正在执行的命令 
]]>
</description>
</item><item>
<link>http://www.hdj.me/read.php/219.htm</link>
<title><![CDATA[Debian5配置DNS]]></title> 
<author>deeka &lt;admin@yourname.com&gt;</author>
<category><![CDATA[WEB Server]]></category>
<pubDate>Fri, 08 May 2009 09:25:56 +0000</pubDate> 
<guid>http://www.hdj.me/read.php/219.htm</guid> 
<description>
<![CDATA[ 
	在写PHP程序的时候用到 curl 类去远程取百度的搜索结果。<br/>顺便帖一下 curl 的代码吧，有兴趣的同学可以看看：<br/><br/><div class="code">$url = &quot;http://www.baidu.com/s?&quot; . $queryString;<br/><br/>//通过curl取远程数据<br/>$ch = curl_init();<br/>curl_setopt($ch, CURLOPT_URL, $url);<br/>curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,10);<br/>curl_setopt($ch, CURLOPT_HEADER, false);<br/>curl_setopt($ch, CURLOPT_NOBODY, false);<br/>curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);<br/>curl_setopt($ch, CURLOPT_FAILONERROR,1);<br/>curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER&#91;&quot;HTTP_USER_AGENT&quot;&#93;);&nbsp;&nbsp;//设置客户端<br/>$document = curl_exec($ch);</div><br/><br/>结果发现本地机子正常，而服务器那边取不到内容，提示错误：<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">name lookup timed out</div></div><br/>付出了惨重代价（给a总教训）之后，终于知道原来是服务器的DNS解析不了baidu.com。<br/>慌忙去百度一下看怎么配置LINUX的DNS：<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">$ cat /etc/resolv.conf<br/>nameserver 202.106.196.115</div></div>
]]>
</description>
</item>
</channel>
</rss>