<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>murray-专注于网站建设及优化</title>
	<atom:link href="http://www.murray.cn/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://murray.cn</link>
	<description>murray的后院</description>
	<pubDate>Sat, 14 Jan 2012 15:31:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>关于apache下网站加速利器mod-pagespeed</title>
		<link>http://murray.cn/index.php/2012/01/linux-apache-mod-pagespeed/</link>
		<comments>http://murray.cn/index.php/2012/01/linux-apache-mod-pagespeed/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 15:23:36 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[技术研究]]></category>

		<category><![CDATA[Apache]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[mod-pagespeed]]></category>

		<guid isPermaLink="false">http://murray.cn/?p=1230</guid>
		<description><![CDATA[自从有了自己独立服务器，一直认为自己网站速度还是挺快的，但自从上了监控宝之后，发现其实自己服务器的服务经常断。有很多时候网站是不可用的，这个让我很郁闷。一直在看dbanotes（大冯）的博客，知道他的服务器跟我都是在linode下，并且都是linux。然而我们的网站访问速度大相径庭。这一点肯定是我服务器没有配置好。
于是我通过查看两个网站页面HTTP状态，发现两个网站的网页返回HEAD信息差别不大，只有一个X-Mod-Pagespeed信息不知道是做什么的。看来这个参数的作用很大。
原来这是贴心的 Google 特为懒惰型网站主提供了傻瓜化解决方案，据称该模块可以有效将网页加载速度提高50%，Google这款加速模块简单的解决了许多复情况的问题：
-如果你的网站采用apache构建服务器，不需要对网站CMS系统进行处理即可应用；
-加速模块可以自行对网络传输的html字节优化及对图象，css进入压缩优化传输；
-智能缓存是一大亮点，它可以自动智能缓存，加速下载
以下是这个模块的版本
mod_pagespeed 32-bit .deb (Debian/Ubuntu)
mod_pagespeed 64-bit .deb (Debian/Ubuntu)
mod_pagespeed 32-bit .rpm (CentOS/Fedora)
mod_pagespeed 64-bit .rpm (CentOS/Fedora)
具体的安装方法：
首先先下载模块到服务器
如果你是debian的系统请运行一下命令
dpkg -i mod-pagespeed-*.deb
apt-get -f install
如果是centos的系统则
yum install at
rpm -U mod-pagespeed-*.rpm
重启APACHE后你会发现速度真的快了
]]></description>
			<content:encoded><![CDATA[<p>自从有了自己独立服务器，一直认为自己网站速度还是挺快的，但自从上了监控宝之后，发现其实自己服务器的服务经常断。有很多时候网站是不可用的，这个让我很郁闷。一直在看dbanotes（大冯）的博客，知道他的服务器跟我都是在linode下，并且都是linux。然而我们的网站访问速度大相径庭。这一点肯定是我服务器没有配置好。<br />
于是我通过查看两个网站页面HTTP状态，发现两个网站的网页返回HEAD信息差别不大，只有一个X-Mod-Pagespeed信息不知道是做什么的。看来这个参数的作用很大。<br />
原来这是贴心的 Google 特为懒惰型网站主提供了傻瓜化解决方案，据称该模块可以有效将网页加载速度提高50%，Google这款加速模块简单的解决了许多复情况的问题：<br />
-如果你的网站采用apache构建服务器，不需要对网站CMS系统进行处理即可应用；<br />
-加速模块可以自行对网络传输的html字节优化及对图象，css进入压缩优化传输；<br />
-智能缓存是一大亮点，它可以自动智能缓存，加速下载</p>
<p>以下是这个模块的版本<br />
mod_pagespeed 32-bit .deb (Debian/Ubuntu)<br />
mod_pagespeed 64-bit .deb (Debian/Ubuntu)<br />
mod_pagespeed 32-bit .rpm (CentOS/Fedora)<br />
mod_pagespeed 64-bit .rpm (CentOS/Fedora)<br />
具体的安装方法：<br />
首先先下载模块到服务器<br />
如果你是debian的系统请运行一下命令<br />
dpkg -i mod-pagespeed-*.deb<br />
apt-get -f install<br />
如果是centos的系统则<br />
yum install at<br />
rpm -U mod-pagespeed-*.rpm</p>
<p>重启APACHE后你会发现速度真的快了</p>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2012/01/linux-apache-mod-pagespeed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>php中json编码和解码的一些提示</title>
		<link>http://murray.cn/index.php/2011/12/php-json-encode-decode-array-object/</link>
		<comments>http://murray.cn/index.php/2011/12/php-json-encode-decode-array-object/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 06:56:12 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[技术研究]]></category>

		<category><![CDATA[array]]></category>

		<category><![CDATA[JSON]]></category>

		<category><![CDATA[json_decode]]></category>

		<category><![CDATA[json_encode]]></category>

		<category><![CDATA[object]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://murray.cn/?p=1227</guid>
		<description><![CDATA[对于php下的web service应用，json因其快速，轻量在小数据量传输的时候非常有优势，但用的时候有些小细节需要注意。我就是把数组存进去，再取出来的时候发现变成对象了，才发现原来是这样。
在运行环境上，json在php5.2以上才是内置的。
常用的方法是json_encode和json_decode。
json_encode的参数只有一个，就是要被转换的数据,而json_decode就不一样，他可以把json格式转换成对象(object)和数组两种
下面是个例子
$arr = array(&#8221;1&#8243;,&#8221;2&#8243;,&#8221;3&#8243;);
print_r($arr);
echo json_encode($arr);
print_r(json_decode(json_encode($arr)));
print_r(json_decode(json_encode($arr), true));
如果数组转成json，想解码回来的，别忘了加个参数true
]]></description>
			<content:encoded><![CDATA[<p>对于php下的web service应用，json因其快速，轻量在小数据量传输的时候非常有优势，但用的时候有些小细节需要注意。我就是把数组存进去，再取出来的时候发现变成对象了，才发现原来是这样。<br />
在运行环境上，json在php5.2以上才是内置的。<br />
常用的方法是json_encode和json_decode。<br />
json_encode的参数只有一个，就是要被转换的数据,而json_decode就不一样，他可以把json格式转换成对象(object)和数组两种<br />
下面是个例子<br />
$arr = array(&#8221;1&#8243;,&#8221;2&#8243;,&#8221;3&#8243;);<br />
print_r($arr);<br />
echo json_encode($arr);<br />
print_r(json_decode(json_encode($arr)));<br />
print_r(json_decode(json_encode($arr), true));</p>
<p>如果数组转成json，想解码回来的，别忘了加个参数true</p>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2011/12/php-json-encode-decode-array-object/feed/</wfw:commentRss>
		</item>
		<item>
		<title>本博已于今天正式迁移到Linode</title>
		<link>http://murray.cn/index.php/2011/12/murraycn-move-to-linode/</link>
		<comments>http://murray.cn/index.php/2011/12/murraycn-move-to-linode/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 09:05:14 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[工作日志]]></category>

		<category><![CDATA[linode]]></category>

		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://murray.cn/?p=1225</guid>
		<description><![CDATA[为了便于管理今天本博已正式迁移到了linode，linode在东京的机房步给力啊，怎么有时候会ping超时呢
特此记录以下。
]]></description>
			<content:encoded><![CDATA[<p>为了便于管理今天本博已正式迁移到了linode，linode在东京的机房步给力啊，怎么有时候会ping超时呢</p>
<p>特此记录以下。</p>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2011/12/murraycn-move-to-linode/feed/</wfw:commentRss>
		</item>
		<item>
		<title>游戏服务器管理-文件同步的解决方案</title>
		<link>http://murray.cn/index.php/2011/07/game-linux-server-rsync-daemon/</link>
		<comments>http://murray.cn/index.php/2011/07/game-linux-server-rsync-daemon/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 07:49:34 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[工作日志]]></category>

		<guid isPermaLink="false">http://www.murray.cn/?p=1220</guid>
		<description><![CDATA[服务器均使用LINUX的CENTOS，同步程序使用Rsync，台湾服务器为Rsync的服务端
服务端配置
同步软件安装
yum -y install xinetd
启动rsync服务端
#rsync &#8211;daemon
配置同步软件为可用
vi /etc/xinetd.d/rsync
# default: off
# description: The rsync server is a good addition to an ftp server, as it /
#      allows crc checksumming etc.
service rsync
{
disable               = no       [...]]]></description>
			<content:encoded><![CDATA[<p>服务器均使用LINUX的CENTOS，同步程序使用Rsync，台湾服务器为Rsync的服务端</p>
<p>服务端配置</p>
<p>同步软件安装<br />
yum -y install xinetd</p>
<p>启动rsync服务端<br />
#rsync &#8211;daemon</p>
<p>配置同步软件为可用<br />
vi /etc/xinetd.d/rsync</p>
<p># default: off<br />
# description: The rsync server is a good addition to an ftp server, as it /<br />
#      allows crc checksumming etc.<br />
service rsync<br />
{<br />
disable               = no           // change<br />
socket_type      = stream<br />
wait                   = no<br />
user                 = root<br />
server             = /usr/bin/rsync<br />
server_args    = &#8211;daemon<br />
log_on_failure   += USERID<br />
}<br />
配置本地同步参数<br />
vi /etc/rsyncd.conf</p>
<p>[game-test-taiwan]<br />
path = /var/www/<br />
host allow = xx.xx.xx.xx<br />
host deny = *<br />
list = true<br />
uid = root<br />
gid = root</p>
<p>客户端配置</p>
<p>安装同步软件<br />
yum install -y rsync<br />
配置排除指定目录或文件(每条记录占一行，支持通配符)<br />
vi /etc/rsync-exclude-test</p>
<p>/xxxxxx</p>
<p>执行同步(从服务器端下拉)<br />
rsync -avz &#8211;delete &#8211;exclude-from=/etc/rsync-exclude-test 203.69.85.43::game-test-taiwan /var/backup<br />
执行同步(从客户端上传)<br />
rsync -avz &#8211;delete &#8211;exclude-from=/etc/rsync-exclude-test /var/backup 203.69.85.43::game-test-taiwan/forrsync</p>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2011/07/game-linux-server-rsync-daemon/feed/</wfw:commentRss>
		</item>
		<item>
		<title>wordpress获取当前分类页的ID</title>
		<link>http://murray.cn/index.php/2011/04/wordpress-cat-id-is_category-get_queried_object_id/</link>
		<comments>http://murray.cn/index.php/2011/04/wordpress-cat-id-is_category-get_queried_object_id/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 11:47:33 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[技术研究]]></category>

		<category><![CDATA[cat-id]]></category>

		<category><![CDATA[get_queried_object_id]]></category>

		<category><![CDATA[is_category]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.murray.cn/?p=1218</guid>
		<description><![CDATA[最近搞WORDPRESS的最新版，做模板的时候想获取当前分类的ID，以下是实现代码
获取当前分类页的ID
&#60;?php if (is_category()) {
 global $wp_query;
 $cat_id = $wp_query-&#62;get_queried_object_id();
 }
?&#62;
]]></description>
			<content:encoded><![CDATA[<p>最近搞WORDPRESS的最新版，做模板的时候想获取当前分类的ID，以下是实现代码</p>
<div><span>获取当前分类页的ID</span></div>
<div><span>&lt;?php if (is_category()) {</span></div>
<div><span> global $wp_query;</span></div>
<div><span> $cat_id = $wp_query-&gt;get_queried_object_id();</span></div>
<div><span> }</span></div>
<div><span>?&gt;</span></div>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2011/04/wordpress-cat-id-is_category-get_queried_object_id/feed/</wfw:commentRss>
		</item>
		<item>
		<title>android开发笔记</title>
		<link>http://murray.cn/index.php/2011/04/android%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/</link>
		<comments>http://murray.cn/index.php/2011/04/android%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 11:40:13 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[技术研究]]></category>

		<category><![CDATA[activitymanager]]></category>

		<category><![CDATA[android]]></category>

		<category><![CDATA[androidmanifest]]></category>

		<category><![CDATA[denied]]></category>

		<category><![CDATA[exception]]></category>

		<category><![CDATA[Permission]]></category>

		<guid isPermaLink="false">http://www.murray.cn/?p=1216</guid>
		<description><![CDATA[1. 修改了创建工程时候的默认activity的名称，发现发布项目时不能正常编译。编译的还是旧的名称，显示找不到：ActivityManager: Error: Activity class does not exist.
解决办法：在项目的根目录修改配置文件AndroidManifest.xml中的application中的activity
2. 对两个activity做跳转，发现部署后一直报错并“意外停止”，这是简单的小程序，不可能吃内存太多的。肯定是哪里不对。启用了debug模式，知道到logcat，发现里面有这样一句“ have you declared this activity in your AndroidManifest.xml”，看来又是AndroidManifest.xml的配置问题。果然在其中加了后，跳转后的activity正常了。
3. android程序在调试时出现了套接字异常“java.net.SocketException: Permission denied”。这是一个经典错误， Socket不能对外连接，错误不会被报出，调试的时候，能看到Exception,  一般是抛出 java.net.socketexception permission denied这个异常。只要你的程序想联网，就会抛出这个异常，最终联网失败。 原因是： 需要访问到网络必须要有权限，在AndroidManifest.xml中，需要进行如下配置：
4. could not write file images\/system.img, No space left on device一般的目录是这里C:\Documents and Settings\Administrator\.android，而这个盘已经满了，只剩下几十M的容量是不够的。（系统盘一般是C盘），因为空间不足就无法启动，删了一些文件后重新运行eclipse就好了
5. 往string[] 添加元素的方法，一个for循环中 string[i] = 对应item[i]
]]></description>
			<content:encoded><![CDATA[<p>1. 修改了创建工程时候的默认activity的名称，发现发布项目时不能正常编译。编译的还是旧的名称，显示找不到：ActivityManager: Error: Activity class does not exist.<br />
解决办法：在项目的根目录修改配置文件AndroidManifest.xml中的application中的activity<br />
2. 对两个activity做跳转，发现部署后一直报错并“意外停止”，这是简单的小程序，不可能吃内存太多的。肯定是哪里不对。启用了debug模式，知道到logcat，发现里面有这样一句“ have you declared this activity in your AndroidManifest.xml”，看来又是AndroidManifest.xml的配置问题。果然在其中加了后，跳转后的activity正常了。<br />
3. android程序在调试时出现了套接字异常“java.net.SocketException: Permission denied”。这是一个经典错误， Socket不能对外连接，错误不会被报出，调试的时候，能看到Exception,  一般是抛出 java.net.socketexception permission denied这个异常。只要你的程序想联网，就会抛出这个异常，最终联网失败。 原因是： 需要访问到网络必须要有权限，在AndroidManifest.xml中，需要进行如下配置：<br />
4. could not write file images\/system.img, No space left on device一般的目录是这里C:\Documents and Settings\Administrator\.android，而这个盘已经满了，只剩下几十M的容量是不够的。（系统盘一般是C盘），因为空间不足就无法启动，删了一些文件后重新运行eclipse就好了<br />
5. 往string[] 添加元素的方法，一个for循环中 string[i] = 对应item[i]</p>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2011/04/android%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Android开发常见问题及解决方法</title>
		<link>http://murray.cn/index.php/2011/04/google-android-eclipse-activity-service/</link>
		<comments>http://murray.cn/index.php/2011/04/google-android-eclipse-activity-service/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 11:38:40 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[技术研究]]></category>

		<category><![CDATA[activity]]></category>

		<category><![CDATA[android]]></category>

		<category><![CDATA[eclipse]]></category>

		<category><![CDATA[GOOGLE]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.murray.cn/?p=1212</guid>
		<description><![CDATA[1.ActivityManager: Warning: Activity not started, its current task has been brought to the front
说明：模拟器中已经有一个实例在运行。
解决方法：退出模拟器中运行的程序，再次运行即可解决！
2.No grammar constraints (DTD or XML schema) detected for the document
说明：在编辑器中看到像这样关于缺少语法约束（DTD 或 XML 架构）的警告，尽管忽略这些警告。
解决方法：windows -&#62; preferences -&#62; xml -&#62; xml files -&#62; validation -&#62; Indicate when no grammar is specified: 选择Ignore即可。
3.R.java: no such file or directory
说明：R类不存在。
解决方法：Windows-&#62;Preference-&#62;Java-&#62;Build Path中，将Folders改为选中Projects即可。
4.res\layout\*.xml: Invalid file name: must contain [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1.ActivityManager: Warning: Activity not started, its current task has been brought to the front</strong><br />
说明：模拟器中已经有一个实例在运行。<br />
解决方法：退出模拟器中运行的程序，再次运行即可解决！</p>
<p><strong>2.No grammar constraints (DTD or XML schema) detected for the document</strong><br />
说明：在编辑器中看到像这样关于缺少语法约束（DTD 或 XML 架构）的警告，尽管忽略这些警告。<br />
解决方法：windows -&gt; preferences -&gt; xml -&gt; xml files -&gt; validation -&gt; Indicate when no grammar is specified: 选择Ignore即可。</p>
<p><strong>3.R.java: no such file or directory</strong><br />
说明：R类不存在。<br />
解决方法：Windows-&gt;Preference-&gt;Java-&gt;Build Path中，将Folders改为选中Projects即可。</p>
<p><strong>4.res\layout\*.xml: Invalid file name: must contain only [a-z0-9_.]</strong><br />
说明：样式XML的文件名起的不符合要求。文件名中只能是小写英文字符、数字、&#8221;_&#8221;或者&#8221;.&#8221;。</p>
<p><strong>5.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES</strong><br />
说明：这样的问题主要是签名冲突造成的，比如你使用了ADB的debug权限签名，但后来使用标准sign签名后再安装同一个文件会出现这样的错误提示。<br />
解决方法：卸载原有版本再进行安装，而adb install -r参数是无法解决这个问题。</p>
<p><strong>6.Android程序为什么没有退出设计？</strong><br />
答：Google Android平台在设计程序声明周期上比较特殊，可能是考虑到第二次加载时保证速度的原因而没有强制加入内存释放问题，所有的资源回收由Dalvik GC自动完成，所以在设计开发时一定要注意Activity和 Service类的生命周期问题，显示在最上层的窗口将有最高的优先级，当Android操作系统内存不够用时自动将会根据历史栈按优先级强制杀掉进程。</p>
<p><strong>7.Emulator Control GPS轨迹发送按钮有时会变灰不可点。</strong><br />
答：重启Eclipse。</p>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2011/04/google-android-eclipse-activity-service/feed/</wfw:commentRss>
		</item>
		<item>
		<title>html中title没写完整造成同样的页面firefox可以显示，其他浏览器都是空白</title>
		<link>http://murray.cn/index.php/2011/04/html-titile-blank-firefox-ie-google-kongbai/</link>
		<comments>http://murray.cn/index.php/2011/04/html-titile-blank-firefox-ie-google-kongbai/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 07:29:20 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[工作日志]]></category>

		<category><![CDATA[blank]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[html]]></category>

		<category><![CDATA[IE]]></category>

		<category><![CDATA[meta]]></category>

		<category><![CDATA[TITLE]]></category>

		<guid isPermaLink="false">http://www.murray.cn/?p=1210</guid>
		<description><![CDATA[无聊的IE，失败的IE就是个垃圾。
不过也怪自己不好，一个页面在IE中或者在基于IE内核的浏览器中显示为一片空白，但是在火狐浏览器或者其他非IE浏览器中显示正常，这种情况下问题很有可能出现在Title标签上。
这次记住了：
1.title标签未写完整。
如：《title》murray-专注于网站建设及优化《title》，
解决办法：只要把它更改完整应该就没问题。
2.title标签位置不对。
如： 《title》murray-专注于网站建设及优化《/title》

解决办法：将meta标签内和title标签位置互换即可。
原因：Content-Type的位置出现在title之前。这使得IE浏览器不知怎么解释这个数据（按照图片解析还是按照文本解析），IE一片迷茫，所以就出现空白现象。FireFox 会“阅读”完所有代码后判断编码方式，自然不会出现空白现象。
]]></description>
			<content:encoded><![CDATA[<p>无聊的IE，失败的IE就是个垃圾。<br />
不过也怪自己不好，一个页面在IE中或者在基于IE内核的浏览器中显示为一片空白，但是在火狐浏览器或者其他非IE浏览器中显示正常，这种情况下问题很有可能出现在Title标签上。<br />
这次记住了：<br />
1.title标签未写完整。<br />
如：《title》murray-专注于网站建设及优化《title》，<br />
解决办法：只要把它更改完整应该就没问题。<br />
2.title标签位置不对。<br />
如： 《title》murray-专注于网站建设及优化《/title》<br />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br />
解决办法：将meta标签内和title标签位置互换即可。<br />
原因：Content-Type的位置出现在title之前。这使得IE浏览器不知怎么解释这个数据（按照图片解析还是按照文本解析），IE一片迷茫，所以就出现空白现象。FireFox 会“阅读”完所有代码后判断编码方式，自然不会出现空白现象。</p>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2011/04/html-titile-blank-firefox-ie-google-kongbai/feed/</wfw:commentRss>
		</item>
		<item>
		<title>linode服务器重装全纪录</title>
		<link>http://murray.cn/index.php/2011/03/linode-server-rebuild-install/</link>
		<comments>http://murray.cn/index.php/2011/03/linode-server-rebuild-install/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 04:54:24 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[技术研究]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[fdisk]]></category>

		<category><![CDATA[install]]></category>

		<category><![CDATA[linode]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[mount]]></category>

		<category><![CDATA[rebuild]]></category>

		<guid isPermaLink="false">http://www.murray.cn/?p=1206</guid>
		<description><![CDATA[大家都说linode好用，还真的好用，这么一转眼就用了一年半了。最近刚刚重装了自己在LINODE的服务器。在此之前，我用的是debian，后来发现centos用起来太方便了。于是就琢磨着把系统换一下。在网上，查了好久的资料没有一个相对完整的解决方案。于是，我只好临时买了一个新的linode节点，做测试。下面就把大致的过程写出来。
其实，Linode的系统重装很快很方便。主要就是之前你的数据怎么整理，备份再在重装后恢复回来。
我的解决办法分两步：
1，首先先把现有的linode节点重新划分，把现有的一个镜像盘分为两个，举例来说，我现在的linode系统分为两个硬盘镜像(disk image):512MB Swap Image和Debian Disk Image，其中Debian Disk Image有16G，所有的东西都在这里。我用linode的resize工具现将16G中没有用到的10G划分出来。然后再新建一个硬盘镜像（Create a new Disk Image），把这10G作为一个外挂硬盘来用，命名为：extdisk。（注意:以上操作要先关闭系统）
2，在Lionde的系统配置部分（Configuration Profiles）找到自己的debian配置，点击编辑(edit)，找到外挂硬盘（Block Device Assignment）部分，在/dev/xvdc这里下拉找到新建的外挂硬盘extdisk，保存设置。然后启动操作系统。
3，正常登录操作系统，首先查看外挂硬盘是否正常，打入fdisk -l 发现列表中已经有/dev/xvdc，接下来，我们就要想办法把外挂硬盘挂入操作系统了。现在你想挂入的地方新建一个目录，比如我选在根目录新建一个叫extdisk,命令是：mkdir /extdisk，然后用Mount /dev/xvdc /extdisk把外挂硬盘挂入操作系统。命令正常执行后，我们ls /extdisk，发现正常访问，这就表示我们的外挂硬盘正常工作了。我们可以把我们需要备份的文件都拷进来。
4，备份完毕后，关闭操作系统，开始重装。先删除debian的硬盘镜像（Debian Disk Image），然后删除操作系统的配置文件（My Debian Profile），之后在重建一个Linux版本（Deploy a Linux Distribution）就可以了，重建的时候，他会自动把你刚刚删除的硬盘镜像的空间用上，很方便。这次的Linux版本可要选对了，我选择的是Centos 5.5
5，启动centos，在把步骤3中的操作重做一遍，把刚刚的备份硬盘镜像重新挂进来，我们的重装就完成了。
重装系统风险很大，请大家务必慎重哈
]]></description>
			<content:encoded><![CDATA[<p>大家都说linode好用，还真的好用，这么一转眼就用了一年半了。最近刚刚重装了自己在LINODE的服务器。在此之前，我用的是debian，后来发现centos用起来太方便了。于是就琢磨着把系统换一下。在网上，查了好久的资料没有一个相对完整的解决方案。于是，我只好临时买了一个新的linode节点，做测试。下面就把大致的过程写出来。<br />
其实，Linode的系统重装很快很方便。主要就是之前你的数据怎么整理，备份再在重装后恢复回来。<br />
我的解决办法分两步：<br />
1，首先先把现有的linode节点重新划分，把现有的一个镜像盘分为两个，举例来说，我现在的linode系统分为两个硬盘镜像(disk image):512MB Swap Image和Debian Disk Image，其中Debian Disk Image有16G，所有的东西都在这里。我用linode的resize工具现将16G中没有用到的10G划分出来。然后再新建一个硬盘镜像（Create a new Disk Image），把这10G作为一个外挂硬盘来用，命名为：extdisk。（注意:以上操作要先关闭系统）<br />
2，在Lionde的系统配置部分（Configuration Profiles）找到自己的debian配置，点击编辑(edit)，找到外挂硬盘（Block Device Assignment）部分，在/dev/xvdc这里下拉找到新建的外挂硬盘extdisk，保存设置。然后启动操作系统。<br />
3，正常登录操作系统，首先查看外挂硬盘是否正常，打入fdisk -l 发现列表中已经有/dev/xvdc，接下来，我们就要想办法把外挂硬盘挂入操作系统了。现在你想挂入的地方新建一个目录，比如我选在根目录新建一个叫extdisk,命令是：mkdir /extdisk，然后用Mount /dev/xvdc /extdisk把外挂硬盘挂入操作系统。命令正常执行后，我们ls /extdisk，发现正常访问，这就表示我们的外挂硬盘正常工作了。我们可以把我们需要备份的文件都拷进来。<br />
4，备份完毕后，关闭操作系统，开始重装。先删除debian的硬盘镜像（Debian Disk Image），然后删除操作系统的配置文件（My Debian Profile），之后在重建一个Linux版本（Deploy a Linux Distribution）就可以了，重建的时候，他会自动把你刚刚删除的硬盘镜像的空间用上，很方便。这次的Linux版本可要选对了，我选择的是Centos 5.5<br />
5，启动centos，在把步骤3中的操作重做一遍，把刚刚的备份硬盘镜像重新挂进来，我们的重装就完成了。</p>
<p>重装系统风险很大，请大家务必慎重哈</p>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2011/03/linode-server-rebuild-install/feed/</wfw:commentRss>
		</item>
		<item>
		<title>linux centos 5 lamp(apache mysql php) yum自动安装shell脚本</title>
		<link>http://murray.cn/index.php/2011/03/linux-centos-5-lamp-apache-mysql-install-yum-shell/</link>
		<comments>http://murray.cn/index.php/2011/03/linux-centos-5-lamp-apache-mysql-install-yum-shell/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 08:40:55 +0000</pubDate>
		<dc:creator>murray</dc:creator>
		
		<category><![CDATA[技术研究]]></category>

		<category><![CDATA[Apache]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[install]]></category>

		<category><![CDATA[LAMP]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[shell]]></category>

		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.murray.cn/?p=1202</guid>
		<description><![CDATA[手头有N台linux centos 5的服务器，每次配置都要打很多命令，不想这么烦下去了。
自己写了一个自动安装脚本，包括了apache mysql php的自动Yum安装。最后还设置了防火墙。
记录一下，想要源文件的可以跟我要。
别忘了，给这个文件这是一个执行权限，简单的来就是chmod 7777
#! /bin/bash
yum -y install httpd php mysql mysql-server php-mysql
echo &#8216;install httpd,php,mysql,php success&#8217;
# define auto run
/sbin/chkconfig httpd on
/sbin/chkconfig &#8211;add mysqld
/sbin/chkconfig mysqld on
echo &#8216;define httpd mysqld autorun success&#8217;
# start service
/sbin/service httpd restart
/sbin/service mysqld restart
echo &#8217;start httpd mysqld success&#8217;
#define mysql password
mysqladmin -u root password &#8216;ismurray&#8217;
echo &#8216;define mysql password success&#8217;
# install apache ext
yum -y [...]]]></description>
			<content:encoded><![CDATA[<p>手头有N台linux centos 5的服务器，每次配置都要打很多命令，不想这么烦下去了。<br />
自己写了一个自动安装脚本，包括了apache mysql php的自动Yum安装。最后还设置了防火墙。<br />
记录一下，想要源文件的可以跟我要。</p>
<p>别忘了，给这个文件这是一个执行权限，简单的来就是chmod 7777</p>
<p>#! /bin/bash<br />
yum -y install httpd php mysql mysql-server php-mysql<br />
echo &#8216;install httpd,php,mysql,php success&#8217;<br />
# define auto run<br />
/sbin/chkconfig httpd on<br />
/sbin/chkconfig &#8211;add mysqld<br />
/sbin/chkconfig mysqld on<br />
echo &#8216;define httpd mysqld autorun success&#8217;<br />
# start service<br />
/sbin/service httpd restart<br />
/sbin/service mysqld restart<br />
echo &#8217;start httpd mysqld success&#8217;<br />
#define mysql password<br />
mysqladmin -u root password &#8216;ismurray&#8217;<br />
echo &#8216;define mysql password success&#8217;<br />
# install apache ext<br />
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql<br />
echo &#8216;install apache ext success&#8217;<br />
# install php ext<br />
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc<br />
echo &#8216;install php ext success&#8217;<br />
# install mysql ext<br />
yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql<br />
echo &#8216;install mysql ext success&#8217;<br />
# define iptables 80 22 3306<br />
/sbin/iptables -I INPUT -p tcp &#8211;dport 80 -j ACCEPT<br />
/sbin/iptables -I INPUT -p tcp &#8211;dport 22 -j ACCEPT<br />
/sbin/iptables -I INPUT -p tcp &#8211;dport 3306 -j ACCEPT<br />
/etc/rc.d/init.d/iptables save<br />
echo &#8216;define iptables success&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://murray.cn/index.php/2011/03/linux-centos-5-lamp-apache-mysql-install-yum-shell/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

