﻿<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>FreeMAGi &#187; DreamHost</title>
	<atom:link href="http://www.freemagi.com/tag/dreamhost/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.freemagi.com</link>
	<description>time waits for no one.</description>
	<lastBuildDate>Sat, 12 Dec 2009 08:11:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>合租用户召集，旧数据已经清理完毕，后台重新开放，这里是注意事项</title>
		<link>http://www.freemagi.com/2008/12/21/dhp_reload/</link>
		<comments>http://www.freemagi.com/2008/12/21/dhp_reload/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 20:09:03 +0000</pubDate>
		<dc:creator>Evan</dc:creator>
				<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[snapshot data]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[web security]]></category>
		<guid isPermaLink="false">http://www.freemagi.com/?p=58</guid>
		<description><![CDATA[花了九牛二虎之力终于搞定了所有旧数据，在这里现说一声抱歉，大家等到今天太不容易了。因为最近加班太多，我这两周基本上都在凌晨过后才能下班回家，而且旧数据太多太乱，要整理好真的好麻烦。。。单单删除数据都花了好几个小时= =&#124;&#124;&#124; （请小狼童鞋注意了。。。你的数据整理花了最长时间的 = = 快给我把数据库都按格式改好名） 在删除数据的过程中可能会出现错删的现象，如果发现出现相关问题请马上与我联系，我会尽可能给与恢复，而被删除的用户文件夹里的数据可能会永久丢失，数据库的话会在5日内被系统自动清除，所以遇到问题请尽快。 而自己的过往数据可以用ssh或者ftp在 ~/.snapshot 里找到备份，文件备份是最多保存30天的。 为了管理方便，请大家不要乱建用户，如果有必要新建用户的话（包括MySQL用户和Shell / FTP用户），请事先跟我申请，不然我会在不定期检查帐户时删除非法帐户（小狼和小博童鞋，请再注意了 = =）。 只因要对MySQL用户改名是不可能的事情，所以请大家珍惜拥有的ID。 以下是一些常用的链接： Wiki：http://wiki.dreamhost.com/ 管理域名：https://panel.dreamhost.com/index.cgi?tree=domain.manage 管理数据库：https://panel.dreamhost.com/index.cgi?tree=goodies.mysql 一键安装：https://panel.dreamhost.com/index.cgi?tree=goodies.installer 数据恢复方法：http://wiki.dreamhost.com/Snapshot_data_restoration 设置防盗链：https://panel.dreamhost.com/index.cgi?tree=goodies.webdav 在新建数据库时请先选择自己要绑定域名的数据库，数据库用户名请务必使用原有的而不是新建的 一般新建域名并且绑定数据库会需要以下过程： 先进入 Domains>Manage Domains 点击 Add New Domain / Sub-Domain 在 Domain to host 写好要绑定的域名 确认 Extra Web Security? 已经被选中，确认 FTP user / CGI-runs-as user 为已存在用户 把所需要的服务给选/填好 点击 Fully host this [...]]]></description>
			<content:encoded><![CDATA[<p>花了九牛二虎之力终于搞定了所有旧数据，在这里现说一声抱歉，大家等到今天太不容易了。因为最近加班太多，我这两周基本上都在凌晨过后才能下班回家，而且旧数据太多太乱，要整理好真的好麻烦。。。单单删除数据都花了好几个小时= =||| （请小狼童鞋注意了。。。你的数据整理花了最长时间的 = = 快给我把数据库都按格式改好名）</p>
<p>在删除数据的过程中可能会出现错删的现象，如果发现出现相关问题请马上与我联系，我会尽可能给与恢复，而被删除的用户文件夹里的数据可能会永久丢失，数据库的话会在5日内被系统自动清除，所以遇到问题请尽快。<br />
而自己的过往数据可以用ssh或者ftp在 ~/.snapshot 里找到备份，文件备份是最多保存30天的。</p>
<p>为了管理方便，请大家不要乱建用户，如果有必要新建用户的话（包括MySQL用户和Shell / FTP用户），请事先跟我申请，不然我会在不定期检查帐户时删除非法帐户（小狼和小博童鞋，请再注意了 = =）。</p>
<p>只因要对MySQL用户改名是不可能的事情，所以请大家珍惜拥有的ID。</p>
<p>以下是一些常用的链接：<br />
Wiki：http://wiki.dreamhost.com/<br />
管理域名：https://panel.dreamhost.com/index.cgi?tree=domain.manage<br />
管理数据库：https://panel.dreamhost.com/index.cgi?tree=goodies.mysql<br />
一键安装：https://panel.dreamhost.com/index.cgi?tree=goodies.installer<br />
数据恢复方法：http://wiki.dreamhost.com/Snapshot_data_restoration<br />
设置防盗链：https://panel.dreamhost.com/index.cgi?tree=goodies.webdav</p>
<p>在新建数据库时请先选择自己要绑定域名的数据库，数据库用户名请务必使用原有的而不是新建的<br />
一般新建域名并且绑定数据库会需要以下过程：<br />
先进入 Domains>Manage Domains<br />
点击  Add New Domain / Sub-Domain<br />
在 Domain to host 写好要绑定的域名<br />
确认 Extra Web Security? 已经被选中，确认 FTP user / CGI-runs-as user 为已存在用户<br />
把所需要的服务给选/填好<br />
点击 Fully host this domain now! 完成绑定</p>
<p>再进入 Goodies>Manage MySQL<br />
找到 Create a new MySQL database 这个标题下的 Database Name<br />
这里请使用 USER_DBNAME 的格式新建数据库<br />
在 Use Hostname 选择 Create a new hostname now...<br />
在 New Hostname 把 mysql 绑定到刚才新建的域名上<br />
在 First User 选择已存在的用户<br />
在 Database Comment 里写上数据库的基本摘要，以便管理<br />
最后点击 Add new database now! 完成新建数据库操作</p>
<p>再次进入 Domains>Manage Domains<br />
找到刚才绑定的域名，点开 DNS 的链接，这里就是你需要绑定的内容了<br />
若是已经在你本人的域名控制面板里绑定了 Dreamhost 的 NS 记录的话就基本可以不需要管这些了<br />
Dreamhost 的 NS 记录如下：<br />
ns1.dreamhost.com.<br />
ns2.dreamhost.com.<br />
ns3.dreamhost.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freemagi.com/2008/12/21/dhp_reload/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reborn: killall php.cgi</title>
		<link>http://www.freemagi.com/2007/04/01/reborn-killall-phpcgi/</link>
		<comments>http://www.freemagi.com/2007/04/01/reborn-killall-phpcgi/#comments</comments>
		<pubDate>Sun, 01 Apr 2007 09:40:57 +0000</pubDate>
		<dc:creator>Evan</dc:creator>
				<category><![CDATA[DreamHost]]></category>
		<guid isPermaLink="false">http://www.freemagi.com/2007/04/01/reborn-killall-phpcgi/</guid>
		<description><![CDATA[[photopress:070331_downtime.jpg,full,pp_image] 昨天晚上回家例行查了一下邮件，例行查一下邮件，发现某咖啡在gtalk上留言说我的小站down了，显示error 500，吃完晚餐后7x24给我发来了邮件，也是说我的站down了。于是小弟就上线找客服，在DreamHost的wiki上找了半天都没找到原因。到了今天中午起床，收到客服的邮件，说我的程序内存超出了指定限制。我马上把DreamHost默认的php.ini和我定制的php.ini都下下来，怎么查也查不出问题来。我只好继续搜索，在DreamHost的论坛上逛了半天，终于找到了原因，是因为php.cgi运行超时了，在ssh下运行了一下"killall php.cgi"，所有服务马上重新正常运行！呵呵！谢谢某咖啡！ PS：额外附送一个小弟在做的theme截图 [photopress:wp_theme_ss_1.png,full,pp_image]]]></description>
			<content:encoded><![CDATA[<p>[photopress:070331_downtime.jpg,full,pp_image]</p>
<p>昨天晚上回家例行查了一下邮件，例行查一下邮件，发现<a TITLE="临府咖啡" HREF="http://www.heyamigo.cn/">某咖啡</a>在gtalk上留言说我的小站down了，显示error 500，吃完晚餐后7x24给我发来了邮件，也是说我的站down了。于是小弟就上线找客服，在<a TITLE="DreamHost" HREF="http://www.dreamhost.com/r.cgi?251337">DreamHost</a>的wiki上找了半天都没找到原因。到了今天中午起床，收到客服的邮件，说我的程序内存超出了指定限制。我马上把<a TITLE="DreamHost" HREF="http://www.dreamhost.com/r.cgi?251337">DreamHost</a>默认的php.ini和我定制的php.ini都下下来，怎么查也查不出问题来。我只好继续搜索，在DreamHost的论坛上逛了半天，终于找到了原因，是因为php.cgi运行超时了，在ssh下运行了一下"killall php.cgi"，所有服务马上重新正常运行！呵呵！谢谢<a TITLE="临府咖啡" HREF="http://www.heyamigo.cn/">某咖啡</a>！</p>
<p>PS：额外附送一个小弟在做的theme截图<br />
[photopress:wp_theme_ss_1.png,full,pp_image]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freemagi.com/2007/04/01/reborn-killall-phpcgi/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>万恶的DreamHost，万恶的bad_httpd_conf</title>
		<link>http://www.freemagi.com/2007/03/03/dreamhost-the-monster/</link>
		<comments>http://www.freemagi.com/2007/03/03/dreamhost-the-monster/#comments</comments>
		<pubDate>Sat, 03 Mar 2007 08:35:36 +0000</pubDate>
		<dc:creator>Evan</dc:creator>
				<category><![CDATA[DreamHost]]></category>
		<guid isPermaLink="false">http://www.freemagi.com/2007/03/03/dreamhost-the-monster/</guid>
		<description><![CDATA[经过2月26日的断电劫难后，我们的数据被移到welchs上，可怜的welchs，经常重启，而且cpu占有相当高，还导致我们有多个域名down掉，呈bad_httpd_conf状，一天后竟然连ping都ping不通。尝试n多种修复方法后还是不行，最后没办法了，只好联系客服要求更换服务器，全文如下： Message from you (Mar 2nd, 2007 - 01:27:05 / #1755252) Subject: SAVE US! People are DYING! Downed sites: gailou.com heyamigo.cn lovebaby.biz wikiwind.net Downed users: our420/suwarm/gailou Panding WebID: our420 uptime: 00:18:34 up 20:34, 5 users, load average: 49.29, 57.98, 52.72 (VERY LOW UPTIME!) Our old server "coffee" is more steady than our current server "welchs". [...]]]></description>
			<content:encoded><![CDATA[<p>经过2月26日的<a HREF="http://yskin.net/2007/02/dreamhost-down.html">断电劫难</a>后，我们的数据被移到welchs上，可怜的welchs，经常重启，而且cpu占有相当高，还导致我们有多个域名down掉，呈bad_httpd_conf状，一天后竟然连ping都ping不通。尝试n多种修复方法后还是不行，最后没办法了，只好联系客服要求更换服务器，全文如下：</p>
<blockquote><p>Message from you (Mar 2nd, 2007 - 01:27:05 / #1755252)<br />
<strong>Subject: SAVE US! People are DYING! Downed sites:</strong><br />
gailou.com<br />
heyamigo.cn<br />
lovebaby.biz<br />
wikiwind.net</p>
<p>Downed users: our420/suwarm/gailou<br />
Panding WebID: our420</p>
<p>uptime: 00:18:34 up 20:34,  5 users,  load average:<br />
49.29, 57.98, 52.72 (VERY LOW UPTIME!)</p>
<p>Our old server "coffee" is more steady than our<br />
current server "welchs". The current server is very<br />
UNSTEADY!,it often restarts,please move our data to<br />
another server.</p></blockquote>
<p>幸运的是DreamHost的客服反应够快，很快就给了我答复，说是答应我的要求，把我们搬到名叫“monster”的新服务器上，他的介绍说是“This<br />
is a newer server with very good stability and very low load.”果然这台服务器性能相当不赖。附全文：</p>
<blockquote><p>Reply from DreamHost (Mar 2nd, 2007 - 04:31:47 / #10533451)<br />
<strong dragover="true">Subject: Re: SAVE US! People are DYING!</strong> Hello Wang,</p>
<p dragover="true">So sorry for the downtime!  I've moved you from welchs to monster.   This<br />
is a newer server with very good stability and very low load.  Keep in<br />
mind, this move may take from 24-48 hours to take effect.  Please let me<br />
know if you have any other questions!</p>
<p>Thanks!<br />
Jeffrey</p></blockquote>
<p>今天搬过来以后，发现所有域名都可以连得上了，而且速度还不错，但bad_httpd_conf的情况还是没有改善，于是在写这篇blog的前再给客服发了封mail，希望到了明天大家的网站都可以正常访问啦！</p>
<p>PS：新的服务器的名字真的很geek哦～！<br />
叫怪物哦～这难道是DreamHost的自嘲？呵呵！<br />
附个monster的uptime：<br />
00:32:48 up 4 days,  5:57,  4 users,  load average: 0.09, 0.18, 0.20<br />
Update：前天给客服再发了个Mail，昨天他给我了个答复，看来原来绑定A记录的都换成新的A记录或者绑定他们的NS记录。</p>
<blockquote><p>Ah, since you're not using our nameservers you'll need to manually update<br />
where your custom nameservers are pointing to.  After the moves, your<br />
sites are at different IP addresses, but the nameservers are still<br />
pointing at the old machines.  <img src='http://www.freemagi.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   Basically it'll be way easier if you<br />
switch over to our nameservers for your domains.  That way if there's<br />
ever an IP address change in the future we'll take care of it<br />
automatically.  Otherwise you'll need to go to the Domains &gt; Manage<br />
Domains section of your panel at<br />
https://panel.dreamhost.com/index.cgi?tree=domain.manage&amp; and then click<br />
the "DNS" link for the domain.  Then just make sure that the A records<br />
match up between that page and what you've got setup at your nameservers.<br />
You'll need to contact your registrar or DNS service to take care of<br />
that end of things.<br />
If there's anything else I can help you with, just let me know!</p>
<p>Thanks!<br />
Craig</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.freemagi.com/2007/03/03/dreamhost-the-monster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update, PHP-4.4.4! Update, eAccelerator! Update, WordPress 2.0.6!</title>
		<link>http://www.freemagi.com/2007/01/07/update-update-update/</link>
		<comments>http://www.freemagi.com/2007/01/07/update-update-update/#comments</comments>
		<pubDate>Sun, 07 Jan 2007 14:30:00 +0000</pubDate>
		<dc:creator>Evan</dc:creator>
				<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Compile]]></category>
		<category><![CDATA[eAccelerator]]></category>
		<category><![CDATA[Script]]></category>
		<guid isPermaLink="false">http://www.freemagi.com/2007/01/07/update-update-update/</guid>
		<description><![CDATA[[photopress:Night_of_Miracles_by_Licheus.jpg,full,pp_image] 前几天在robinz那看到了在Dreamhost上安装eAccelerator的教程，听说eAccelerator要比zend快多了，手就有点痒，这几天都在尝试编译安装PHP-4.4.4，但已经出错了三次，大都是因为脚本的问题，准备第四次的时候竟然一不小心rm -rf php *差点把所有东西都删了，幸好还有较早前的备份才恢复过来，今天就把Wordpress升到2.0.6，趁还有时间顺便也把页面的css调整了一下，加了两张背景。 实际动手才发觉跟想象的也差太远了，安装PHP4就是因为参数和网数的问题令成功几率大大降低，而且在网上的那些脚本多数都不太完全对的，需要改动的地方也不少。就PHP4的编译小弟也积累了些经验， 刚开始我只按照robinz的方法装的，但是因为php4已经出到4.4.4了，而iMap也升级到2006了，2004g的下载地址也已经失效了，还有一好几个文件镜像都失效，后来只好参照Dreamhost官方提供的脚本重新编译，而又因为Dreamhost的脚本写的比较优美，所以我最后还是以它为基础按照robinz的参数重新安装。在这里有几点要注意的，Dreamhost提供的脚本是默认没有打开FastCGI参数的，而robinz上面又有几个变量稍微不同，还有编译的时候最好把脚本放到$HOME目录执行，这样才不会产生多余的php链接。 下面是我修改过的脚本 #!/bin/bash # Abort on any errors set -e # The domain in which to install the PHP CGI script. export DOMAIN="freemagi.com" # Update version information here. PHP="php-4.4.4" LIBICONV="libiconv-1.10" LIBMCRYPT="libmcrypt-2.5.7" LIBXML2="libxml2-2.6.23" LIBXSLT="libxslt-1.1.15" MHASH="mhash-0.9.4"; MHASH_TAR="${MHASH}a" # Pests! ZLIB="zlib-1.2.3" CURL="curl-7.15.2" LIBIDN="libidn-0.6.2" FREETYPE="freetype-2.1.10" IMAP="imap-2004g" # Set DISTDIR to somewhere persistent if [...]]]></description>
			<content:encoded><![CDATA[<p>[photopress:Night_of_Miracles_by_Licheus.jpg,full,pp_image]</p>
<p>前几天在<a href="http://blog.robinz.info/archives/2006/02/15/how-to-install-eacceleartor-on-dreamhosts-host/" target="_blank" title="How to Install eAcceleartor on Dreamhost’s HOST!">robinz</a>那看到了在<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>上安装eAccelerator的教程，听说<a href="http://www.chedong.com/blog/archives/001154.html" target="_blank" title="eAccelerator的安装和性能比较">eAccelerator要比zend快</a>多了，手就有点痒，这几天都在尝试编译安装PHP-4.4.4，但已经出错了三次，大都是因为脚本的问题，准备第四次的时候竟然一不小心rm -rf php *差点把所有东西都删了，幸好还有较早前的备份才恢复过来，今天就把Wordpress升到2.0.6，趁还有时间顺便也把页面的css调整了一下，加了两张背景。</p>
<p>实际动手才发觉跟想象的也差太远了，安装PHP4就是因为参数和网数的问题令成功几率大大降低，而且在网上的那些脚本多数都不太完全对的，需要改动的地方也不少。就PHP4的编译小弟也积累了些经验， 刚开始我只按照<a href="http://blog.robinz.info/archives/2006/02/13/how-to-compile-php-442-on-dreamhosts-web-hosts/" target="_blank" title="How to compile PHP 4.4.2 on Dreamhost’s web hosts.">robinz</a>的方法装的，但是因为php4已经出到4.4.4了，而iMap也升级到2006了，2004g的下载地址也已经失效了，还有一好几个文件镜像都失效，后来只好参照<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>官方提供的<a href="http://wiki.dreamhost.com/index.php/Custom_compile_PHP_4" title="Installing PHP4">脚本</a>重新编译，而又因为<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>的脚本写的比较优美，所以我最后还是以它为基础按照<a href="http://blog.robinz.info/archives/2006/02/13/how-to-compile-php-442-on-dreamhosts-web-hosts/" target="_blank" title="How to compile PHP 4.4.2 on Dreamhost’s web hosts.">robinz</a>的参数重新安装。在这里有几点要注意的，<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>提供的脚本是默认没有打开FastCGI参数的，而<a href="http://blog.robinz.info/archives/2006/02/13/how-to-compile-php-442-on-dreamhosts-web-hosts/" target="_blank" title="How to compile PHP 4.4.2 on Dreamhost’s web hosts.">robinz</a>上面又有几个变量稍微不同，还有编译的时候最好把脚本放到$HOME目录执行，这样才不会产生多余的php链接。</p>
<p><span style="color: #8080c0">下面是我修改过的脚本</span></p>
<p><span id="more-15"></span></p>
<blockquote><p>#!/bin/bash</p>
<p># Abort on any errors<br />
set -e</p>
<p># The domain in which to install the PHP CGI script.<br />
export DOMAIN="freemagi.com"</p>
<p># Update version information here.<br />
PHP="php-4.4.4"<br />
LIBICONV="libiconv-1.10"<br />
LIBMCRYPT="libmcrypt-2.5.7"<br />
LIBXML2="libxml2-2.6.23"<br />
LIBXSLT="libxslt-1.1.15"<br />
MHASH="mhash-0.9.4"; MHASH_TAR="${MHASH}a" # Pests!<br />
ZLIB="zlib-1.2.3"<br />
CURL="curl-7.15.2"<br />
LIBIDN="libidn-0.6.2"<br />
FREETYPE="freetype-2.1.10"<br />
IMAP="imap-2004g"<br />
# Set DISTDIR to somewhere persistent if you plan to muck around with this<br />
# script and run it several times! It is where distributions are downloaded.<br />
DISTDIR=${HOME}/dist</p>
<p># Where do you want all this stuff built? Using a local filesystem is best.<br />
# ***Don't pick a directory that already exists!*** We clean up after<br />
# ourselves at the end!<br />
SRCDIR=${HOME}/source</p>
<p># And where should it be installed? A versioned directory eases upgrades!<br />
INSTALLDIR=${HOME}/${PHP}</p>
<p># A simple name link eases use<br />
ln -s ${INSTALLDIR} php<br />
# What PHP features do you want enabled?<br />
PHPFEATURES="--prefix=${INSTALLDIR} \<br />
--enable-force-cgi-redirect \<br />
--enable-gd-native-ttf \<br />
--enable-ftp \<br />
--enable-sockets \<br />
--enable-wddx \<br />
--enable-sqlite-utf8 \<br />
--enable-calendar \<br />
--enable-mbstring \<br />
--enable-mbregex \<br />
--enable-soap \<br />
--enable-fastcgi \<br />
--enable-exif \<br />
--with-config-file-path=${INSTALLDIR}/etc/php4 \<br />
--with-xml \<br />
--with-libxml-dir=${INSTALLDIR} \<br />
--with-freetype-dir=${INSTALLDIR} \<br />
--with-xsl=${INSTALLDIR} \<br />
--with-openssl=/usr \<br />
--with-mhash=${INSTALLDIR} \<br />
--with-mcrypt=${INSTALLDIR} \<br />
--with-zlib-dir=${INSTALLDIR} \<br />
--with-jpeg-dir=/usr \<br />
--with-png-dir=/usr \<br />
--with-gd \<br />
--with-mysql=/usr --with-mysqli \<br />
--with-curl=${INSTALLDIR} \<br />
--with-iconv=${INSTALLDIR} \<br />
--with-imap=${INSTALLDIR}<br />
--with-imap-ssl=/usr \<br />
--with-gettext \<br />
--without-pear"</p>
<p># ---- end of user-editable bits. Hopefully! ----</p>
<p># Push the install dir's bin directory into the path<br />
export PATH=${INSTALLDIR}/bin:$PATH</p>
<p>#setup directories<br />
mkdir -p ${SRCDIR}<br />
mkdir -p ${INSTALLDIR}<br />
mkdir -p ${DISTDIR}<br />
cd ${DISTDIR}</p>
<p># Get all the required packages<br />
wget -c <a href="http://us3.php.net/distributions/$%7BPHP%7D.tar.gz">http://us3.php.net/distributions/${PHP}.tar.gz</a><br />
wget -c <a href="http://ftp.gnu.org/pub/gnu/libiconv/$%7BLIBICONV%7D.tar.gz">http://ftp.gnu.org/pub/gnu/libiconv/${LIBICONV}.tar.gz</a><br />
wget -c <a href="http://easynews.dl.sourceforge.net/sourceforge/mcrypt/$%7BLIBMCRYPT%7D.tar.gz">http://easynews.dl.sourceforge.net/sourceforge/mcrypt/${LIBMCRYPT}.tar.gz</a><br />
wget -c <a href="http://xmlsoft.org/sources/xml/$%7BLIBXML2%7D.tar.gz">http://xmlsoft.org/sources/xml/${LIBXML2}.tar.gz</a><br />
wget -c <a href="http://xmlsoft.org/sources/xml/$%7BLIBXSLT%7D.tar.gz">http://xmlsoft.org/sources/xml/${LIBXSLT}.tar.gz</a><br />
wget -c <a href="http://easynews.dl.sourceforge.net/sourceforge/mhash/$%7BMHASH_TAR%7D.tar.gz">http://easynews.dl.sourceforge.net/sourceforge/mhash/${MHASH_TAR}.tar.gz</a><br />
wget -c <a href="http://www.zlib.net/$%7BZLIB%7D.tar.gz">http://www.zlib.net/${ZLIB}.tar.gz</a><br />
wget -c <a href="http://curl.haxx.se/download/$%7BCURL%7D.tar.gz">http://curl.haxx.se/download/${CURL}.tar.gz</a><br />
wget -c <a href="ftp://alpha.gnu.org/pub/gnu/libidn/$%7BLIBIDN%7D.tar.gz">ftp://alpha.gnu.org/pub/gnu/libidn/${LIBIDN}.tar.gz</a><br />
wget -c <a href="http://easynews.dl.sourceforge.net/sourceforge/freetype/$%7BFREETYPE%7D.tar.gz">http://easynews.dl.sourceforge.net/sourceforge/freetype/${FREETYPE}.tar.gz</a><br />
wget -c <a href="ftp://ftp.cac.washington.edu/imap/old/$%7BIMAP%7D.tar.Z">ftp://ftp.cac.washington.edu/imap/old/${IMAP}.tar.Z</a></p>
<p>cd ${SRCDIR}<br />
# Unpack them all<br />
tar xzf ${DISTDIR}/${PHP}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBICONV}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBMCRYPT}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBXML2}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBXSLT}.tar.gz<br />
tar xzf ${DISTDIR}/${MHASH_TAR}.tar.gz<br />
tar xzf ${DISTDIR}/${ZLIB}.tar.gz<br />
tar xzf ${DISTDIR}/${CURL}.tar.gz<br />
tar xzf ${DISTDIR}/${LIBIDN}.tar.gz<br />
tar xzf ${DISTDIR}/${FREETYPE}.tar.gz<br />
uncompress -cd ${DISTDIR}/${IMAP}.tar.Z |tar x</p>
<p># Build them in the required order to satisfy dependencies.</p>
<p>#libiconv<br />
cd ${SRCDIR}/${LIBICONV}<br />
./configure --enable-extra-encodings --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#libxml2<br />
cd ${SRCDIR}/${LIBXML2}<br />
./configure --with-iconv=${INSTALLDIR} --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#libxslt<br />
cd ${SRCDIR}/${LIBXSLT}<br />
./configure --with-libxml-prefix=${INSTALLDIR} --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#zlib<br />
cd ${SRCDIR}/${ZLIB}<br />
./configure --shared --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#libmcrypt<br />
cd ${SRCDIR}/${LIBMCRYPT}<br />
./configure --disable-posix-threads --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#mhash<br />
cd ${SRCDIR}/${MHASH}<br />
./configure --prefix=${INSTALLDIR}<br />
make<br />
make install<br />
# FIXME: For some reason, mincludes.h isn't copied across<br />
cp ${SRCDIR}/${MHASH}/include/mutils/mincludes.h ${INSTALLDIR}/include/mutils</p>
<p>#libidn<br />
cd ${SRCDIR}/${LIBIDN}<br />
./configure --with-iconv-prefix=${INSTALLDIR} --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#cURL<br />
cd ${SRCDIR}/${CURL}<br />
./configure --with-ssl=${INSTALLDIR} --with-zlib=${INSTALLDIR} \<br />
--with-libidn=${INSTALLDIR} --enable-ipv6 --enable-cookies \<br />
--enable-crypto-auth --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p>#freetype<br />
cd ${SRCDIR}/${FREETYPE}<br />
./configure --prefix=${INSTALLDIR}<br />
make<br />
make install</p>
<p># imap<br />
cd ${SRCDIR}/${IMAP}<br />
make ldb<br />
# Install targets are for wusses!<br />
cp c-client/c-client.a ${INSTALLDIR}/lib/libc-client.a<br />
cp c-client/*.h ${INSTALLDIR}/include</p>
<p>#PHP 4<br />
cd ${SRCDIR}/${PHP}<br />
./configure ${PHPFEATURES}<br />
make<br />
make install</p>
<p>#copy config file<br />
mkdir -p ${INSTALLDIR}/etc/php4<br />
cp ${SRCDIR}/${PHP}/php.ini-dist ${INSTALLDIR}/etc/php4/php.ini</p>
<p>#copy PHP CGI<br />
mkdir -p ${HOME}/${DOMAIN}/cgi-bin<br />
chmod 0755 ${HOME}/${DOMAIN}/cgi-bin<br />
cp ${INSTALLDIR}/bin/php ${HOME}/${DOMAIN}/cgi-bin/php.cgi<br />
echo ---------- INSTALL COMPLETE! ----------</p></blockquote>
<p><strong>Download:</strong> <a href="http://freemagi.com/wp-content/uploads/instphp4.sh">instphp4.sh</a></p>
<p>运行</p>
<blockquote><p><code>chmod +x instphp4.sh<br />
./instphp4.sh</code></p></blockquote>
<hr />然后就到安装我们这次的主角eAcceleartor，开始安装前还要几步准备工作，先把autoconf和automake装上，可以参考<a href="http://blog.robinz.info/archives/2006/02/15/how-to-install-eacceleartor-on-dreamhosts-host/" target="_blank" title="How to Install eAcceleartor on Dreamhost’s HOST!">robinz</a>的做法，而我是选择安装在~/local，因个人情况不同。安装autoconf</p>
<blockquote><p><code>wget <a href="http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.bz2">http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.bz2</a><br />
tar -xjf autoconf-2.59.tar.bz2<br />
cd autoconf-2.59<br />
./configure -prefix=YOUR PATH<br />
make<br />
make install</code></p></blockquote>
<p>安装automake</p>
<blockquote><p><code>wget <a href="http://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2">http://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2</a><br />
tar -xjf automake-1.9.6.tar.bz2<br />
cd automake-1.9.6<br />
./configure -prefix=YOUR PATH<br />
make<br />
make install</code></p></blockquote>
<p>然后我们来看看eAccelerator的软件环境需求：<br />
apache 1.3, apache 2.0 (prefork), mod_php4/5<br />
我们的<a href="http://www.dreamhost.com/r.cgi?251337" title="Dreamhost">Dreamhost</a>都能够支持，好了，下面到请主角出场：</p>
<p>安装eAccelerator（下面的地址如果不通的话最好自己到eAccelerator的<a href="http://sourceforge.net/projects/eaccelerator/" target="_blank" title="PojectPage">PojectPage</a>找合适的镜像）</p>
<blockquote><p>wget <a href="http://voxel.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5.tar.bz2">http://voxel.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5.tar.bz2</a><br />
tar -xjf eaccelerator-0.9.5.tar.bz2<br />
cd eaccelerator-0.9.5<br />
export PATH=$PATH:YOUR PATH/bin #这里的是指你安装autoconf的目录，譬如我的是$HOME/local/bin<br />
export PHP_PREFIX=YOUR PHP PATH #这里是你的安装php的位置，就是$HOME/php，但有一个小细节要注意的，在<a href="http://blog.robinz.info/archives/2006/02/15/how-to-install-eacceleartor-on-dreamhosts-host/" target="_blank" title="How to Install eAcceleartor on Dreamhost’s HOST!">robinz</a>的文里是写export PHP_PREFIX= YOUR PHP PATH/bin的，其实如果这样写的话，configure是不会成功的<br />
$PHP_PREFIX/bin/phpize<br />
./configure -prefix=YOUR PATH --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config<br />
make<br />
make install #最好还是make install一下，不make install会有la文件<br />
mv YOUR PHP PATH/lib/php/extensions/no-debug-non-zts-<span style="color: #800080">一行数字</span>/eaccelerator.so YOUR PHP PATH/lib/php/extensions/<br />
rm -r YOUR PHP PATH/lib/php/extensions/no-debug-non-zts-<span style="color: #800080">一行数字</span>/</p></blockquote>
<hr />上面结束以后还不用急，还要设置一下php.ini<br />
cp /etc/php/cgi/php.ini "$HOME/[your website directory]/cgi-bin/"<br />
然后再改一下这个复制过来的文件把文件末的以zend开头的两行都删掉<br />
把下面的这些文字加到文件末尾</p>
<blockquote><p><code>[eAccelerator]<br />
zend_extension="/home/YOUR PHP PATH/lib/php/extensions/eaccelerator.so"<br />
eaccelerator.shm_size="16"<br />
eaccelerator.cache_dir="/home/YOUR HOME/tmp/eaccelerator"<br />
eaccelerator.enable="1"<br />
eaccelerator.optimizer="1"<br />
eaccelerator.check_mtime="1"<br />
eaccelerator.debug="0"<br />
eaccelerator.filter=""<br />
eaccelerator.shm_max="0"<br />
eaccelerator.shm_ttl="0"<br />
eaccelerator.shm_prune_period="0"<br />
eaccelerator.shm_only="0"<br />
eaccelerator.compress="1"<br />
eaccelerator.compress_level="9"</code></p>
<p>[Zend]<br />
zend_extension="/usr/local/dh/apache/template/phpext/ZendExtensionManager.so"<br />
zend_extension="/usr/local/dh/apache/template/phpext/zend_optimizer4/ZendOptimizer.so"<br />
zend_optimizer.optimization_level=1023</p></blockquote>
<p>然后再运行</p>
<blockquote><p>mkdir -p ~/tmp/eaccelerator<br />
chmod 777 ~/tmp/eaccelerator</p></blockquote>
<p>最后，别忘了在你的.htaccess文件里加上</p>
<blockquote><p><code>AddHandler phpFour .php<br />
Action phpFour /cgi-bin/php.cgi</code></p></blockquote>
<p>再下一个<a href="http://depoch.net/download.htm" title="iProber 探针">iProber 探针</a>，看看PHPINFO就可以看到</p>
<blockquote><p>This program makes use of the Zend Scripting Language Engine:<br />
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with eAccelerator v0.9.5, Copyright (c) 2004-2006 eAccelerator, by eAccelerator with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v2.6.2, Copyright (c) 1998-2006, by Zend Technologies</p></blockquote>
<hr /><span style="font-size: 150%"><br />
<span style="font-family: Verdana">ENJOY!<br />
</span></span><span style="font-family: Verdana"><span style="font-family: Verdana">最后再附送两个备份脚本，分别是备份MySQL和文件到别的ftp上的脚本，写得比较草，不要笑小弟[发现几个错误，请把原asc改成gpg]<span style="font-family: Verdana"><code><br />
</code></span></span></span></p>
<blockquote><p><span style="font-family: Verdana"><code><span style="font-size: 100%">先是数据库备份脚本<br />
<code><span style="font-size: 100%">#ftp Info<br />
host=HOST #ftp host<br />
UserName=USER #ftp user name<br />
Passwd=PASSWD #fto user password</span></code></span></code></span></p>
<p>#MySQL Info<br />
SQL_host=DB_HOST #MySQL host<br />
SQL_User=DB_USER #MySQL UserName<br />
SQL_Passwd=DB_PASSWD #User Password<br />
SQL_db=DB_NAME #database name</p>
<p>backup_path=/home/YOUR TMP PATH #set saved backup path<br />
file=$SQL_db-$(date +%Y%m%d).tar.gz<br />
MySQL_path=/usr/bin #set the mysql database bin path</p>
<p>cd $backup_path<br />
#export database<br />
$MySQL_path/mysqldump -h $SQL_host -u$SQL_User -p$SQL_Passwd --databases $SQL_db&gt;$SQL_db.dump</p>
<p>sleep 5s<br />
#file tar<br />
tar -czf $backup_path/$file $SQL_db.dump<br />
gpg -e -r GPGID $file #有关gpg加解密请<a href="http://www.google.com/search?hl=zh-CN&amp;lr=&amp;newwindow=1&amp;q=gpg%E4%BD%BF%E7%94%A8&amp;suggest=1&amp;sa=X&amp;oi=cjkrefinements_zh-CN_nav&amp;ct=result&amp;cd=2" target="_blank" title="GOOGLE">GOOGLE一下</a></p>
<p>cd $backup_path</p>
<p>#file ftp<br />
ftp -i -n &lt;&lt;!<br />
open $host<br />
user $UserName $Passwd<br />
cd /dbbak #请事先在你的备份用FTP上建立此目录<br />
put $file.gpg<br />
bye<br />
!</p>
<p>sleep 10s<br />
rm -rf $backup_path/$file<br />
rm -rf $backup_path/$SQL_db.dump<br />
rm -rf $backup_path/$file.gpg</p>
<hr /></blockquote>
<blockquote><p><code>然后是文件备份的<br />
WEBFILE=webdir-$(date +%Y%m%d).tar.gz<br />
cd $HOME</code></p>
<p>sleep 1s<br />
tar -czf $HOME/YOUR TMP PATH/webdir-$(date +%Y%m%d).tar.gz $HOME/YOUR PATH</p>
<p>sleep 10s<br />
cd $HOME/YOUR TMP PATH<br />
gpg -e -r YOUR GPG ID $WEBFILE</p>
<p>sleep 15s<br />
ftp -i -n &lt;&lt;!<br />
open YOUR FTP HOST<br />
user USERNAME PASSWD<br />
cd webbak #这个也是要事先建好<br />
put $WEBFILE.gpg<br />
bye<br />
!</p>
<p>sleep 5s<br />
rm -rf $HOME/YOUR TMP PATH/$WEBFILE.gpg<br />
rm -rf $HOME/YOUR TMP PATH/$WEBFILE</p></blockquote>
<blockquote><hr /><span style="font-size: 150%; font-family: Verdana">Enjoy!</span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.freemagi.com/2007/01/07/update-update-update/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>DreamHost搬迁成功</title>
		<link>http://www.freemagi.com/2006/12/03/move-to-dh/</link>
		<comments>http://www.freemagi.com/2006/12/03/move-to-dh/#comments</comments>
		<pubDate>Sun, 03 Dec 2006 09:19:24 +0000</pubDate>
		<dc:creator>Evan</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[DreamHost]]></category>
		<guid isPermaLink="false">http://www.freemagi.com/2006/12/03/move-to-dh/</guid>
		<description><![CDATA[小弟在搬到DreamHost前其实已经在很多不同的Free hosting isp中徘徊了很长一段时间了，但经历了无数搬迁，终于在n次被删、被block、数据库损坏、ISP被GFW后生存下来了，最后还是下定了决心在V2EX组织合租DreamHost，相信往后我会经常上来更新blog了！ 大家合租的同学玩得开心！大家合作愉快！]]></description>
			<content:encoded><![CDATA[<p>小弟在搬到DreamHost前其实已经在很多不同的Free hosting isp中徘徊了很长一段时间了，但经历了无数搬迁，终于在n次被删、被block、数据库损坏、ISP被GFW后生存下来了，最后还是下定了决心在<a href="http://v2ex.com" target="_blank" title="V2EX">V2EX</a>组织合租DreamHost，相信往后我会经常上来更新blog了！<br />
大家合租的同学玩得开心！大家合作愉快！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freemagi.com/2006/12/03/move-to-dh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
