<?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>国外主机空间</title>
	<atom:link href="http://www.nocnhost.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.nocnhost.com</link>
	<description>评测、对比、导购</description>
	<lastBuildDate>Sun, 08 Jan 2012 13:58:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Bluehost主机文件限制数量</title>
		<link>http://www.nocnhost.com/bluehost-file-count</link>
		<comments>http://www.nocnhost.com/bluehost-file-count#comments</comments>
		<pubDate>Sun, 08 Jan 2012 13:58:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bluehost主机]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=486</guid>
		<description><![CDATA[虽然国外主机限制基本都宣称是无限空间，但实际上对文件总数都是有限制的，Bluehost也不例外，以前是文件总数不超过5万个。不过现在已经调整到了20万。这对于一直钟爱bluehost主机的国内站长朋友来说毕竟是个好消息。说实在的，现在哪个站长朋友不是有十几，甚至几十个域名啊，很多还是采集站，所以，5万是根本不够用的。有时候，超额还是挺烦的，为此，我还买了几个账号。现在调整为20万比之前限制大了很多，不过相比Hostgator的25万，还是有点差距，希望bluehost能一直保持良好的性能和口碑。

]]></description>
			<content:encoded><![CDATA[<p>虽然国外主机限制基本都宣称是无限空间，但实际上对文件总数都是有限制的，<a href="http://www.nocnhost.com/bluehost-zhuji" target="_blank">Bluehost</a>也不例外，以前是文件总数不超过5万个。不过现在已经调整到了20万。这对于一直钟爱<span class='wp_keywordlink'><a href="http://bluehost.nocnhost.com" title="bluehost">bluehost</a></span>主机的国内站长朋友来说毕竟是个好消息。说实在的，现在哪个站长朋友不是有十几，甚至几十个域名啊，很多还是采集站，所以，5万是根本不够用的。有时候，超额还是挺烦的，为此，我还买了几个账号。现在调整为20万比之前限制大了很多，不过相比<a href="http://www.nocnhost.com/hostgator-hosting" target="_blank">Hostgator</a>的25万，还是有点差距，希望<span class='wp_keywordlink'><a href="http://bluehost.nocnhost.com" title="bluehost">bluehost</a></span>能一直保持良好的性能和口碑。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/bluehost-file-count/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>美国主机Reseller介绍</title>
		<link>http://www.nocnhost.com/reseller</link>
		<comments>http://www.nocnhost.com/reseller#comments</comments>
		<pubDate>Thu, 05 Jan 2012 09:06:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hostgator主机]]></category>
		<category><![CDATA[国外主机知识]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=484</guid>
		<description><![CDATA[美国主机很多网友都熟悉了，但对于什么是reseller主机却不一定明白。美国主机reseller是否和国内的主机代理是一个概念呢？可以明确的说，不是一个概念。

国内代理机制是代理交一部分预存款，然后有客户买的话，会有一个折扣价从预存款里面扣出，然后客户的主机是从客户购买当天算的。也就是说国内代理的产品，如果不是代理故意申请退款或者代理上家倒闭的话，用户可以使用满一年。美国reseller是指代理商购买一个主机包，这个包可以开子账户，每个子账户有一个独立的面板，如果代理主机包到期，而代理商不再续费的话，那么客户从代理商那里买的主机使用时间是没法保证1年的。

因此购买美国主机的reseller的产品时一定要看代理商的资质，声誉和客户数量，一般来说客户多，声誉好的代理商可以保证产品的可持续使用，因为reseller门槛极低，加之美国主机商并不会对reseller购买者进行监督，而且reseller套餐可以月付，因此朋友们一定要擦亮眼镜。系列中会陆续讲述如何识别主机商是reseller还是其他。

<span class="readmore"><a href="http://www.nocnhost.com/reseller" title="美国主机Reseller介绍">阅读全文——共1617字</a></span>]]></description>
			<content:encoded><![CDATA[<p>美国主机很多网友都熟悉了，但对于什么是reseller主机却不一定明白。美国主机reseller是否和国内的主机代理是一个概念呢？可以明确的说，不是一个概念。</p>
<p>国内代理机制是代理交一部分预存款，然后有客户买的话，会有一个折扣价从预存款里面扣出，然后客户的主机是从客户购买当天算的。也就是说国内代理的产品，如果不是代理故意申请退款或者代理上家倒闭的话，用户可以使用满一年。美国reseller是指代理商购买一个主机包，这个包可以开子账户，每个子账户有一个独立的面板，如果代理主机包到期，而代理商不再续费的话，那么客户从代理商那里买的主机使用时间是没法保证1年的。</p>
<p>因此购买美国主机的reseller的产品时一定要看代理商的资质，声誉和客户数量，一般来说客户多，声誉好的代理商可以保证产品的可持续使用，因为reseller门槛极低，加之美国主机商并不会对reseller购买者进行监督，而且reseller套餐可以月付，因此朋友们一定要擦亮眼镜。系列中会陆续讲述如何识别主机商是reseller还是其他。</p>
<p>淘宝上卖的DH，BH之类的合租和reseller有和区别</p>
<p>第三条说了reseller下的子账户有独立面板，而BH之类的美国主机合租是没有面板的，合租组织者一般只会提供一个ftp和mysql给参与者，一般风险较大，账户内可以使用phpshell看到整个账户内的其他文件夹，安全性极差，并且是违反主机商TOS的行为，主机商随时可能暂停合租者的主帐号。DH是一个例外，不过例外仅仅是说面板，DH可以开给子账户面板，但是同样是违反主机商TOS的行为，极容易被主机商封掉主帐号。不推荐购买这样形式的合租。</p>
<p>Reseller主机的利与弊</p>
<p>这条仅仅是针对想购买reseller做主机商的朋友说的</p>
<p>利：入门容易，月付最低仅需几十元（比较无良）即可做主机商，不用会技术，只需要负责销售即可，比较轻松。</p>
<p>弊：不知道服务器上到底多少站点，主机商一般都规定的有reseller的cpu占用率，超过占用率的reseller会被主机商k掉。很多主机商会攻击是零容忍，被攻击会立刻暂停账户。有时候子账户超cpu也会被主机商暂停，或者其他的莫须有的罪名，容易得罪客户，备份困难，一切都要靠主机商的备份。</p>
<p>美国主机选购之Reseller介绍–reseller主机商推荐之<a href="http://www.nocnhost.com/hostgator-hosting" target="_blank">hostgator</a></p>
<p>第一个推荐的是<a href="http://www.nocnhost.com/hostgator-hosting" target="_blank">hostgator</a>，这家可以说是reseller主机提供商中的王者，down机率很低，而且国内购买稍显麻烦，所以国人少，国人少的地方自然好办事。呵呵。</p>
<p>Hostgator家的标志是一只鳄鱼，可见其霸气，Hostgator成立于2002年，已经有了8年的历史，如今Hostgator已经成为全球领先的主机运营商，提供虚拟主机，reseller主机，vps和独立服务器。：现已运营并管理着超过7，000台的服务器，拥有超过22.5万的客户群，为全球170个国家的客户提供主机服务。旗下超过200万的域名存放量贡献了全球1%的互联网流量，也就是说全球每访问100个网页，其中就有一个网页是架设在Hostgator上的。</p>
<p>Hostgator的服务器是放在美国得克萨斯州东部城市的达拉斯Theplanet数据中心，很多接触过美国服务器运营商的朋友应该都了解，这个机房一直以稳定和速度快而深受好评。在注重绿色环保的今天，Hostgator的服务器均采用风力发电。</p>
<p>Hostgator的reseller套餐有5种，其实买第一种Aluminum套餐就足够了，每月仅仅24.95刀，50G的磁盘 500G的月流量很足了不限制域名绑定。</p>
<p>Hostgator一个很优惠的地方是送Whmcs，看好了，不是whm，每个基于cpanel面板的reseller主机都是送whm的，但是whmcs是一个财务系统，很多国外主机商都在用这个whmcs，价值在每月14刀，所以说<a href="http://www.nocnhost.com/hostgator-hosting" target="_blank">Hostgator</a>是比较值，加上一个比较过硬的质量。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/reseller/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bluehost阻止某些ip访问的设置</title>
		<link>http://www.nocnhost.com/bluehost-deny-ip</link>
		<comments>http://www.nocnhost.com/bluehost-deny-ip#comments</comments>
		<pubDate>Thu, 05 Jan 2012 01:06:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bluehost主机]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=480</guid>
		<description><![CDATA[在一些情况下，我们常常需要阻止某些ip对我们网站的访问，比如某个ip经常在你的论坛捣乱，或者恶意点击广告，刷新你的网站等等，我们可以利用bluehost的一些设置，达到阻止这些ip对主机的访问

设置过.htaccess文件的方法：

下面以htaccess文件来设置阻止IP访问。只需要在.htaccess文件加入下面一些代码。

<span class="readmore"><a href="http://www.nocnhost.com/bluehost-deny-ip" title="Bluehost阻止某些ip访问的设置">阅读全文——共234字</a></span>]]></description>
			<content:encoded><![CDATA[<p>在一些情况下，我们常常需要阻止某些ip对我们网站的访问，比如某个ip经常在你的论坛捣乱，或者恶意点击广告，刷新你的网站等等，我们可以利用<a href="http://www.nocnhost.com/bluehost-zhuji">bluehost</a>的一些设置，达到阻止这些ip对主机的访问</p>
<p>设置过.htaccess文件的方法：<br />
下面以htaccess文件来设置阻止IP访问。只需要在.htaccess文件加入下面一些代码。</p>
<p>Order Deny,Allow<br />
Deny from **.**.11.4  （这里是你希望阻止访问的ip地址）</p>
<p>添加上就可以阻止该IP不能访问此你的主机了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/bluehost-deny-ip/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bluehost主机怎样查看文件总数</title>
		<link>http://www.nocnhost.com/bluehost-files</link>
		<comments>http://www.nocnhost.com/bluehost-files#comments</comments>
		<pubDate>Thu, 05 Jan 2012 00:58:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bluehost主机]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=477</guid>
		<description><![CDATA[Bluehost最初允许的文件总数是5万，现在已经提交到了20万。随着网站不断地增加，有时候我们也不免担心是否文件总数超标，导致账户出现问题。以前要知道文件总数还需要提交ticket，现在只需要在cpanel面板找到File Count的图标即可查看了。

]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nocnhost.com/bluehost-zhuji" target="_blank">Bluehost</a>最初允许的文件总数是5万，现在已经提交到了20万。随着网站不断地增加，有时候我们也不免担心是否文件总数超标，导致账户出现问题。以前要知道文件总数还需要提交ticket，现在只需要在cpanel面板找到File Count的图标即可查看了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/bluehost-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Justhost和Hostgator文件对拷问题</title>
		<link>http://www.nocnhost.com/justhost-hostgator-ssh-copy</link>
		<comments>http://www.nocnhost.com/justhost-hostgator-ssh-copy#comments</comments>
		<pubDate>Fri, 04 Nov 2011 01:26:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hostgator主机]]></category>
		<category><![CDATA[Justhost主机]]></category>
		<category><![CDATA[hostgator]]></category>
		<category><![CDATA[justhost]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=472</guid>
		<description><![CDATA[众所周知，由于国内线路问题，国外主机的ftp速度经常不稳定。前一段时间Justhost的ftp下载速度一度可以达到400kb/S以上（联通4M），但这几天居然只有10K/s, 由于justhost经常自动删除全站备份文件，所有要下载备份文件所需要的时间非常长。还好，我的另外一个主机Hostgator的ftp下载速度非常给力，最高居然超过了600KB/s，稳定在500kb/s左右。



这样，我想到了一个方法，就是利用ssh的copy功能，直接把justhost的备份文件复制到hostgator，然后，把justhost的备份文件从hostgator主机ftp下载。这样一来，原本需要几个小时的下载，几分钟就下完了。利用putty登录ssh， 键入命令如下：

<span class="readmore"><a href="http://www.nocnhost.com/justhost-hostgator-ssh-copy" title="Justhost和Hostgator文件对拷问题">阅读全文——共452字</a></span>]]></description>
			<content:encoded><![CDATA[<p>众所周知，由于国内线路问题，国外主机的ftp速度经常不稳定。前一段时间<a href="http://www.nocnhost.com/justhost" target="_blank">Justhost</a>的ftp下载速度一度可以达到400kb/S以上（联通4M），但这几天居然只有10K/s, 由于justhost经常自动删除全站备份文件，所有要下载备份文件所需要的时间非常长。还好，我的另外一个主机<a href="http://www.nocnhost.com/hostgator-hosting" target="_blank">Hostgator</a>的ftp下载速度非常给力，最高居然超过了600KB/s，稳定在500kb/s左右。<br />
<a href="http://www.nocnhost.com/wp-content/uploads/2011/11/hostgator-ftp.jpg"><img class="alignnone size-full wp-image-473" title="hostgator-ftp" src="http://www.nocnhost.com/wp-content/uploads/2011/11/hostgator-ftp.jpg" alt="" width="405" height="39" /></a><br />
这样，我想到了一个方法，就是利用ssh的copy功能，直接把justhost的备份文件复制到hostgator，然后，把justhost的备份文件从hostgator主机ftp下载。这样一来，原本需要几个小时的下载，几分钟就下完了。利用putty登录ssh， 键入命令如下：</p>
<p>scp -P 2222 备份文件名.tar.gz 账号名@主机地址:/home/账号名/public_html/</p>
<p>注意：<a href="http://www.nocnhost.com/hostgator-hosting" target="_blank">Hostgator</a>的ssh端口是2222，而不是默认的22，所以要在scp 的后面加上 大写 -P 2222，我刚开始连接不上，后来才意识到这个问题。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/justhost-hostgator-ssh-copy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlueHost上Magento的邮件服务设置</title>
		<link>http://www.nocnhost.com/bluehost-magento-mail</link>
		<comments>http://www.nocnhost.com/bluehost-magento-mail#comments</comments>
		<pubDate>Fri, 28 Oct 2011 14:21:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bluehost主机]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=464</guid>
		<description><![CDATA[BlueHost上Magento的邮件服务设置后，显示form:

username@hostxxx.bluehost.com ，下面详细介绍一下如何解决这个问题，其它的美国主机和其它网站程序同样可以参考下面的方法。

1.创建一个E-mail帐户：

<span class="readmore"><a href="http://www.nocnhost.com/bluehost-magento-mail" title="BlueHost上Magento的邮件服务设置">阅读全文——共592字</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nocnhost.com/bluehost-zhuji" target="_blank">BlueHost</a>上Magento的邮件服务设置后，显示form:<br />
username@hostxxx.<span class='wp_keywordlink'><a href="http://bluehost.nocnhost.com" title="bluehost">bluehost</a></span>.com ，下面详细介绍一下如何解决这个问题，其它的<a href="http://www.nocnhost.com/" target="_blank">美国主机</a>和其它网站程序同样可以参考下面的方法。</p>
<p>1.创建一个E-mail帐户：</p>
<p>进入：cPanel&#8211;&gt;mail&#8211;&gt;Email Accounts</p>
<p>创建名为 yourmail@yourdomain.com</p>
<p>有关在<span class='wp_keywordlink'><a href="http://bluehost.nocnhost.com" title="bluehost">bluehost</a></span>虚拟主机上如何创建一个E-mail帐户<span class='wp_keywordlink'><a href="http://bluehost.nocnhost.com" title="bluehost">bluehost</a></span>之家已有图文和视频教程，这里不再重复。请参考：</p>
<p>2.设置php.ini</p>
<p>生成一个默认的php.ini文件php.ini.default，用文本编辑器查找：sendmail_path</p>
<p>将<br />
sendmail_path = “/usr/sbin/sendmail -t -i”<br />
修改为：<br />
sendmail_path = “/usr/sbin/sendmail -t -i -fyourmail@yourdomain.com”<br />
-t、 -i、 -f为参数，还可以使用参数-n,<br />
如这样：<br />
sendmail_path = “/usr/sbin/sendmail -t -i -fyourmail@yourdomain.com -nyourcompanyname”</p>
<p>3.将编辑后的php.ini.default保存并更名为php.ini上传到<a href="http://www.nocnhost.com/bluehost-zhuji">bluehost</a>上的Magento所在目录全部设置结束，测试一下投入使用。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/bluehost-magento-mail/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用bluehost，如何实现多域名访问网站</title>
		<link>http://www.nocnhost.com/multiple-domains</link>
		<comments>http://www.nocnhost.com/multiple-domains#comments</comments>
		<pubDate>Thu, 27 Oct 2011 12:57:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bluehost主机]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=461</guid>
		<description><![CDATA[基于各种原因，一个网站可能会启用新的域名，旧域名也仍然生效，也就是新旧域名指向同一个网站。如果你使用的是美国主机，那么应该怎样实现这个功能呢？下面就以bluehot为例（其他使用cpanel控制面板的主机的操作也是一样的），说明如何实现多域名访问网站。

要把其它域名绑定在主域名其实很容易，直接在Parked Domain添加域名既可。下面来说明一般的情况，要绑定的网站是用addon domain添加的如何操作。

假设已经用addon domain的功能添加了一个网站abc.com对应的文件夹/public_html/abc.com , 现在要绑定一个新的域名abc2.com到已经有的这个网站。

<span class="readmore"><a href="http://www.nocnhost.com/multiple-domains" title="使用bluehost，如何实现多域名访问网站">阅读全文——共469字</a></span>]]></description>
			<content:encoded><![CDATA[<p>基于各种原因，一个网站可能会启用新的域名，旧域名也仍然生效，也就是新旧域名指向同一个网站。如果你使用的是美国主机，那么应该怎样实现这个功能呢？下面就以<a href="http://www.nocnhost.com/bluehost-zhuji">bluehot</a>为例（其他使用cpanel控制面板的主机的操作也是一样的），说明如何实现多域名访问网站。</p>
<p>要把其它域名绑定在主域名其实很容易，直接在Parked Domain添加域名既可。下面来说明一般的情况，要绑定的网站是用addon domain添加的如何操作。</p>
<p>假设已经用addon domain的功能添加了一个网站abc.com对应的文件夹/public_html/abc.com , 现在要绑定一个新的域名abc2.com到已经有的这个网站。</p>
<p>仍然是使用addon domain添加域名abc2.com，有一点要注意的，对应的文件夹不能使用默认的，而是修改为要绑定的那个网站对应的文件夹，也就是/public_html/abc.com，而不是/public_html/abc2.com</p>
<p>然后点击addon domain添加新域名。这样abc2.com就绑定到原来的网站了，到这一步就实现了多域名访问了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/multiple-domains/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>怎样利用php修改bluehost邮件账号密码</title>
		<link>http://www.nocnhost.com/use-php-change-bluehost-email-account-password</link>
		<comments>http://www.nocnhost.com/use-php-change-bluehost-email-account-password#comments</comments>
		<pubDate>Tue, 25 Oct 2011 14:39:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bluehost主机]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=466</guid>
		<description><![CDATA[这是一个利用php修改邮件账号密码的代码。一般来说，在bluehost（包括FastDomain和HostMonster），修改邮件账号密码需要登录cpanel管理面板或者登录邮件管理界面，这两种方法都是比较麻烦的。

这个脚本工作原理就是获得邮件域名下关联的隐藏文件，寻找你想修改的邮件账户名，找到后对比文件中的密码，并用新的密码覆盖原理的密码。

这个脚本可以在bluehost，hostmonster，fastdomain（都是一家的）上运行，实际上你可以在所有使用cpanel面板的美国主机上试试。

<span class="readmore"><a href="http://www.nocnhost.com/use-php-change-bluehost-email-account-password" title="怎样利用php修改bluehost邮件账号密码">阅读全文——共308字</a></span>]]></description>
			<content:encoded><![CDATA[<p>这是一个利用php修改邮件账号密码的代码。一般来说，在<a href="http://www.nocnhost.com/bluehost-zhuji">bluehost</a>（包括FastDomain和<a href="http://www.nocnhost.com/hostmonster-zhuji">HostMonster</a>），修改邮件账号密码需要登录cpanel管理面板或者登录邮件管理界面，这两种方法都是比较麻烦的。</p>
<p>这个脚本工作原理就是获得邮件域名下关联的隐藏文件，寻找你想修改的邮件账户名，找到后对比文件中的密码，并用新的密码覆盖原理的密码。</p>
<p>这个脚本可以在<span class='wp_keywordlink'><a href="http://bluehost.nocnhost.com" title="bluehost">bluehost</a></span>，<a href="http://www.nocnhost.com/hostmonster-zhuji">hostmonster</a>，fastdomain（都是一家的）上运行，实际上你可以在所有使用cpanel面板的美国主机上试试。</p>
<pre class="wp-code-highlight prettyprint">
&lt;?php

$message = &quot;&quot;;
$found = $valid = false;

if (isset($_POST['username']) &amp;&amp; $_POST['username'] != &quot;&quot;) {
    $domain_pos = strpos($_POST['username'], &quot;@&quot;);
    if ($domain_pos === false) {
        $username = $_POST['username'];
        $domain = $_POST['domain'];
    } else {
        $username = substr($_POST['username'], 0, $domain_pos);
        $domain = substr($_POST['username'], $domain_pos + 1);
    }

    $current_password = $_POST['current_password'];
    $new_password1 = $_POST['new_password1'];
    $new_password2 = $_POST['new_password2'];

    $root = $_SERVER['DOCUMENT_ROOT'];
    $path_elements = explode('/', $root);
    $root = &quot;/{$path_elements[1]}/{$path_elements[2]}&quot;; // for <span class='wp_keywordlink'><a href="http://bluehost.nocnhost.com" title="bluehost">bluehost</a></span>, extracts homedir ex: /homeN/blueuser may work with other hosts?
    $shadow_file = &quot;$root/etc/$domain/shadow&quot;;

    // check if the shadow file exists. if not, either an invalid
    // domain was entered or this may not be a bluehost account...?
    if (file_exists($shadow_file)) {
        // compare the new passwords entered to ensure they match.
        if ($new_password1 == $new_password2) {
            if (trim($new_password1) != &quot;&quot;) {
                // get the contents of the shadow file.
                $shadow = file_get_contents($shadow_file);
                $lines = explode(&quot;\n&quot;, $shadow);

                // go through each line of shadow file, looking for username entered.
                for ($i = 0; $i &lt; count($lines); $i++) {
                    $elements = explode(&quot;:&quot;, $lines[$i]);
                    // found the user...
                    if ($elements[0] == $username) {
                        $found = true;
                        $passwd = explode(&quot;$&quot;, $elements[1]);
                        $salt = $passwd[2]; // get the salt currently used 

                        // crypt the &quot;Current Password&quot; entered by user. Can use either builtin
                        // php crypt function or command line openssl command.
                        if (CRYPT_MD5 == 1) { // indicates whether or not the crypt command supports MD5.
                            $current = crypt($current_password, '$1$'.$salt.'$');
                        } else {
                            $current = trim(`openssl passwd -1 -salt &quot;$salt&quot; &quot;$current_password&quot;`);
                        }
                        // check if the current password entered by the user
                        // matches the password in the shadow file.
                        $valid = ($current == $elements[1]);

                        if ($valid) {
                            // if they match then crypt the new password using the same salt
                            // and modify the line in the shadow file with the new hashed password
                            if (CRYPT_MD5 == 1) {
                                $new = crypt($new_password1, '$1$'.$salt.'$');
                            } else {
                                $new = trim(`openssl passwd -1 -salt &quot;$salt&quot; &quot;$new_password1&quot;`);
                            }
                            $elements[1] = $new;
                            $lines[$i] = implode(&quot;:&quot;, $elements);
                        }

                        break;
                    }
                }

                if (!$found) {
                    $message = &quot;The username you entered is not valid.&quot;;
                } else if (!$valid) {
                    $message = &quot;The password you entered is not valid.&quot;;
                } else {
                    // write the new contents of the shadow back to the shadow file.
                    $shadow = implode(&quot;\n&quot;, $lines);
                    file_put_contents($shadow_file, $shadow);
                    $message = 'Your password has been updated.';
                }
            } else {
                $message = &quot;Your password cannot be blank.&quot;;
            }
        } else {
            $message = &quot;Both new passwords must match.&quot;;
        }
    } else {
        $message = &quot;The domain you entered is not valid.&quot;;
    }
}

?&gt;&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
    &lt;head&gt;
        &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
        &lt;title&gt;Change Password&lt;/title&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;?php
            if ($message != &quot;&quot;) {
                $color = $found &amp;&amp; $valid ? &quot;green&quot; : &quot;red&quot;;
                echo &quot;&lt;span style=\&quot;color:$color;\&quot;&gt;$message&lt;/span&gt;&quot;;
            }
        ?&gt;

        &lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
            &lt;input type=&quot;hidden&quot; name=&quot;domain&quot; value=&quot;somebluehostdomain.com&quot; /&gt;
            &lt;table&gt;
                &lt;tbody&gt;
                    &lt;tr&gt;
                        &lt;td&gt;&lt;label for=&quot;username&quot;&gt;Username&lt;/label&gt;&lt;/td&gt;
                        &lt;td&gt;&lt;input name=&quot;username&quot; id=&quot;username&quot; type=&quot;text&quot; /&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;&lt;label for=&quot;current_password&quot;&gt;Current Password&lt;/label&gt;&lt;/td&gt;
                        &lt;td&gt;&lt;input name=&quot;current_password&quot; id=&quot;current_password&quot; type=&quot;password&quot; /&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;&lt;label for=&quot;new_password1&quot;&gt;New Password&lt;/label&gt;&lt;/td&gt;
                        &lt;td&gt;&lt;input name=&quot;new_password1&quot; id=&quot;new_password1&quot; type=&quot;password&quot; /&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;&lt;label for=&quot;new_password2&quot;&gt;New Password&lt;/label&gt;&lt;/td&gt;
                        &lt;td&gt;&lt;input name=&quot;new_password2&quot; id=&quot;new_password2&quot; type=&quot;password&quot; /&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td colspan=&quot;2&quot; style=&quot;text-align:center;&quot;&gt;
                            &lt;input type=&quot;submit&quot; value=&quot;Update Password&quot; /&gt;
                        &lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/use-php-change-bluehost-email-account-password/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bluehost防采集代码</title>
		<link>http://www.nocnhost.com/bluehost-caiji</link>
		<comments>http://www.nocnhost.com/bluehost-caiji#comments</comments>
		<pubDate>Tue, 25 Oct 2011 12:57:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bluehost主机]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=459</guid>
		<description><![CDATA[网站被别人采集是站长们经常遇到的问题，以bluehost为例，在.htaccess文件增加下面的一段代码可以在一定程度上抵挡一些低级的采集。

关于这个的规则设置。

在.htaccess加上

<span class="readmore"><a href="http://www.nocnhost.com/bluehost-caiji" title="Bluehost防采集代码">阅读全文——共707字</a></span>]]></description>
			<content:encoded><![CDATA[<p>网站被别人采集是站长们经常遇到的问题，以<a href="http://www.nocnhost.com/bluehost-zhuji">bluehost</a>为例，在.htaccess文件增加下面的一段代码可以在一定程度上抵挡一些低级的采集。</p>
<p>关于这个的规则设置。<br />
在.htaccess加上<br />
Order Allow,Deny<br />
Allow from all<br />
Deny from yourdomain.com<br />
将上面的yourdomain.com换成你要禁止采集的的域名即可。</p>
<p>代码详解：</p>
<p>Allow和Deny可以用于apache的conf文件或者.htaccess文件中（配合Directory, Location, Files等），用来控制目录和文件的访问授权。<br />
所以，最常用的是：<br />
Order Deny,Allow<br />
Allow from All<br />
注意“Deny,Allow”中间只有一个逗号，也只能有一个逗号，有空格都会出错；单词的大小写不限。上面设定的含义是先设定“先检查禁止设定，没有禁止的全部允许”，而第二句没有Deny，也就是没有禁止访问的设定，直接就是允许所有访问了。这个主要是用来确保或者覆盖上级目录的设置，开放所有内容的访问权。<br />
按照上面的解释，下面的设定是无条件禁止访问：<br />
Order Allow,Deny<br />
Deny from All<br />
如果要禁止部分内容的访问，其他的全部开放：<br />
Order Deny,Allow<br />
Deny from ip1 ip2<br />
或者<br />
Order Allow,Deny<br />
Allow from all<br />
Deny from ip1 ip2<br />
apache会按照order决定最后使用哪一条规则，比如上面的第二种方式，虽然第二句allow允许了访问，但由于在order中allow不是最后规则，因此还需要看有没有deny规则，于是到了第三句，符合ip1和ip2的访问就被禁止了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/bluehost-caiji/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlueHost主机用PHP以SMTP方式发送邮件</title>
		<link>http://www.nocnhost.com/bluehos-php-smtp-email</link>
		<comments>http://www.nocnhost.com/bluehos-php-smtp-email#comments</comments>
		<pubDate>Tue, 25 Oct 2011 12:44:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bluehost主机]]></category>
		<category><![CDATA[bluehost]]></category>

		<guid isPermaLink="false">http://www.nocnhost.com/?p=457</guid>
		<description><![CDATA[一个发送E-MAIL的脚本可能和简单，但也不是人人都会用的。其实这样的脚本我们常常会用到，比如clickbank销售的自动短信通知。下面就以bluehost为例，说一下如何利用php发送邮件。

首先在系统中添加了一个邮件账户 test，密码 123456，然后写下了如下代码：

require_once( &#8216;Mail.php&#8217; );

<span class="readmore"><a href="http://www.nocnhost.com/bluehos-php-smtp-email" title="BlueHost主机用PHP以SMTP方式发送邮件">阅读全文——共1588字</a></span>]]></description>
			<content:encoded><![CDATA[<p>一个发送E-MAIL的脚本可能和简单，但也不是人人都会用的。其实这样的脚本我们常常会用到，比如clickbank销售的自动短信通知。下面就以<a href="http://www.nocnhost.com/bluehost-zhuji" target="_blank">bluehost</a>为例，说一下如何利用php发送邮件。</p>
<p>首先在系统中添加了一个邮件账户 test，密码 123456，然后写下了如下代码：<br />
require_once( &#8216;Mail.php&#8217; );<br />
$conf = array(<br />
&#8216;host&#8217; =&gt; &#8216;mail.yourdomail.com&#8217;,<br />
&#8216;auth&#8217; =&gt; true,<br />
&#8216;username&#8217; =&gt; &#8216;test&#8217;,<br />
&#8216;password&#8217; =&gt; &#8217;123456&#8242;<br />
);<br />
$headers['From'] = &#8216;noreply@yourdomain.com&#8217;;<br />
$headers['To'] = $To;<br />
$headers['Subject'] = &#8216;=?GB2312?B?&#8217; . base64_encode( $Subject ) . &#8216;?=&#8217;;<br />
$headers['Content-Type'] = &#8216;text/plain; charset=gb2312&#8242;;<br />
$Mail = &amp; Mail::factory( &#8216;smtp&#8217;, $conf );<br />
$res = $Mail-&gt;send( $To, $headers, $Content );<br />
$To 是想要发送到的信箱地址，比如 foobar@gmail.com，$Subject 是邮件主题，$Content 是 GB2312 编码的邮件正文。结果用以上程序屡试屡败，后来经过多次试验才得出在 <span class='wp_keywordlink'><a href="http://bluehost.nocnhost.com" title="bluehost">bluehost</a></span> 主机上用 PHP 以 SMTP 方式发送邮件的正确方法，注意事项如下：<br />
1) <a href="http://www.nocnhost.com/bluehost-zhuji" target="_blank">BlueHost</a> 帮助信息中说跟你账户（域名）相对应的 SMTP 主机地址是 mail.yourdomain.com，但其实应该是 localhost。你用 mail.yourdomain.com 只会得到 SMTP 拒绝链接的错误信息。<br />
2) SMTP 服务器需要验证才能发邮件。<br />
3) SMTP 验证时用户名需要写 user+yourdomain.com，不能写 user@yourdomain.com。想想这个也好理解，在虚拟主机上一个 SMTP server 要支撑很多个账户，这种写法应该是为了区别发件的账户。<br />
4) 邮件头中的发件邮件账户一定要是存在于系统中的真实账户，象我上面那样注册了一个 test@yourdomain.com，但是发件人账户又写 noreply@yourdomain.com 是不行的，只会得到这样的错误信息：<br />
SMTP: Invalid response code received from server (code: 550, response: Verification failed for No Such User Here Sender verify failed)<br />
之后，删掉刚才注册的 test 邮件帐号，注册一个 noreply 帐号，修改程序如下：<br />
require_once( &#8216;Mail.php&#8217; );<br />
$conf = array(<br />
&#8216;host&#8217; =&gt; &#8216;localhost&#8217;,<br />
&#8216;auth&#8217; =&gt; true,<br />
&#8216;username&#8217; =&gt; &#8216;noreply+yourdomain.com&#8217;,<br />
&#8216;password&#8217; =&gt; &#8217;123456&#8242;<br />
);<br />
$headers['From'] = &#8216;noreply@yourdomain.com&#8217;;<br />
$headers['To'] = $To;<br />
$headers['Subject'] = &#8216;=?GB2312?B?&#8217; . base64_encode( $Subject ) . &#8216;?=&#8217;;<br />
$headers['Content-Type'] = &#8216;text/plain; charset=gb2312&#8242;;<br />
$Mail = &amp; Mail::factory( &#8216;smtp&#8217;, $conf );<br />
$res = $Mail-&gt;send( $To, $headers, $Content );<br />
邮件被成功的发送出去了，而且由于邮件服务器在美国，发送到 GMail 信箱非常之快，一般这边一发那边刷新一下就能看到新邮件。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocnhost.com/bluehos-php-smtp-email/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.105 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-06 22:06:19 -->

