<?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>程式設計 遇上 小提琴 &#187; Virtual host</title>
	<atom:link href="http://blog.ez2learn.com/tag/virtual-host/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ez2learn.com</link>
	<description>Victor&#039;s個人部落格，關於程式設計與小提琴</description>
	<lastBuildDate>Tue, 07 Feb 2012 03:26:25 +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>My review of Webfaction</title>
		<link>http://blog.ez2learn.com/2009/09/17/my-review-of-webfaction/</link>
		<comments>http://blog.ez2learn.com/2009/09/17/my-review-of-webfaction/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 04:58:27 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[分享]]></category>
		<category><![CDATA[English Articles]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Virtual host]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[WebFaction]]></category>

		<guid isPermaLink="false">http://blog.ez2learn.com/?p=752</guid>
		<description><![CDATA[experience of using webfaction virtual hosting service <a href="http://blog.ez2learn.com/2009/09/17/my-review-of-webfaction/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One year has past since I bought <a href="http://www.webfaction.com/?affiliate=victorlin">Webfaction</a>&#8216;s virtual hosting service. Today, I want to share my experience.</p>
<h2>Webfaction&#8217;s virtual hosting is more than virtual hosting</h2>
<p>What does it mean "virtual hosting is more than virtual hosting"? Well, normaly, people think virtual hostings are all like that, upload your application by ftp, there is only few types of web application you can run, might be php, asp or some out-of-date web stuff. And you configure your site with control panel like cPanel or whatever, and that&#8217;s all what you can do with your host, pretty little isn&#8217;t it? You buy the service, but they limit what you can do.</p>
<p><a href="http://www.webfaction.com/?affiliate=victorlin">Webfaction</a>, they give you full access to your SSH account, you can do almost everything you like with that. You can install whatever you like in your home directory, but indeed, they already installed most of popular tools for you.</p>
<div id="attachment_28" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.ez2learn.com/wp-content/uploads/2008/09/2008-09-28_233501.png"><img class="size-medium wp-image-28" title="遠端登入WebFaction帳號" src="http://blog.ez2learn.com/wp-content/uploads/2008/09/2008-09-28_233501-300x188.png" alt="遠端登入WebFaction帳號" width="300" height="188" /></a><p class="wp-caption-text">login to WebFaction&#39;s SSH account</p></div>
<p>For example, you can compile and install software you like in your home directory, You can even compile a server wrote in c language and run it on <a href="http://www.webfaction.com/?affiliate=victorlin">Webfaction</a>! I wrote an article to demonstrate how. You can read the article here: <a href="http://blog.ez2learn.com/tag/webfaction/">WebFaction能不能跑自己的C/C++語言Server?</a> (it is in traditional chinese)</p>
<div id="attachment_698" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.ez2learn.com/wp-content/uploads/2009/07/custom_app.png"><img class="size-medium wp-image-698" title="custom_app" src="http://blog.ez2learn.com/wp-content/uploads/2009/07/custom_app-300x198.png" alt="custom_app" width="300" height="198" /></a><p class="wp-caption-text">Create a custom application by Webfaction&#39;s panel</p></div>
<p><a href="http://blog.ez2learn.com/wp-content/uploads/2009/07/custom_port.png"><img class="alignnone size-medium wp-image-699" title="custom_port" src="http://blog.ez2learn.com/wp-content/uploads/2009/07/custom_port-300x198.png" alt="custom_port" width="300" height="198" /></a></p>
<div id="attachment_700" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.ez2learn.com/wp-content/uploads/2009/07/compile_app.png"><img class="size-medium wp-image-700" title="compile_app" src="http://blog.ez2learn.com/wp-content/uploads/2009/07/compile_app-300x188.png" alt="compile_app" width="300" height="188" /></a><p class="wp-caption-text">Compile and run the c-server</p></div>
<div id="attachment_701" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.ez2learn.com/wp-content/uploads/2009/07/connect.png"><img class="size-medium wp-image-701" title="connect" src="http://blog.ez2learn.com/wp-content/uploads/2009/07/connect-300x159.png" alt="connect" width="300" height="159" /></a><p class="wp-caption-text">That&#39;s it!</p></div>
<p>Another example, as I said, it is more than virtual hosting, actually, that also means it is more than web hosting. What if you want to run a non-http server? You have to buy a VPS, right? No! You can use <a href="http://www.webfaction.com/?affiliate=victorlin">Webfaction</a> virtual hosting to run your non-http server! I wrote a little chat room server for my Andriod chat room client, and it runs well on Webfaction! (It is not running now, because I have no time to maintain, and there is lots of problem in my client, it consume lots of cpu even it is running in background, I did&#8217;t handle the life cycle event well, so I just stop running it, until I got time to update)</p>
<p><a href="http://blog.ez2learn.com/wp-content/uploads/2009/07/npc2.png"><img class="alignnone size-medium wp-image-682" title="Dragon" src="http://blog.ez2learn.com/wp-content/uploads/2009/07/npc2-300x200.png" alt="Dragon" width="300" height="200" /></a></p>
<p>Also, full access to SSH brings much more convenience to deal with your web applications. For example, it is a big trouble to deploy your web application by uploading all stuff by FTP. You have to remeber what pages are changed, and upload them manually, it is killing me. With <a href="http://www.webfaction.com/?affiliate=victorlin">Webfaction</a>, I use SVN to deploy my web application. I do develop web application on my machine, then, I check out my web application on Webfaction, and everything is there! If you just modified some pages of you site, you can commit them and run "svn update" on your application directory, and that&#8217;s it! Well, if you don&#8217;t like svn, you have your choice! You can install git, or if you like mercurial more than git, you can install them, too.</p>
<div id="attachment_306" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.ez2learn.com/wp-content/uploads/2008/11/svn.png"><img class="size-medium wp-image-306" title="在WebFaction主機遠端執行svn update" src="http://blog.ez2learn.com/wp-content/uploads/2008/11/svn-300x188.png" alt="在WebFaction主機遠端執行svn update" width="300" height="188" /></a><p class="wp-caption-text">run svn update in my application&#39;s folder</p></div>
<h2>Easy to use panel, install most popular web applications in few minutes</h2>
<p>What if you don&#8217;t know anything about linux commands, SSH or those geek&#8217;s stuff? Well, actually, Webfaction give you extra right by allowing you accessing SSH. But if you don&#8217;t know how to use SSH, that&#8217;s okay, you can use their powerful and easy-to-use control panel to install most of poplular web application without typing any lines of command, just fill the form, and click, then everything is there.</p>
<p><a href="http://blog.ez2learn.com/wp-content/uploads/2009/09/webfaction_panel.png"><img class="alignnone size-medium wp-image-760" title="webfaction_panel" src="http://blog.ez2learn.com/wp-content/uploads/2009/09/webfaction_panel-300x227.png" alt="webfaction_panel" width="300" height="227" /></a></p>
<p>There is so many popular applications that you can install with their control panel, e.g. wordpress, django, turbogears, trac, joomla, ruby on rails, subversion&#8230; and etc.  They use a simple but powerful architecture to let you configure your websites.</p>
<p><a href="http://blog.ez2learn.com/wp-content/uploads/2009/09/webfaction_architecture1.png"><img class="alignnone size-medium wp-image-762" title="webfaction_architecture" src="http://blog.ez2learn.com/wp-content/uploads/2009/09/webfaction_architecture1-300x172.png" alt="webfaction_architecture" width="300" height="172" /></a></p>
<p>As you can see in this figure, you mount domain names to application, that is, a website. It is pretty easy to use once you knows how it works.</p>
<h2>Friendly customer support</h2>
<p><a href="http://www.webfaction.com/?affiliate=victorlin">Webfaction</a> provide the best customer supporting I have never seen. When I encounter problems, they always give me good answers, they are willing to help you out. That makes me feel happy, they do care about how customers feel.  Also, they know much about <span>technique</span>s, although they provide so many cool new stuff, they still know technical details about those stuff, and they can help you out with their sophisticated experience. Their nice customer supporting never let me feel regret to recommand.</p>
<h2>It&#8217;s balance between convenience, freedom and price</h2>
<p>You might ask, why I don&#8217;t just buy a VPS? Well, that&#8217;s obvious. First, I have not time to manage a VPS, it is not a happy job to upgrade your server, monitor it all the time. It is annoying to receive a database down warning message when you are sleeping. All I  want is to run my sites, why I have to take care about so much details? Second, as you see, I got some new stuff to run, like TurboGears2, I also got some non-http servers to run, why I have to buy a VPS just because some new stuff or non-http server? Finally, the price is the matter, it&#8217;s not cheap  to buy a good VPS. So the conclusion is, <a href="http://www.webfaction.com/?affiliate=victorlin">Webfaction</a> is the balance between convenience, freedom and price. That&#8217;s why I choice it.</p>
<p><a href="http://blog.ez2learn.com/wp-content/uploads/2009/09/webfaction_conclusion.png"><img class="alignnone size-medium wp-image-765" title="webfaction_conclusion" src="http://blog.ez2learn.com/wp-content/uploads/2009/09/webfaction_conclusion-300x175.png" alt="webfaction_conclusion" width="300" height="175" /></a></p>
<h2>Finally</h2>
<p>Finally, if you&#8217;re interested in <a href="http://www.webfaction.com/?affiliate=victorlin">WebFaction</a>&#8216;s hosting service, you can just try it, they do provide 60-days money back guarantee, so you can get the money back if you don&#8217;t like it for any reason. And when you&#8217;re filling the signup form, you can fill my account "victorlin" in the "Promo code or referrer" field. I will be appreciate.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 152px; width: 1px; height: 1px;">
<h1>WebFaction能不能跑自己的C/C++語言Server?</h1>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.ez2learn.com/2009/09/17/my-review-of-webfaction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebFaction能不能跑自己的C/C++語言Server?</title>
		<link>http://blog.ez2learn.com/2009/07/30/run-self-compiled-c-cpp-server-on-webfaction/</link>
		<comments>http://blog.ez2learn.com/2009/07/30/run-self-compiled-c-cpp-server-on-webfaction/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 13:11:34 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[中文文章]]></category>
		<category><![CDATA[分享]]></category>
		<category><![CDATA[主機商]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[自行編譯]]></category>
		<category><![CDATA[虛擬主機]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Virtual host]]></category>
		<category><![CDATA[WebFaction]]></category>

		<guid isPermaLink="false">http://blog.ez2learn.com/?p=697</guid>
		<description><![CDATA[介紹如何在WebFaction虛擬主機下跑自行編譯的C/C++ Server <a href="http://blog.ez2learn.com/2009/07/30/run-self-compiled-c-cpp-server-on-webfaction/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>我之前寫了這篇<a href="http://blog.ez2learn.com/2009/07/19/webfaction-plans/">WebFaction不止是虛擬主機</a>的介紹，介紹關於<a href="http://www.webfaction.com/?affiliate=victorlin">WebFaction</a>雖然是虛擬主機，但是他能做得比虛擬主機多太多了，價格實惠，功能強大，有人問<a href="http://www.webfaction.com/?affiliate=victorlin">WebFaction</a>能不能跑自己的C/C++語言寫的Server，<strong>答案是當然可以</strong>，這點有明確地列在他們開出來的規格裡，為了示範如何做以及證明的確可以，我把我之前修網路程式設計寫的無聊Server丟上去編譯並執行給大家看</p>
<p><span id="more-697"></span></p>
<p>首先是伺服器的部份，因為只是作業，我寫的是一個很無聊的伺服器，client會丟一個數字n過來，而server會計算出這個數字在費伯那契數列中的第n個數然後回傳，只是為了示範，所以只以簡單為主，以下為程式碼片段:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #000080;">&lt;</span><span style="color: #000040;">!</span><span style="color: #008000;">&#91;</span>CDATA<span style="color: #008000;">&#91;</span>
<span style="color: #339900;">#include &quot;tcp_socket.h&quot;</span>
&nbsp;
<span style="color: #ff0000; font-style: italic;">/**
    @brief Handle incoming request
    @param [in] Socket to handle
**/</span>
<span style="color: #0000ff;">void</span> handleRequest<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> s<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
    string request <span style="color: #000080;">=</span> readString<span style="color: #008000;">&#40;</span>s<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #666666;">// remove \n</span>
    request <span style="color: #000080;">=</span> request.<span style="color: #007788;">substr</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">0</span>, request.<span style="color: #007788;">size</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    stringstream stream<span style="color: #008080;">;</span>
    <span style="color: #0000ff;">size_t</span> n<span style="color: #008080;">;</span>
    stream <span style="color: #000080;">&lt;&lt;</span> request<span style="color: #008080;">;</span>
    stream <span style="color: #000080;">&gt;&gt;</span> n<span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Receved request : &quot;</span> <span style="color: #000080;">&lt;&lt;</span> n <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #0000ff;">size_t</span> i<span style="color: #008080;">;</span>
    <span style="color: #0000ff;">int</span> a <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">int</span> b <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span>i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> n<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
        <span style="color: #0000ff;">int</span> temp <span style="color: #000080;">=</span> a <span style="color: #000040;">+</span> b<span style="color: #008080;">;</span>
        a <span style="color: #000080;">=</span> b<span style="color: #008080;">;</span>
        b <span style="color: #000080;">=</span> temp<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#123;</span>
        stringstream stream<span style="color: #008080;">;</span>
        stream <span style="color: #000080;">&lt;&lt;</span> b<span style="color: #008080;">;</span>
        writeString<span style="color: #008000;">&#40;</span>s, stream.<span style="color: #007788;">str</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">+</span> <span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> argc, <span style="color: #0000ff;">char</span> <span style="color: #000040;">*</span>argv<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">try</span> <span style="color: #008000;">&#123;</span>
        <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>argc <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">3</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;usage: fib interface port&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
            <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
		<span style="color: #0000ff;">const</span> string interface <span style="color: #000080;">=</span> argv<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
        <span style="color: #666666;">// get port</span>
        <span style="color: #0000ff;">int</span> port<span style="color: #008080;">;</span>
        stringstream str<span style="color: #008080;">;</span>
        str <span style="color: #000080;">&lt;&lt;</span> argv<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
        str <span style="color: #000080;">&gt;&gt;</span> port<span style="color: #008080;">;</span>
&nbsp;
        <span style="color: #666666;">// listen</span>
        <span style="color: #0000ff;">int</span> s <span style="color: #000080;">=</span> listenTCP<span style="color: #008000;">&#40;</span>port, <span style="color: #0000dd;">5</span>, interface<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Listing on &quot;</span> <span style="color: #000080;">&lt;&lt;</span> interface <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;:&quot;</span> <span style="color: #000080;">&lt;&lt;</span> port <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot; ...&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
        <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #008080;">;;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
            <span style="color: #666666;">// accept</span>
            sockaddr_in addr<span style="color: #008080;">;</span>
            <span style="color: #0000ff;">size_t</span> len <span style="color: #000080;">=</span> <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>addr<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
            <span style="color: #0000ff;">int</span> client <span style="color: #000080;">=</span> accept<span style="color: #008000;">&#40;</span>s, <span style="color: #0000ff;">reinterpret_cast</span><span style="color: #000080;">&lt;</span>sockaddr <span style="color: #000040;">*</span><span style="color: #000080;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>addr<span style="color: #008000;">&#41;</span>, <span style="color: #000040;">&amp;</span>len<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
            <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>client <span style="color: #000080;">==</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
                THROW<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;A connection from &quot;</span> <span style="color: #000080;">&lt;&lt;</span> ipAsString<span style="color: #008000;">&#40;</span>addr.<span style="color: #007788;">sin_addr</span>.<span style="color: #007788;">s_addr</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
            handleRequest<span style="color: #008000;">&#40;</span>client<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
            <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Close connection&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
            close<span style="color: #008000;">&#40;</span>client<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">catch</span><span style="color: #008000;">&#40;</span>SocketError <span style="color: #000040;">&amp;</span>e<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
        e.<span style="color: #007788;">print</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#93;</span><span style="color: #000080;">&gt;</span></pre></div></div>

<p>有了程式碼之後，我們要如何把它丟到<a href="http://www.webfaction.com/?affiliate=victorlin">WebFaction</a>上面跑呢? 這部份比較討人厭，我個人不是很喜歡在unix-like的環境下開發C/C++程式，因為實在太麻煩了，各家OS的header都不盡相同，文件也七零八落，不知道去哪裡找，不像M$雖然邪惡，可是他的MSDN就在那裡，也只有一份，比起來要跨平台Python方便多了，寫一次到處跑，還好這作業原本就是在unix-like下跑的，所以只差了errno的link問題，解決後就可以編譯了</p>
<p>首先，我們需要從<a href="http://www.webfaction.com/?affiliate=victorlin">WebFaction</a>的control panel中開一個custom app，也就是自訂的Server，因為port如果都任憑大家亂開，撞port號碼是個很大的問題，因此<a href="http://www.webfaction.com/?affiliate=victorlin">WebFaction</a>的port是交給他們統一分配的，如下圖所示，操作面版就可以建立一個custom app</p>
<p><a href="http://blog.ez2learn.com/wp-content/uploads/2009/07/custom_app.png"><img class="alignnone size-medium wp-image-698" title="custom_app" src="http://blog.ez2learn.com/wp-content/uploads/2009/07/custom_app-300x198.png" alt="custom_app" width="300" height="198" /></a></p>
<p>如你所見列表裡還有一堆其它程式可以透過這樣自動建成，不過我們今天重點不在那裡，而在自製的server，所以那些部份留在改天再介紹</p>
<p>這個步驟他會在你的home/webapps/下建立一個c_server_demo的資料夾，基本上，WebFaction的所有自動生程的程式都會在webapps下建立相對應的資料夾，而該安裝的檔案也會放在裡面，因為我們建立的是custom app，所以裡面是空的，不果我們還是照慣例，把我們的server程式碼丟進去，而在建立完c_server_demo之後，除了他會自動建立資料夾外，他還會分配一個port給你</p>
<p><a href="http://blog.ez2learn.com/wp-content/uploads/2009/07/custom_port.png"><img class="alignnone size-medium wp-image-699" title="custom_port" src="http://blog.ez2learn.com/wp-content/uploads/2009/07/custom_port-300x198.png" alt="custom_port" width="300" height="198" /></a></p>
<p>有了這個port，稍後我們的server就可以開在這個port上面，我們先進行編譯的工作，編譯完成後就可以執行我們的server，把它綁在我們想要的ip以及port上</p>
<p><a href="http://blog.ez2learn.com/wp-content/uploads/2009/07/compile_app.png"><img class="alignnone size-medium wp-image-700" title="compile_app" src="http://blog.ez2learn.com/wp-content/uploads/2009/07/compile_app-300x188.png" alt="compile_app" width="300" height="188" /></a></p>
<p>接著，server上線了，就可以來試著連線看看</p>
<p><a href="http://blog.ez2learn.com/wp-content/uploads/2009/07/connect.png"><img class="alignnone size-medium wp-image-701" title="connect" src="http://blog.ez2learn.com/wp-content/uploads/2009/07/connect-300x159.png" alt="connect" width="300" height="159" /></a></p>
<p><strong>成功了，就是這麼簡單</strong>，啥? 你說為什麼會有怪怪的數字? 因為server本來設計是接受binrary的整數，telnet丟字串給他當然會出問題，以上就是對於<a href="http://www.webfaction.com/?affiliate=victorlin">WebFaction</a>跑自行編譯Server的示範，因為有60天無條件退款，所以有興趣的朋友們別客氣申請來試試看，可以的話推薦人請填victorlin，或是從部落格的文章連結進入申請，<strong>還有其它問題的話可以問我，或是我幫各位問他們的客服</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ez2learn.com/2009/07/30/run-self-compiled-c-cpp-server-on-webfaction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

