<?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>Life - WeiG &#187; vps</title>
	<atom:link href="http://www.weigblog.com/tag/vps/feed" rel="self" type="application/rss+xml" />
	<link>http://www.weigblog.com</link>
	<description>Yet another Life</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:13: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>Debian Lenny升级到Squeeze后MySQL无法启动的问题</title>
		<link>http://www.weigblog.com/2011/02/06/mysql-start-fail-when-upgrade-from-debian-lenny-to-squeeze.html</link>
		<comments>http://www.weigblog.com/2011/02/06/mysql-start-fail-when-upgrade-from-debian-lenny-to-squeeze.html#comments</comments>
		<pubDate>Sun, 06 Feb 2011 09:22:29 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dpkg]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[squeeze]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.weigblog.com/?p=564</guid>
		<description><![CDATA[今天把VPS从Debian Lenny升级到Squeeze了，却发现MySQL无法启动了。而且无法安装mysql-server，Debian在升级的时候，同时升级了mysql-server到5.1。 运行 返回的结果是： 解决方案： 然后重新安装mysql-server即可]]></description>
			<content:encoded><![CDATA[<p>今天把VPS从Debian Lenny升级到Squeeze了，却发现MySQL无法启动了。而且无法安装mysql-server，Debian在升级的时候，同时升级了mysql-server到5.1。</p>
<p>运行</p>
<pre class="brush: bash; title: ; notranslate">sudo apt-get install mysql-server</pre>
<p>返回的结果是：</p>
<pre class="brush: bash; title: ; notranslate">
...
Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.49-3_amd64.deb) ...
Stopping MySQL database server: mysqld.
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.1.49-3_all.deb) ...
Processing triggers for man-db ...
Setting up mysql-client-5.1 (5.1.49-3) ...
Setting up mysql-server-5.1 (5.1.49-3) ...
Installing new version of config file /etc/init.d/mysql ...
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action &quot;start&quot; failed.
dpkg: error processing mysql-server-5.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
                                      dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.1; however:
  Package mysql-server-5.1 is not configured yet.
dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
configured to not write apport reports
                                      Errors were encountered while processing:
 mysql-server-5.1
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
</pre>
<p>解决方案：</p>
<pre class="brush: bash; title: ; notranslate">
sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.backup
sudo cp /etc/mysql/my.cnf.dpkg-dist /etc/mysql/my.cnf
</pre>
<p>然后重新安装mysql-server即可</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weigblog.com/2011/02/06/mysql-start-fail-when-upgrade-from-debian-lenny-to-squeeze.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linode VPS上安装pptpd VPN服务</title>
		<link>http://www.weigblog.com/2010/02/12/linode-vps-pptpd-vpn.html</link>
		<comments>http://www.weigblog.com/2010/02/12/linode-vps-pptpd-vpn.html#comments</comments>
		<pubDate>Thu, 11 Feb 2010 16:52:47 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[pptpd]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.weigblog.com/?p=537</guid>
		<description><![CDATA[从购买了Linode VPS服务之后，就一直考虑弄个VPN。今天终于实现了，该文档讲述了如何在Linode上配置基于pptpd的VPN服务，以及一些troubleshooting的问题。 前提：必须有VPS；必须有SSH。 接下来的步骤将完成pptpd的安装： 安装pptpd服务 修改pptpd服务的配置文件/etc/pptpd.conf（只需要修改最后的localip和remoteip部分）： 修改/etc/ppp/chap-secrets文件 设置pptpd的DNS服务器，修改/etc/ppp/pptpd-options文件： 设置ip4v转发，修改/etc/sysctl.conf文件，去掉如下行的注释： 使ipv4转发生效，运行： 重新启动pptpd服务，运行： 开启ipv4转发，运行如下命令： 需要注意的是，我的VPS不知为什么，FORWARD rule默认的action是DROP（可能是由于我之前配制了防火墙的缘故。这也令我在一段时间内，纠结于为啥VPN无法正常转发。]]></description>
			<content:encoded><![CDATA[<p>从购买了Linode VPS服务之后，就一直考虑弄个VPN。今天终于实现了，该文档讲述了如何在Linode上配置基于pptpd的VPN服务，以及一些troubleshooting的问题。</p>
<p><strong>前提：</strong>必须有VPS；必须有SSH。</p>
<p>接下来的步骤将完成pptpd的安装：</p>
<ol>
<li>安装pptpd服务
<pre class="brush: bash; title: ; notranslate">sudo apt-get install pptpd</pre>
</li>
<li>修改pptpd服务的配置文件/etc/pptpd.conf（只需要修改最后的localip和remoteip部分）：
<pre class="brush: bash; title: ; notranslate">
localip 192.168.10.1
remoteip 192.168.10.100-150
</pre>
</li>
<li>修改/etc/ppp/chap-secrets文件
<pre class="brush: bash; title: ; notranslate">username pptpd password *</pre>
</li>
<li>设置pptpd的DNS服务器，修改/etc/ppp/pptpd-options文件：
<pre class="brush: bash; title: ; notranslate">
ms-dns 208.67.222.222
ms-dns 208.67.220.220
</pre>
</li>
<li>设置ip4v转发，修改/etc/sysctl.conf文件，去掉如下行的注释：
<pre class="brush: bash; title: ; notranslate">net.ipv4.ip_forward=1</pre>
</li>
<li>使ipv4转发生效，运行：
<pre class="brush: bash; title: ; notranslate">sysctl -p</pre>
</li>
<li>重新启动pptpd服务，运行：
<pre class="brush: bash; title: ; notranslate">/etc/init.d/pptpd restart</pre>
</li>
<li>开启ipv4转发，运行如下命令：
<pre class="brush: bash; title: ; notranslate">
/sbin/iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth0 -j MASQUERADE
/sbin/iptables -p FORWARD ACCEPT
</pre>
</li>
</ol>
<p>需要注意的是，我的VPS不知为什么，FORWARD rule默认的action是DROP（可能是由于我之前配制了防火墙的缘故。这也令我在一段时间内，纠结于为啥VPN无法正常转发。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weigblog.com/2010/02/12/linode-vps-pptpd-vpn.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Linode优化LAMP配置</title>
		<link>http://www.weigblog.com/2009/09/01/linode-optimize-lamp-config.html</link>
		<comments>http://www.weigblog.com/2009/09/01/linode-optimize-lamp-config.html#comments</comments>
		<pubDate>Tue, 01 Sep 2009 14:31:48 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.weigblog.com/?p=478</guid>
		<description><![CDATA[我的网站在经过2周左右的测试后，正式决定搬家到Linode。受经济和访问量等因素的综合考虑，我选择了最便宜的VPS方案（Linode 360：360MB内存，16GB存储空间，200GB月流量）。 操作系统上，我选择了Debian 5.0 (Lenny) 64bit。原因是Debian和我常用的Debian/Ubuntu系统最为贴近，安装、配置、管理都比较得心应手。至于64bit和32bit，简单一句话就是，64bit应用会相对更快一些，但也占用了更多的内存（例如一个int在32bit系统中占用4bytes，而在64bit系统中则占用8bytes）。 与很多采用Linode 360方案的人不太一样，我并没有使用传说更加高效的NgineX，而是使用了比较传统的LAMP结构。这样的代价是对于内存的消耗更加苛刻，而优点则是更加传统、经典、久经考验的Apache方案。 正是基于这些原因，我经过大约2周时间的调试，总结出针对我的个人网站来说比较合理的配置方案。 首先是Apache的配置（/etc/apache2/apache2.conf）： 接下来是PHP的配置（/etc/php5/apache2/php.ini）： 最后是MySQL的配置（/etc/mysql/my.conf）： 经过上述配置，在我的网站上，剩余物理内存空间基本能达到100MB左右，即使是峰值流量，也基本不会出现OOM了。]]></description>
			<content:encoded><![CDATA[<p>我的网站在经过2周左右的测试后，正式决定搬家到<a href="http://www.linode.com/?r=d399a85050ef9caca9080683c2b2249dd45454f6">Linode</a>。受经济和访问量等因素的综合考虑，我选择了最便宜的VPS方案（Linode 360：360MB内存，16GB存储空间，200GB月流量）。</p>
<p>操作系统上，我选择了Debian 5.0 (Lenny) 64bit。原因是Debian和我常用的Debian/Ubuntu系统最为贴近，安装、配置、管理都比较得心应手。至于64bit和32bit，简单一句话就是，64bit应用会相对更快一些，但也占用了更多的内存（例如一个int在32bit系统中占用4bytes，而在64bit系统中则占用8bytes）。</p>
<p>与很多采用Linode 360方案的人不太一样，我并没有使用传说更加高效的NgineX，而是使用了比较传统的<abbr title="Linux+Apache+MySQL+PHP">LAMP</abbr>结构。这样的代价是对于内存的消耗更加苛刻，而优点则是更加传统、经典、久经考验的Apache方案。</p>
<p>正是基于这些原因，我经过大约2周时间的调试，总结出针对我的个人网站来说比较合理的配置方案。</p>
<p>首先是Apache的配置（/etc/apache2/apache2.conf）：</p>
<pre class="brush: plain; title: ; notranslate">
KeepAlive                On
MaxkeepAliveRequest      20
MaxKeepAliveTimeOut      25

&lt;IfModule mpm_prefork_module&gt;
    ServerLimit          30
    StartServers          3
    MinSpareServers       3
    MaxSpareServers       7
    MaxClients           20
    MaxRequestsPerChild 500
&lt;/IfModule&gt;
</pre>
<p>接下来是PHP的配置（/etc/php5/apache2/php.ini）：</p>
<pre class="brush: plain; title: ; notranslate">
max_execution_time = 180
max_input_time = 60
memory_limit = 64M
error_reporting  = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
register_globals = Off
</pre>
<p>最后是MySQL的配置（/etc/mysql/my.conf）：</p>
<pre class="brush: plain; title: ; notranslate">
key_buffer              = 16K
max_allowed_packet      = 3M
thread_stack            = 64K
thread_cache_size       = 8
table_cache             = 3
query_cache_limit       = 1M
query_cache_size        = 16M
#skip-innodb
</pre>
<p>经过上述配置，在我的网站上，剩余物理内存空间基本能达到100MB左右，即使是峰值流量，也基本不会出现OOM了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weigblog.com/2009/09/01/linode-optimize-lamp-config.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>迁移至Linode VPS</title>
		<link>http://www.weigblog.com/2009/08/14/migrate-to-linode-vps.html</link>
		<comments>http://www.weigblog.com/2009/08/14/migrate-to-linode-vps.html#comments</comments>
		<pubDate>Fri, 14 Aug 2009 00:10:41 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[migrate]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.weigblog.com/?p=469</guid>
		<description><![CDATA[考虑再三，终于还是决定把主机迁移到Linode VPS了。 什么是VPS呢？Virtual Private Server，简单说就是虚拟机，与之类似的概念可以提到Hyper-V、VMWare等等。VPS利用虚拟机技术，在一台物理主机上安装多个虚拟主机。每个VPS主机都相当于独立的操作系统，与像Dedicated Hosting一样。 VPS（Unmanaged Virtual Private Server）与Shared Hosting的相比： VPS的资源是独立的，分配给你100MB内存，这些内存就是你的，别人抢不走 虚拟机操作系统上只有你一个人使用，拥有root权限，想装什么都装什么，想怎么tuning，就怎么tuning 可以安装多种操作系统，从Fedora到Ubuntu，再到CentOS。玩儿腻了，重装一个就行。 而与Dedicated Hosting相比，最大的优点就是价格了。Dedicated Hosting动辄就是每月上百甚至几百美元的费用，对于一般的用户来说，也是承受不起的。再者，Dedicated Hosting提供的硬件配置，一般也是用不到的。 当然VPS的独立操作系统既是它的优点，也是它很大的缺点。系统是独立的，你需要自己安装软件，自己配置，自己做performance tuning。对于Linux操作系统的能力还有有一定要求的。 这样，基于种种这些原因。VPS就浮现到我的迁移计划中。经过反复的比较，终于在SliceHost、fcksvps和Linode之中选中了Linode。其实SliceHost和Linode口碑都是非常不错的，唯一的缺点是SliceHost的机房到中国的速度比较低，而Linode这个老牌的VPS服务提供商，有全美4个机房的选择。我则选择了号称最快的Fremont, CA, USA机房。 我选择了Linode VPS最便宜的方案：RAM 360MB，Storage 16GB，Bandwidth 200GB，基于Xen的虚拟机技术。配置不高，而对我这样一个小的网站来说，很合适了。与超售严重、资源要求苛刻的Shared Hosting来说，这个配置是非常值得的。 在操作系统上，我选择了Ubuntu 9.04 64bit。在经过1~2个网站迁移后的试用之后，觉得正式全部迁移过来。 在目前的配置上，我使用了Apache2、MySQL、PHP5。具体配置如下： Apache: PHP: 本来为了内存设置，想设置memory_limit=16M，可设置为16M、24M和32M，WordPress不是显示有问题（白屏），就是不能升级。权衡一下，还是保留了64M。 MySQL: 在如上配置情况下，内存占用是这样的： 从配置和性能上看，剩余物理内存只有33M，这时的SSH也会变慢。如果准备在VPS上host较多的网站，还是采用高一级别（540M）的配置比较好，或是使用高性能、轻量级的web服务器（比如nginX或Lighttpd）。Linode支持升级，无论是单一的内存、流量、磁盘，还是统一的level升级，都可以做。而这些只需要在后台即可完成。 如果你也对Linode VPS感兴趣。可以通过下面链接申请（链接带有推荐代码）： http://www.linode.com/?r=d399a85050ef9caca9080683c2b2249dd45454f6]]></description>
			<content:encoded><![CDATA[<p>考虑再三，终于还是决定把主机迁移到<a href="http://linode.com/">Linode</a> <abbr title="Virtual Private Server">VPS</abbr>了。</p>
<p>什么是VPS呢？Virtual Private Server，简单说就是虚拟机，与之类似的概念可以提到Hyper-V、VMWare等等。VPS利用虚拟机技术，在一台物理主机上安装多个虚拟主机。每个VPS主机都相当于独立的操作系统，与像Dedicated Hosting一样。</p>
<p>VPS（Unmanaged Virtual Private Server）与Shared Hosting的相比：</p>
<ol>
<li>VPS的资源是独立的，分配给你100MB内存，这些内存就是你的，别人抢不走</li>
<li>虚拟机操作系统上只有你一个人使用，拥有root权限，想装什么都装什么，想怎么tuning，就怎么tuning</li>
<li>可以安装多种操作系统，从Fedora到Ubuntu，再到CentOS。玩儿腻了，重装一个就行。</li>
</ol>
<p>而与Dedicated Hosting相比，最大的优点就是价格了。Dedicated Hosting动辄就是每月上百甚至几百美元的费用，对于一般的用户来说，也是承受不起的。再者，Dedicated Hosting提供的硬件配置，一般也是用不到的。</p>
<p>当然VPS的独立操作系统既是它的优点，也是它很大的缺点。系统是独立的，你需要自己安装软件，自己配置，自己做performance tuning。对于Linux操作系统的能力还有有一定要求的。</p>
<p>这样，基于种种这些原因。VPS就浮现到我的迁移计划中。经过反复的比较，终于在SliceHost、fcksvps和Linode之中选中了Linode。其实SliceHost和Linode口碑都是非常不错的，唯一的缺点是SliceHost的机房到中国的速度比较低，而Linode这个老牌的VPS服务提供商，有全美4个机房的选择。我则选择了号称最快的Fremont, CA, USA机房。</p>
<p>我选择了Linode VPS最便宜的方案：RAM 360MB，Storage 16GB，Bandwidth 200GB，基于Xen的虚拟机技术。配置不高，而对我这样一个小的网站来说，很合适了。与超售严重、资源要求苛刻的Shared Hosting来说，这个配置是非常值得的。</p>
<p>在操作系统上，我选择了Ubuntu 9.04 64bit。在经过1~2个网站迁移后的试用之后，觉得正式全部迁移过来。</p>
<p>在目前的配置上，我使用了Apache2、MySQL、PHP5。具体配置如下：</p>
<p><strong>Apache:</strong></p>
<pre class="brush: plain; title: ; notranslate">
KeepAlive                 On
MaxKeepAliveRequest       20
KeepAliveTimeOut           5
&lt;IfModule mpm_prefork_module&gt;
    StartServers           5
    MinSpareServers        3
    MaxSpareServers       10
    MaxClients            25
    MaxRequestsPerChild  500
&lt;/IfModule&gt;
</pre>
<p><strong>PHP:</strong></p>
<pre class="brush: plain; title: ; notranslate">
memory_limit = 64M
</pre>
<p>本来为了内存设置，想设置memory_limit=16M，可设置为16M、24M和32M，WordPress不是显示有问题（白屏），就是不能升级。权衡一下，还是保留了64M。</p>
<p><strong>MySQL:</strong></p>
<pre class="brush: plain; title: ; notranslate">
key_buffer             = 16K
max_allowed_packet     = 3M
thread_stack           = 64K
thread_cache_size      = 8
table_cache            = 3
#skip-innodb
</pre>
<p>在如上配置情况下，内存占用是这样的：</p>
<pre class="brush: plain; title: ; notranslate">
.            total       used       free     shared    buffers     cached
Mem:           360        355          4          0          1         27
-/+ buffers/cache:        326         33
Swap:          255        129        126
</pre>
<p>从配置和性能上看，剩余物理内存只有33M，这时的SSH也会变慢。如果准备在VPS上host较多的网站，还是采用高一级别（540M）的配置比较好，或是使用高性能、轻量级的web服务器（比如nginX或Lighttpd）。Linode支持升级，无论是单一的内存、流量、磁盘，还是统一的level升级，都可以做。而这些只需要在后台即可完成。</p>
<p>如果你也对Linode VPS感兴趣。可以通过下面链接申请（链接带有推荐代码）：</p>
<p><a href="http://www.linode.com/?r=d399a85050ef9caca9080683c2b2249dd45454f6">http://www.linode.com/?r=d399a85050ef9caca9080683c2b2249dd45454f6</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.weigblog.com/2009/08/14/migrate-to-linode-vps.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

