<?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>ItOpen - Open Web Solutions, WebGis Development &#187; Sysadmin</title>
	<atom:link href="http://www.itopen.it/category/linux/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.itopen.it</link>
	<description>[lang_en]Open Web Solutions: WebGis, Open Source development[/lang_en][lang_it]Soluzioni WebGIS e sviluppo software Open Source[lang_it]</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:19:19 +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>Serving your map tiles 30 times faster</title>
		<link>http://www.itopen.it/2012/01/17/serving-your-map-tiles-30-times-faster/</link>
		<comments>http://www.itopen.it/2012/01/17/serving-your-map-tiles-30-times-faster/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 18:03:45 +0000</pubDate>
		<dc:creator>Alessandro Pasotti</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[GIS]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[WebGis]]></category>

		<guid isPermaLink="false">http://www.itopen.it/?p=716</guid>
		<description><![CDATA[Recently I&#8217;ve been experimenting with TileStache tiles caching system, which is similar to TileCache and other tile caching systems in scope. TileStache revealed itself as a powerful and flexible product and was very good to cache tiles generated with my Django-backed mapscript-powered WMS server. Caching and serving tiles with TileStache was by far faster then [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been experimenting with <a href="http://tilestache.org">TileStache</a> tiles caching system, which is similar to TileCache and other tile caching systems in scope.</p>
<p>TileStache revealed itself as a powerful and flexible product and was very good to cache tiles generated with my Django-backed mapscript-powered WMS server. Caching and serving tiles with TileStache was by far faster then running the whole mapscript WMS machinery.</p>
<p>But I wanted to do more: if I could just convince nginx to serve the tiles directly from disk, this would have been even faster. Of course for this to work, TileStache must be configured to cache tiles on disk, which is what you normally want.</p>
<p>nginx is really good at serving static files and it is luckily wery flexible and easy to configure (once you know what to do).</p>
<p>The following configuration uses named regular expression captures and a <strong>try_files</strong> instruction to check for the tile existance, if found, the tile is served directly, if not found the internal redirect to the @django named location takes place.<br />
The 404 trick in the base location (/) was necessary to avoid duplication of the @django location content, but there might be a better way.</p>
<h2>nginx configuration file</h2>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">server <span style="color: #009900;">&#123;</span>
    listen   <span style="color: #CC0000;">88</span> <span style="color: #003366; font-weight: bold;">default</span><span style="color: #339933;">;</span>
    server_name  localhost<span style="color: #339933;">;</span>
    access_log  <span style="color: #339933;">/</span><span style="color: #003366; font-weight: bold;">var</span><span style="color: #339933;">/</span>log<span style="color: #339933;">/</span>nginx<span style="color: #339933;">/</span>access.<span style="color: #660066;">log</span><span style="color: #339933;">;</span>
    rewrite  <span style="color: #3366CC;">&quot;^/[a-z]{2}/(static|media)/(.*)$&quot;</span>  <span style="color: #009966; font-style: italic;">/$1/</span>$2<span style="color: #339933;">;</span>
    root <span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>django_app<span style="color: #339933;">/;</span>
&nbsp;
    location  <span style="color: #009966; font-style: italic;">/media/</span> <span style="color: #009900;">&#123;</span>
        alias <span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>django<span style="color: #339933;">/</span>contrib<span style="color: #339933;">/</span>admin<span style="color: #339933;">/</span>media<span style="color: #339933;">/;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location  <span style="color: #009966; font-style: italic;">/static/</span> <span style="color: #009900;">&#123;</span>
        alias <span style="color: #339933;">/</span>www<span style="color: #339933;">/</span>django_app<span style="color: #339933;">/</span>site_media<span style="color: #339933;">/;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location ~ <span style="color: #339933;">^/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">?&lt;</span>lang_code<span style="color: #339933;">&gt;</span>..<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>resource<span style="color: #339933;">/</span>tiles<span style="color: #339933;">/</span><span style="color: #CC0000;">1</span>\.0\.0<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">?&lt;</span>tile_path<span style="color: #339933;">&gt;</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>$ <span style="color: #009900;">&#123;</span>
        alias <span style="color: #339933;">/</span>tmp<span style="color: #339933;">/</span>stache<span style="color: #339933;">/;</span>
        add_header X<span style="color: #339933;">-</span>Static <span style="color: #003366; font-weight: bold;">super</span><span style="color: #339933;">;</span>
        try_files $http_host<span style="color: #339933;">/</span>$lang_code<span style="color: #339933;">/</span>$tile_path <span style="color: #339933;">@</span>django<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location <span style="color: #339933;">/</span> <span style="color: #009900;">&#123;</span>
        add_header X<span style="color: #339933;">-</span>Static hit<span style="color: #339933;">;</span>
        error_page <span style="color: #CC0000;">404</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span>django<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">404</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    location <span style="color: #339933;">@</span>django <span style="color: #009900;">&#123;</span>
        add_header X<span style="color: #339933;">-</span>Static miss<span style="color: #339933;">;</span>
        proxy_pass http<span style="color: #339933;">:</span><span style="color: #006600; font-style: italic;">//127.0.0.1:8000;</span>
        proxy_set_header Host $http_host<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Results</h2>
<p>niginx is listening on port 88 and the dev server (I&#8217;m using werkzeug in this case) is listening on port 8080.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ab <span style="color: #660033;">-c</span> <span style="color: #000000;">100</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1000</span> http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">88</span><span style="color: #000000; font-weight: bold;">/</span>it<span style="color: #000000; font-weight: bold;">/</span>resource<span style="color: #000000; font-weight: bold;">/</span>tiles<span style="color: #000000; font-weight: bold;">/</span>1.0.0<span style="color: #000000; font-weight: bold;">/</span>track_4<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span>.png
&nbsp;
Concurrency Level:      <span style="color: #000000;">100</span>
Time taken <span style="color: #000000; font-weight: bold;">for</span> tests:   <span style="color: #000000;">0.084</span> seconds
Complete requests:      <span style="color: #000000;">1000</span>
Failed requests:        <span style="color: #000000;">0</span>
Write errors:           <span style="color: #000000;">0</span>
Total transferred:      <span style="color: #000000;">7553744</span> bytes
HTML transferred:       <span style="color: #000000;">7302912</span> bytes
Requests per second:    <span style="color: #000000;">11902.92</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #666666; font-style: italic;">#/sec] (mean)</span>
Time per request:       <span style="color: #000000;">8.401</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Time per request:       <span style="color: #000000;">0.084</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean, across all concurrent requests<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Transfer rate:          <span style="color: #000000;">87804.31</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Kbytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#93;</span> received</pre></div></div>

<p>With TileStache only:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ab <span style="color: #660033;">-c</span> <span style="color: #000000;">100</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1000</span> http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">8000</span><span style="color: #000000; font-weight: bold;">/</span>track_4<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span>.png
&nbsp;
Concurrency Level:      <span style="color: #000000;">100</span>
Time taken <span style="color: #000000; font-weight: bold;">for</span> tests:   <span style="color: #000000;">2.944</span> seconds
Complete requests:      <span style="color: #000000;">1000</span>
Failed requests:        <span style="color: #000000;">0</span>
Write errors:           <span style="color: #000000;">0</span>
Non-2xx responses:      <span style="color: #000000;">1000</span>
Total transferred:      <span style="color: #000000;">145000</span> bytes
HTML transferred:       <span style="color: #000000;">0</span> bytes
Requests per second:    <span style="color: #000000;">339.63</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #666666; font-style: italic;">#/sec] (mean)</span>
Time per request:       <span style="color: #000000;">294.438</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Time per request:       <span style="color: #000000;">2.944</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean, across all concurrent requests<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Transfer rate:          <span style="color: #000000;">48.09</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Kbytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#93;</span> received</pre></div></div>

<h2>Conclusions</h2>
<p>Unsurprisingly, the solution with files served directly is several times faster: 35 in this test case.</p>
<p>In a production environment, using <strong>mod_wsgi</strong> or <strong>uwsgi</strong>, the fugures may vary, but I&#8217;m confident that the overall speed boost is guaranteed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itopen.it/2012/01/17/serving-your-map-tiles-30-times-faster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH tunnel for postgresql</title>
		<link>http://www.itopen.it/2008/07/30/un-tunnel-ssh-per-postgresql/</link>
		<comments>http://www.itopen.it/2008/07/30/un-tunnel-ssh-per-postgresql/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 15:36:01 +0000</pubDate>
		<dc:creator>Alessandro Pasotti</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://www.itopen.it/?p=189</guid>
		<description><![CDATA[Nothing new under the sun, but this is how I use it, and I&#8217;m reporting it here since I&#8217;ve found some misleading indications out on the net. Remote machine is 192.168.1.2 with SSH running on non-standard port 12345 ssh -p12345 -L 3333:localhost:5432 root@192.168.1.2 After this, you can connect to port 3333 on localhost to access [...]]]></description>
			<content:encoded><![CDATA[<p>Nothing new under the sun, but this is how I use it, and I&#8217;m reporting it here since I&#8217;ve found some misleading indications out on the net.</p>
<p>Remote machine is 192.168.1.2 with SSH running on non-standard port 12345</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-p12345</span> <span style="color: #660033;">-L</span> <span style="color: #000000;">3333</span>:localhost:<span style="color: #000000;">5432</span> root<span style="color: #000000; font-weight: bold;">@</span>192.168.1.2</pre></div></div>

<p>After this, you can connect to port 3333 on localhost to access remote postgresql DB server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itopen.it/2008/07/30/un-tunnel-ssh-per-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filtering spambots with Apache mod_rewrite</title>
		<link>http://www.itopen.it/2006/06/07/difendere-apache-dagli-spambot-con-mod_rewrite/</link>
		<comments>http://www.itopen.it/2006/06/07/difendere-apache-dagli-spambot-con-mod_rewrite/#comments</comments>
		<pubDate>Wed, 07 Jun 2006 16:08:45 +0000</pubDate>
		<dc:creator>Alessandro Pasotti</dc:creator>
				<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://www.itopen.it/?p=62</guid>
		<description><![CDATA[How to seal Apache and leave out spammers]]></description>
			<content:encoded><![CDATA[<h2>A huge problem</h2>
<p>If you are a webmaster or at least own a website, you probably know that badwidth is very expensive, but what is even more expensive is the waste of time associated with filtering spam out of our mailboxes.
</p>
<p>Well, one of the preferred methods spammers have to collect email addresses is to use custom softwares called spambots to download <b>all</b> the content of websites and scan them in search of strings of characters that resemble email addresses.
</p>
<p>Doing this nasty thing, they obviously consume our bandwidth subtracting net resources from honest users.</p>
<h2>A working approach</h2>
<p>If you are so lucky to have the first class webserver Apache, you can use its mod_rewrite module to try to distinguish spammers from regular users.
</p>
<p>This method is based on the identification strings all web clients (aka browsers) send to the server when they initiate a connection. This strings usually contain informations about the browser producer and version, spambots have usually particular identification strings that can be used to identify them and leave them out of our site.</p>
<p>Of course we cannot avoid false negatives, in case the spambots use the same identification string of regular browsers.</p>
<h2>Mod_rewrite: the URL swissknife</h2>
</p>
<p>In order to use mod_rewrite we must use some configuration code in the .htaccess file (given that the module has been enabled globally by the system administrator).</p>
<p>An example configuration:</p>
<p><code lang="bash"><br />
# attiva il motore<br />
RewriteEngine On</p>
<p>RewriteCond %{HTTP_USER_AGENT}   Extractor    [OR]<br />
RewriteCond %{HTTP_USER_AGENT}  ^EmailSiphon       [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf       [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro     [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*NEWT   [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^Crescent         [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^CherryPicker    [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit  [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^NICErsPRO        [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^Telesoft         [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster    [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^Microsoft.URL    [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/3.Mozilla/2.01 [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector<br />
RewriteRule .*                   nospam.html                         [L]<br />
</code></p>
<p>The last line instructs Apache to send the special page <i>nospam.html</i> to all visitors whose user agent&#8217;s (aka browser) identification string matches one of the regular expressions listed above.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itopen.it/2006/06/07/difendere-apache-dagli-spambot-con-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressioni su Virtuo Virtual Private Server</title>
		<link>http://www.itopen.it/2006/05/13/impressioni-su-virtuo-virtual-private-server/</link>
		<comments>http://www.itopen.it/2006/05/13/impressioni-su-virtuo-virtual-private-server/#comments</comments>
		<pubDate>Sat, 13 May 2006 21:21:11 +0000</pubDate>
		<dc:creator>Alessandro Pasotti</dc:creator>
				<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://www.itopen.it/?p=45</guid>
		<description><![CDATA[Più spendi meno spendi? Alcune prime (pessime) impressioni sul servizio di hosting Virtuo]]></description>
			<content:encoded><![CDATA[<p>Un mio cliente ha recentemente acquistato dello spazio su un server <a href="http://www.ngi.it/virtuo/">Virtuo di NGI </a>, si tratta di una linea di prodotti basati sulla virtualizzazione di Linux. Dal punto di vista hardware, l&#8217;azienda dichiara di utilizzare delle blade biprocessore con Xeon 3GHz, il sistema di storage utilizza un SAN collegato in fibra.</p>
<p>A seconda della configurazione i prezzi possono cambiare anche parecchio, il mio cliente ha scelto la configurazione &#8220;basic&#8221; che prevede una non meglio specificata priorità 5 nell&#8217;uso di RAM e CPU.</p>
<p>Confesso che ero sinceramente interessato a provare Virtuo, tanto da aver più volte meditato se acquistarne uno io stesso, ma purtropo dopo poco più di dieci minuti sul server, mi sono reso conto dello scampato pericolo.</p>
<h2>Chi va piano&#8230;</h2>
<p>L&#8217;antico motto non si applica purtroppo anche alla new economy, semmai è stato sostituito dall&#8217;adrenalinico <em>Smaller Faster Cheaper Better</em>, purtroppo il Virtuo si è subito rivelato più lento di una qualsiasi ADSL alice, mi sembrava di essere tornato ai tempi dei modem a 56K.</p>
<h2>Leggendo qui e là</h2>
<p>Mi sono accorto che la mia opinione su Virtuo è piuttosto condivisa: <a href="http://www.giorgiotave.it/forum/viewtopic.php?t=4502"> Il Mega Flop di NGI VIRTUO Virtual Server</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itopen.it/2006/05/13/impressioni-su-virtuo-virtual-private-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP5 come CGI</title>
		<link>http://www.itopen.it/2005/08/15/php5-come-cgi/</link>
		<comments>http://www.itopen.it/2005/08/15/php5-come-cgi/#comments</comments>
		<pubDate>Mon, 15 Aug 2005 17:49:23 +0000</pubDate>
		<dc:creator>Alessandro Pasotti</dc:creator>
				<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://www.itopen.it/2005/08/15/php5-come-cgi/</guid>
		<description><![CDATA[La stringa di configurazione per permettere a PHP5 di essere correttamente eseguito come CGI.]]></description>
			<content:encoded><![CDATA[<p>In teoria basterebbe un <code>./configure</code>, ma per compilare PHP5 in modo che possa selettivamente essere eseguito sia come modulo apache sia come CGI (a seconda per esempio dell&#8217;estensione degli script) occorrono alcuni accorgimenti:</p>
<p><code lang="bash"><br />
./configure --with-interbase --with-mysql=/usr --with-ming=/usr --with-png-dir \<br />
--with-jpeg-dir=/usr/local/src/jpeg-6b --with-zlib-dir --with-gd \<br />
--with-flatfile \<br />
--enable-exif --with-ttf --with-freetype-dir=/usr/include/freetype2 \<br />
--with-t1lib --enable-gd-native-ttf --enable-debugger \<br />
--enable-mbstr-enc-trans --with-iconv --with-pgsql --enable-dbase \<br />
--enable-force-cgi-redirect<br />
make clean<br />
make install<br />
service httpd stop<br />
service httpd start<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itopen.it/2005/08/15/php5-come-cgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Un desktop virtuale con VNC</title>
		<link>http://www.itopen.it/2005/08/12/un-desktop-virtuale-con-vnc-2/</link>
		<comments>http://www.itopen.it/2005/08/12/un-desktop-virtuale-con-vnc-2/#comments</comments>
		<pubDate>Fri, 12 Aug 2005 12:10:35 +0000</pubDate>
		<dc:creator>Daniele Antoniazzi</dc:creator>
				<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://192.168.99.100/~ale/wordpress/2005/08/12/un-desktop-virtuale-con-vnc-2/</guid>
		<description><![CDATA[<acronym title="Virtual Network Computing">VNC</acronym> é un acronimo per <strong>V</strong>irtual <strong>N</strong>etwork
<strong>C</strong>omputing.
E` un sistema client/server che mette a disposizione di un utente un desktop.
Questo desktop può essere acceduto da altri computer in rete
e può anche essere condiviso.
Con VNC puoi lavorare su un computer senza esserci per forza
seduto davanti.]]></description>
			<content:encoded><![CDATA[<h1>Un esempio d&#8217;uso</h1>
<p>
Vuoi scaricare dalla rete parecchi dati, magari stai scaricando le ISO della tua distribuzione Linux preferita. Questa operazione durerà diverse ore. Per scaricare i dati stai usando, diciamo, Firefox.<br />
Hai un portatile ed é in rete con altri computer. Puoi usare i computer della rete per fare il download.
</p>
<p>
Ti connetti su un computer della rete (usando magari ssh) e lanci<br />
il server di VNC <strong>vncserver</strong>.<br />
Questo farà partire un desktop su quella macchina. Dopodiché fai partire il visualizzatore di VNC <strong>vncviewer</strong> sul tuo portatile, specificando il server VNC a cui ti vuoi connettere (in questo caso quello che hai appena fatto partire). A questo punto sei connesso al desktop remoto e potrai lanciare Firefox e tutte le applicazioni che vorrai. Potrai chiudere il vncviewer ed andartene.<br />
La prossima volta che ti riconnetterai col vncviewer a quel server VNC ritroverai il desktop come l&#8217;avevi lasciato l&#8217;ultima volta ammesso che il server VNC non sia stato terminato nel frattempo <img src='http://www.itopen.it/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p><img src='http://www.itopen.it/wp-content/vnc.jpg' alt='VNC in XFCE' /></p>
<p><span style="font-style: italic;">Esempio di sessione GNOME con un vncviewer che mostra un desktop XFCE in cui si vede il browser Firefox&nbsp; &#8211; beh, detta così sembra le scatole cinesi <img src='http://www.itopen.it/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </span></p>
<h1>Come fare nel dettaglio</h1>
<h2>Inizializzazione del server VNC</h2>
<p>Supponiamo che l&#8217;utente che utilizzi per tutto l&#8217;esperimento sia <strong>dan</strong> e che il computer su cui farai partire il server si chiami <strong>mela</strong>. Il desktop che farai partire con vncserver apparterrà quindi all&#8217;utente dan.<br />
<br />
Ecco l&#8217;esempio della sessione:<br />
<code lang="bash"><br />
dan@uva > ssh dan@mela<br />
dan@mela password:<br />
dan@mela > vncserver<br />
You will require a password to access your desktops.<br />
Password: *****<br />
Verify: *****<br />
New 'mela:1 (dan)' desktop is mela:1<br />
Creating default startup script /home/dan/.vnc/xstartup<br />
Starting applications specified in /home/dan/.vnc/xstartup<br />
Log file is /home/dan/.vnc/mela:1.log<br />
</code><br />
Analizziamo cosa é successo:</p>
<ul>
<li>Ti sei connesso su mela con <strong>ssh</strong>.</li>
<li>Hai lanciato <strong>vncserver</strong>, il quale ti ha chiesto una password. Questa password ti verrà chiesta ogni volta che ti connetterai al server.</li>
<li>vncserver ti ha detto che <strong>mela:1</strong> sarà il desktop (o <strong>display</strong>) a cui potrai contattarlo col client.</li>
<li>vncserver ha creato, essendo la prima volta che lo lanci, una directory <strong>/home/dan/.vnc</strong> e dentro ci ha messo alcuni file di utilità:
<ul>
<li><strong>mela:1.log</strong>: il log del server. Se per qualche motivo non dovesse partire il server, in questo file é scritto il perché.<br />Questo file viene ricreato ad ogni lancio del server.    </li>
<li><strong>mela:1.pid</strong>: con l&#8217;ID del processo del server.<br />Questo file viene ricreato ad ogni lancio del server.
    </li>
<li><strong>passwd</strong>: con la password (cifrata) che hai fornito.</li>
<li><strong>xstartup</strong>: lo script di inizializzazione con cui viene lanciato il server VNC.<br />Il server VNC é a tutti gli effetti un server X, ed é in grado di far partire qualsiasi ambiente grafico desideri.<br />Di default parte con uno scarno <strong>twm</strong>. Se sostituisci l&#8217;ultima linea del file e ci metti <strong>startxfce4</strong> invece di twm (non togliere il        carattere <strong>&amp;</strong> mi raccomando!) avrai qualcosa  di più evoluto. </li>
</ul>
</li>
</ul>
<p>A questo punto puoi passare ad usare il client.</p>
<h2>Uso del client VNC</h2>
<p>A questo punto su <strong>mela</strong> sta girando un ncserver.<br />
Fai partire il client vnc. Se vuoi lanciarlo a linea di comando é molto semplice, il comando si chiama:<br />
<code>vncviewer</code><br />
Ti chiederà il <strong>VNC server</strong> (nel caso dell&#8217;esempio<br />
<strong>mela:1</strong>) e <strong>Password</strong>, quella che hai fornito la prima volta che hai fatto partire il server.</p>
<h2>Chiusura di una sessione di lavoro</h2>
<p>Se vuoi sospendere la sessione, per poi riprenderla successivamente, ripartendo da dove eri arrivato l&#8217;ultima volta a lavorare sul desktop,<br />
é sufficiente che tu chiuda l&#8217;applicazione vncviewer.</p>
<p>
Se vuoi terminare definitivamente la sessione, terminando anche il server VNC, devi usare il comando <strong>vncserver</strong> con l&#8217;opzione <strong>-kill</strong> sulla macchina su cui hai fatto partire il server VNC.<br />
Quindi:
</p>
<p>
<code>dan@uva &gt; ssh dan@mela<br />dan@mela's password: <br />dan@mela &gt; vncserver -kill :1<br />Killing Xvnc process ID 4838<br /></code>
</p>
<p>
<strong>NOTA:</strong> se usi il bottone di <strong>Logout</strong> del desktop remoto il server VNC finirà in uno stato indeterminato e dovrai uccidere il server con <strong>vncserver -kill :1</strong>.
</p>
<h1>Uso avanzato del server VNC</h1>
<h2>Cambiare la password del server VNC</h2>
<p>Per cambiare la password del server devi connetterti sulla macchina su cui gira il server e lanciare il comando </p>
<p><strong>vncpasswd</strong>:<br />
<code>dan@uva &gt; ssh dan@mela<br />dan@mela's password: <br />dan@mela &gt; vncpasswd<br />Password:<br />Verify:<br /></code><br />
<strong>NOTA:</strong> Questo comando non chiede la vecchia password, si fida del fatto che sei l&#8217;utente dan (sei stato autenticato dal sistema al login).</p>
<h2>Server VNC multipli</h2>
<p>Se vuoi puoi far partire diversi server sulla stessa macchina, magari con utenti diversi. VNC é in grado di gestire questa situazione assegnando ad ogni server un display diverso: mela:1 mela:2 e così via&#8230;</p>
<p>Puoi anche decidere di far partire un server sul display che decidi tu,<br />
per esempio il 20: </p>
<p><code>dan@uva &gt; ssh dan@mela<br />dan@mela's password: <br />dan@mela &gt; vncserver :20<br /></code></p>
<h2>Dimensione del desktop per il Server VNC</h2>
<p>Se hai un monitor piccolo, quando usi il vncviewer può essere antipatico avere un server con un desktop troppo grosso: continueresti ad usare le barre di scorrimento per accedere a tutta l&#8217;area visibile. In questo caso puoi far partire il server con le dimensioni del desktop che preferisci, nell&#8217;esempio <strong>800&#215;600</strong>:</p>
<p><code>dan@uva &gt; ssh dan@mela<br />dan@mela's password: <br />dan@mela &gt; vncserver -geometry 800x600<br /></code><br />
In questo caso vedrai che la finestra del vncviewer sarà ridotta rispetto al default.</p>
<h2>Condivisione del desktop per il Server VNC</h2>
<p>Questa funzionalità é sicuramente una tra le più impressionanti,<br />
consente a più utenti simultaneamente di accedere allo stesso desktop.<br />
Quello che fai tu da un client lo vedono tutti dagli altri client.<br />
Questo tipo di modalità é particolarmente utile per mostrare applicativi al lavoro a più persone contemporaneamente.<br />
Tutte le persone sui client possono fare tutto e il primo che muove il<br />
mouse prende &quot;il controllo&quot;.<br />
<br />
Ci vuole armonia <img src='http://www.itopen.it/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<br />
Ecco come lanciare il server:</p>
<p><code>dan@uva &gt; ssh dan@mela<br />dan@mela's password: <br />dan@mela &gt; vncserver -alwaysshared<br /></code><br />
<strong>NOTA:</strong> Uno scenario tipico per questa modalità<br />
é quello in cui alcuni client accedono al server attraverso internet.<br />
Bisogna considerare i seguenti problemi di sicurezza:</p>
<ul>
<li>la password con la quale ci si connette al server VNC viaggia in chiaro</li>
<li>il protocollo usato da VNC per la comunicazione client/server non è cifrato ma in chiaro.</li>
</ul>
<p>Queste problematiche di sicurezza possono essere risolte usando<br />
<strong>ssh</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itopen.it/2005/08/12/un-desktop-virtuale-con-vnc-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

