КаÑательно Redis:<div><br></div><div>Сперва Ñтавим менеджер пакетов npm</div><div><pre style="margin-top: 20px; margin-bottom: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; font: normal normal normal 12px/normal 'Bitstream Vera Sans Mono', Courier, monospace; background-color: rgb(255, 255, 255); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); font-size: 13px; line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; ">
<code style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font: normal normal normal 12px/normal 'Bitstream Vera Sans Mono', Courier, monospace; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; ">curl <a href="http://npmjs.org/install.sh">http://npmjs.org/install.sh</a> | sh</code></pre>
<div><br></div><div>Далее  Ñтавим пакеты Ð´Ð»Ñ Redis:</div><div><pre style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; font: normal normal normal 12px/normal 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; background-color: rgb(248, 248, 248); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-color: rgb(221, 221, 221); color: rgb(68, 68, 68); overflow-x: auto; overflow-y: auto; -webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; ">
<code style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; font: normal normal normal 12px/normal 'Bitstream Vera Sans Mono', Courier, monospace; background-color: rgb(238, 238, 238) !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-top-style: none !important; border-right-style: none !important; border-bottom-style: none !important; border-left-style: none !important; border-top-color: rgb(222, 222, 222) !important; border-right-color: rgb(222, 222, 222) !important; border-bottom-color: rgb(222, 222, 222) !important; border-left-color: rgb(222, 222, 222) !important; border-width: initial !important; border-color: initial !important; ">npm install hiredis redis</code></pre>
</div><div><br></div><div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">Далее Ñоздать Ñервер example.js:</div><div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">
<pre style="white-space: pre-wrap; font-family: Monaco, 'Andale Mono', 'Lucida Console', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 11pt; padding-left: 1em; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(139, 200, 75); line-height: 28px; background-color: rgb(53, 49, 41); ">
<span style="color: rgb(195, 204, 136); font-style: italic; ">var</span><font class="Apple-style-span" color="#c3cc88"> http </font><span style="color: rgb(255, 255, 255); ">=</span><font class="Apple-style-span" color="#c3cc88"> require</font><span style="color: rgb(255, 255, 255); ">(</span><span style="color: rgb(185, 204, 197); ">'http'</span><span style="color: rgb(255, 255, 255); ">), redis = require('redis'), url = require('url');
</span><font class="Apple-style-span" color="#c3cc88">var redisClient = redis.createClient();
http</font><span style="color: rgb(255, 255, 255); ">.</span><font class="Apple-style-span" color="#c3cc88">createServer</font><span style="color: rgb(255, 255, 255); ">(</span><span style="color: rgb(195, 204, 136); font-style: italic; ">function</span><font class="Apple-style-span" color="#c3cc88"> </font><span style="color: rgb(255, 255, 255); ">(</span><font class="Apple-style-span" color="#c3cc88">req</font><span style="color: rgb(255, 255, 255); ">,</span><font class="Apple-style-span" color="#c3cc88"> res</font><span style="color: rgb(255, 255, 255); ">)</span><font class="Apple-style-span" color="#c3cc88"> </font><span style="color: rgb(255, 255, 255); ">{
var reqUrl = url.parse(req.url, true);
</span><font class="Apple-style-span" color="#c3cc88"> if (req.method !== 'GET' || reqUrl.pathname !== '/') {
res</font><span style="color: rgb(255, 255, 255); ">.</span><font class="Apple-style-span" color="#c3cc88">writeHead</font><span style="color: rgb(255, 255, 255); ">(</span><font class="Apple-style-span" color="#b9ccc5">412</font><span style="color: rgb(255, 255, 255); ">,</span><font class="Apple-style-span" color="#c3cc88"> </font><span style="color: rgb(255, 255, 255); ">{</span><span style="color: rgb(185, 204, 197); ">'Content-Type'</span><span style="color: rgb(255, 255, 255); ">:</span><font class="Apple-style-span" color="#c3cc88"> </font><span style="color: rgb(185, 204, 197); ">'text/plain'</span><span style="color: rgb(255, 255, 255); ">}</span><span style="color: rgb(255, 255, 255); ">);</span><font class="Apple-style-span" color="#c3cc88"><br>
res</font><span style="color: rgb(255, 255, 255); ">.</span><font class="Apple-style-span" color="#c3cc88">end</font><span style="color: rgb(255, 255, 255); ">(</span><span style="color: rgb(185, 204, 197); ">'Bad Request</span><span style="color: rgb(185, 204, 197); ">\n</span><span style="color: rgb(185, 204, 197); ">'</span><span style="color: rgb(255, 255, 255); ">);</span><font class="Apple-style-span" color="#c3cc88"><br>
return;
}
</font><font class="Apple-style-span" color="#c3cc88">res</font><span style="color: rgb(255, 255, 255); ">.</span><font class="Apple-style-span" color="#c3cc88">writeHead</font><span style="color: rgb(255, 255, 255); ">(</span><span style="color: rgb(185, 204, 197); ">200</span><span style="color: rgb(255, 255, 255); ">,</span><font class="Apple-style-span" color="#c3cc88"> </font><span style="color: rgb(255, 255, 255); ">{</span><span style="color: rgb(185, 204, 197); ">'Content-Type'</span><span style="color: rgb(255, 255, 255); ">:</span><font class="Apple-style-span" color="#c3cc88"> </font><span style="color: rgb(185, 204, 197); ">'text/plain'</span><span style="color: rgb(255, 255, 255); ">}</span><span style="color: rgb(255, 255, 255); ">);</span><font class="Apple-style-span" color="#c3cc88">
var tid = reqUrl.query.tid;
redisClient.set(tid, JSON.serialize(reqUrl.query), function() {</font><font class="Apple-style-span" color="#c3cc88">
</font><font class="Apple-style-span" color="#c3cc88">res</font><span style="color: rgb(255, 255, 255); ">.</span><font class="Apple-style-span" color="#c3cc88">end</font><span style="color: rgb(255, 255, 255); ">(</span><span style="color: rgb(185, 204, 197); ">'SET!</span><span style="color: rgb(185, 204, 197); ">\n</span><span style="color: rgb(185, 204, 197); ">'</span><span style="color: rgb(255, 255, 255); ">);
</span><font class="Apple-style-span" color="#c3cc88"> });
</font><span style="color: rgb(255, 255, 255); ">}</span><span style="color: rgb(255, 255, 255); ">).</span><font class="Apple-style-span" color="#c3cc88">listen</font><span style="color: rgb(255, 255, 255); ">(</span><span style="color: rgb(185, 204, 197); ">14337</span><span style="color: rgb(255, 255, 255); ">,</span><font class="Apple-style-span" color="#c3cc88"> </font><span style="color: rgb(185, 204, 197); ">"0.0.0.0"</span><span style="color: rgb(255, 255, 255); ">);</span><font class="Apple-style-span" color="#c3cc88">
console</font><span style="color: rgb(255, 255, 255); ">.</span><font class="Apple-style-span" color="#c3cc88">log</font><span style="color: rgb(255, 255, 255); ">(</span><span style="color: rgb(185, 204, 197); ">'Server running at <a href="http://0.0.0.0:14337/" target="_blank" style="color: rgb(17, 85, 204); ">http://0.0.0.0:14337/</a>'</span><span style="color: rgb(255, 255, 255); ">);</span></pre>
</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><br></div></div><div><br></div><br><div class="gmail_quote">24 ноÑÐ±Ñ€Ñ 2011 г. 15:36 пользователь Akzhan Abdulin <span dir="ltr"><<a href="mailto:akzhan.abdulin@gmail.com">akzhan.abdulin@gmail.com</a>></span> напиÑал:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">ИнÑÑ‚Ñ€ÑƒÐºÑ†Ð¸Ñ Ð¿Ð¾ уÑтановке:<div><br></div><div>Ðадо иметь <font face="helvetica, arial, freesans, clean, sans-serif"><span style="font-size:14px;line-height:13px">python 2.6 или выше, а также libssl-dev.</span></font><br>
<div><pre style="margin-top:20px;margin-bottom:0px;padding-top:6px;padding-right:10px;padding-bottom:6px;padding-left:10px;font:normal normal normal 12px/normal 'Bitstream Vera Sans Mono',Courier,monospace;background-color:rgb(255,255,255);border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(204,204,204);border-right-color:rgb(204,204,204);border-bottom-color:rgb(204,204,204);border-left-color:rgb(204,204,204);font-size:13px;line-height:19px;border-top-left-radius:3px 3px;border-top-right-radius:3px 3px;border-bottom-right-radius:3px 3px;border-bottom-left-radius:3px 3px">
<code style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font:normal normal normal 12px/normal 'Bitstream Vera Sans Mono',Courier,monospace;background-color:transparent;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-top-left-radius:3px 3px;border-top-right-radius:3px 3px;border-bottom-right-radius:3px 3px;border-bottom-left-radius:3px 3px;border-width:initial;border-color:initial">git clone git://<a href="http://github.com/joyent/node.git" target="_blank">github.com/joyent/node.git</a>
cd node
git checkout v0.6.2
./configure
make -j2 # -j sets the number of jobs to run
[sudo] make install</code></pre><div><br></div><div>Далее Ñоздать Ñервер example.js:</div><div><pre style="font-family:Monaco,'Andale Mono','Lucida Console','Bitstream Vera Sans Mono','Courier New',monospace,serif;font-size:11pt;color:rgb(195,204,136);padding-left:1em;border-left-width:1px;border-left-style:solid;border-left-color:rgb(139,200,75);line-height:28px;background-color:rgb(53,49,41)">
<span style="font-style:italic">var</span> http <span style="color:rgb(255,255,255)">=</span> <span>require</span><span style="color:rgb(255,255,255)">(</span><span style="color:rgb(185,204,197)">'http'</span><span style="color:rgb(255,255,255)">);</span>
http<span style="color:rgb(255,255,255)">.</span><span>createServer</span><span style="color:rgb(255,255,255)">(</span><span style="font-style:italic">function</span> <span style="color:rgb(255,255,255)">(</span>req<span style="color:rgb(255,255,255)">,</span> res<span style="color:rgb(255,255,255)">)</span> <span style="color:rgb(255,255,255)">{</span>
res<span style="color:rgb(255,255,255)">.</span><span>writeHead</span><span style="color:rgb(255,255,255)">(</span><span style="color:rgb(185,204,197)">200</span><span style="color:rgb(255,255,255)">,</span> <span style="color:rgb(255,255,255)">{</span><span style="color:rgb(185,204,197)">'Content-Type'</span><span style="color:rgb(255,255,255)">:</span> <span style="color:rgb(185,204,197)">'text/plain'</span><span style="color:rgb(255,255,255)">}</span><span style="color:rgb(255,255,255)">);</span>
res<span style="color:rgb(255,255,255)">.</span><span>end</span><span style="color:rgb(255,255,255)">(</span><span style="color:rgb(185,204,197)">'Hello World</span><span style="color:rgb(185,204,197)">\n</span><span style="color:rgb(185,204,197)">'</span><span style="color:rgb(255,255,255)">);</span>
<span style="color:rgb(255,255,255)">}</span><span style="color:rgb(255,255,255)">).</span><span>listen</span><span style="color:rgb(255,255,255)">(</span><span style="color:rgb(185,204,197)">14337</span><span style="color:rgb(255,255,255)">,</span> <span style="color:rgb(185,204,197)">"0.0.0.0"</span><span style="color:rgb(255,255,255)">);</span>
console<span style="color:rgb(255,255,255)">.</span><span>log</span><span style="color:rgb(255,255,255)">(</span><span style="color:rgb(185,204,197)">'Server running at <a href="http://0.0.0.0:14337/" target="_blank">http://0.0.0.0:14337/</a>'</span><span style="color:rgb(255,255,255)">);</span></pre>
</div><div><br></div><div>ЗапуÑк </div><div>node example.js</div><br><div class="gmail_quote">23 ноÑÐ±Ñ€Ñ 2011 г. 17:09 пользователь Alexey Shrub <span dir="ltr"><<a href="mailto:worldmind@mail.ru" target="_blank">worldmind@mail.ru</a>></span> напиÑал:<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Ср., 2011-11-23 at 16:53 +0400, Akzhan Abdulin wrote:<br>
> Ð’Ñ‹ попробуйте на Ñвоем железе ещё Node.JS 0.6 прогнать :)<br>
<br>
</div>ПрÑмо ÑÐµÐ¹Ñ‡Ð°Ñ Ð½ÐµÑ‚ времени разбиратьÑÑ, дадите инÑтрукцию - поÑтавь то-то,<br>
запуÑти Ñкрипт такой-то, тогда без проблем потеÑтирую<br>
<div><div><br>
--<br>
Moscow.pm mailing list<br>
<a href="mailto:moscow-pm@pm.org" target="_blank">moscow-pm@pm.org</a> | <a href="http://moscow.pm.org" target="_blank">http://moscow.pm.org</a><br>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>