<?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>Alessio Rocchi's Blog</title>
	<atom:link href="http://www.rocchi.us/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rocchi.us</link>
	<description>Just another geek's blog</description>
	<lastBuildDate>Sun, 05 Feb 2012 18:16:30 +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>Appunti Aapache2 mod_ssl Virtual Host e htaccess</title>
		<link>http://www.rocchi.us/2010/07/appunti-aapache2-mod_ssl-virtual-host-e-htaccess/</link>
		<comments>http://www.rocchi.us/2010/07/appunti-aapache2-mod_ssl-virtual-host-e-htaccess/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 08:24:57 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[Howto's and Tips]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_ssl]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[vhosts]]></category>
		<category><![CDATA[virtual hosts]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=207</guid>
		<description><![CDATA[Visto che a lavoro mi son trovato a dover scrivere 2 appunti su come ho configurato un server Apache, ho deciso di riportarlo anche sul mio blog, magari fa comodo a qualcuno Apache2 + mod_ssl + htaccess + virtual hosts Per aggiungere un nuovo virtual host basta fare i seguenti … <a href="http://www.rocchi.us/2010/07/appunti-aapache2-mod_ssl-virtual-host-e-htaccess/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>Visto che a lavoro mi son trovato a dover scrivere 2 appunti su come ho configurato un server Apache, ho deciso di riportarlo anche sul mio blog, magari fa comodo a qualcuno <img src='http://www.rocchi.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Apache2 + mod_ssl + htaccess + virtual hosts</strong></p>
<p>Per aggiungere un nuovo virtual host basta fare i seguenti passi:<br />
1 &#8211; Creare un file in /etc/apache2/site-available<br />
2 &#8211; Popolarlo con la configurazione corretta sia sulla porta 80 che sulla 443 se necessario SSL<br />
3 &#8211; Abilitarlo tramite il comando a2ensite [file di configurazione]<br />
4 &#8211; Fare il reload di Apache2:</p>
<pre class="brush:bash">/etc/init.d/apache2 reload</pre>
<p>Se non ci sono errori, il nuovo virtual host e` attivo.</p>
<p>Le configurazioni di Apache si trovano nella directory /etc/apache2, i virtual host creati risiedono in /etc/apache2/site-available e sono stati abilitati tramite in comando a2ensite</p>
<pre class="brush:bash">a2ensite wiki.trii.it</pre>
<p>Di conseguenza sono attivi in /etc/apache2/site-enabled</p>
<p>Utilizziamo un sistema di accessi tramite htaccess che risiede in /var/www/wiki.trii.it/.htaccess, mentre il file dell pwd sta in /var/www/.htpasswd<br />
Per aggiungere un utente basta utilizzare htpasswd nel seguente modo:</p>
<pre class="brush:bash">htpasswd /var/www/.htpasswd nuovoutente</pre>
<p>Verra` chiesta due volte la password ed il gioco e` fatto.</p>
<p>La configurazione e` di tipo SSL, di seguito riportata</p>
<p>#Questo primo blocco server per fare redirect da http ad https nel caso in cui si tenti di accedere al wiki via http</p>
<p>&lt;VirtualHost *:80&gt;<br />
ServerName wiki.trii.it<br />
RedirectMatch (.*)$ https://wiki.trii.it$1<br />
RedirectMatch /.* https://wiki.trii.it</p>
<p>&lt;/VirtualHost&gt;</p>
<p>#Questo e` il blocco principale della configurazione, ho lasciato il blocco dei cgi-bin anche se in realta` non li usiamo.<br />
&lt;VirtualHost *:443&gt;<br />
SSLEngine on<br />
SSLCertificateFile /etc/apache2/apache.pem<br />
ServerAdmin alessio.rocchi@trii.it<br />
ServerName wiki.trii.it<br />
ServerAlias wiki</p>
<p>DocumentRoot /var/www/wiki.trii.it</p>
<p>Options FollowSymLinks<br />
AllowOverride AuthConfig<br />
Order allow,deny<br />
allow from all</p>
<p>ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/</p>
<p>AllowOverride None<br />
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch<br />
Order allow,deny<br />
Allow from all</p>
<p>ErrorLog /var/log/apache2/error.log</p>
<p># Possible values include: debug, info, notice, warn, error, crit,</p>
<p># alert, emerg.<br />
LogLevel warn</p>
<p>CustomLog /var/log/apache2/access.log combined</p>
<p>&lt;/VirtualHost&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2010/07/appunti-aapache2-mod_ssl-virtual-host-e-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m your dream, make you real&#8230;</title>
		<link>http://www.rocchi.us/2010/06/im-your-dream-make-you-real/</link>
		<comments>http://www.rocchi.us/2010/06/im-your-dream-make-you-real/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 20:37:22 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[Non Categorized]]></category>
		<category><![CDATA[metallica]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=203</guid>
		<description><![CDATA[E` tutto il giorno che ascolto Sad but True dei Metallica&#8230; Mi sento in dovere di postare il video della canzone (ovviamente preso da YouTube). Eccolo: [youtube]http://www.youtube.com/watch?v=mJQudp8H8XQ[/youtube] Mi piace molto per il ritmo insistente, un po` anche per la rabbia che esprime&#8230;]]></description>
			<content:encoded><![CDATA[<p>E` tutto il giorno che ascolto Sad but True dei Metallica&#8230; Mi sento in dovere di postare il video della canzone (ovviamente preso da YouTube).</p>
<p>Eccolo:</p>
<p>[youtube]http://www.youtube.com/watch?v=mJQudp8H8XQ[/youtube]</p>
<p>Mi piace molto per il ritmo insistente, un po` anche per la rabbia che esprime&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2010/06/im-your-dream-make-you-real/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stargate The best space battles remake HD</title>
		<link>http://www.rocchi.us/2010/05/stargate-the-best-space-battles-remake-hd/</link>
		<comments>http://www.rocchi.us/2010/05/stargate-the-best-space-battles-remake-hd/#comments</comments>
		<pubDate>Sun, 30 May 2010 19:23:56 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[TV Series]]></category>
		<category><![CDATA[space battle]]></category>
		<category><![CDATA[Stargate Universe]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=200</guid>
		<description><![CDATA[Just wonderful! [youtube]http://www.youtube.com/watch?v=a6A-9fc8ucE[/youtube]]]></description>
			<content:encoded><![CDATA[<p>Just wonderful!</p>
<p>[youtube]http://www.youtube.com/watch?v=a6A-9fc8ucE[/youtube]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2010/05/stargate-the-best-space-battles-remake-hd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X-Chat Perl Reflex Script</title>
		<link>http://www.rocchi.us/2010/05/x-chat-perl-reflex-script/</link>
		<comments>http://www.rocchi.us/2010/05/x-chat-perl-reflex-script/#comments</comments>
		<pubDate>Tue, 11 May 2010 16:07:45 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[dcc]]></category>
		<category><![CDATA[dcc send]]></category>
		<category><![CDATA[reflex]]></category>
		<category><![CDATA[reflexer]]></category>
		<category><![CDATA[X-Chat]]></category>
		<category><![CDATA[xchat]]></category>
		<category><![CDATA[xchat plugin perl]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=193</guid>
		<description><![CDATA[Hi, this plugin allow your X-Chat client to reflex any DCC SEND like mIRC does. We have created this plugin, due to the high number of people that has requested us a plugin to reflex from X-Chat. Also, my friend Xardax has the idea to make a plugin for KvIRC … <a href="http://www.rocchi.us/2010/05/x-chat-perl-reflex-script/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>Hi, this plugin allow your X-Chat client to reflex any <em>DCC SEND</em> like mIRC does. We have created this plugin, due to the high number of people that has requested us a plugin to reflex from X-Chat.<br />
Also, my friend Xardax has the idea to make a plugin for KvIRC too, so be patient <img src='http://www.rocchi.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
If yuo have any doubts you can contact us on IRC: irc.darksin.ch :: #linux</p>
<pre class="syntax perl">
#!/usr/bin/perl

use warnings;
use strict;
use Xchat;

my $reflex_nick=&quot;&quot;;

Xchat::register(&quot;Reflexer&quot;,&quot;1.0&quot;,&quot;Reflexer Perl Script&quot;,&quot;&quot;);
Xchat::print (&quot;^BScript loaded.&quot;);
Xchat::print (&quot;^BPlugin for X-Chat by blackms &amp;amp; Xardax :: #linux \@irc.darksin.ch&quot;);
Xchat::print (&quot;^BUsage: /reflex REFLEX_NICK\n^BTo turn reflexing off: /rfx_off&quot;);

Xchat::hook_command('reflex',&quot;reflex&quot;);
Xchat::hook_command('rfx_off',sub {
                                Xchat::print (&quot;^BReflexing turned off.&quot;);
                                $reflex_nick=&quot;&quot;;
                              }
                   );
Xchat::hook_server(&quot;PRIVMSG&quot;,&quot;ctcpreflex&quot;);

sub reflex {
        $reflex_nick = defined $_[0][1] ? $_[0][1] : &quot;&quot;;
        Xchat::print(&quot;^BReflexing all DCC SEND to: $reflex_nick&quot;);
        return Xchat::EAT_ALL;
}

sub ctcpreflex {
        return Xchat::EAT_NONE if ($reflex_nick eq &quot;&quot;);
        my $data=$_[1][0];
        if ($data =~ m{\001DCC\sSEND\s(.*)\s(\d+)\s(\d+)\s(\d+)\001}) {
                my ($file,$intip,$port,$length) = ($1,$2,$3,$4);
                Xchat::print (&quot;^BReflexing: $file to $reflex_nick on port: $port, length: $length&quot;);
                Xchat::command (&quot;PRIVMSG $reflex_nick :\001DCC SEND $file $intip $port $length\001\n\r&quot;);
                return Xchat::EAT_ALL;
        }
        return Xchat::EAT_NONE;
}
</pre>
<p>Bye <img src='http://www.rocchi.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2010/05/x-chat-perl-reflex-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Perl script to stress apache</title>
		<link>http://www.rocchi.us/2010/04/simple-perl-script-to-stress-apache/</link>
		<comments>http://www.rocchi.us/2010/04/simple-perl-script-to-stress-apache/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 04:23:23 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[stress]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=183</guid>
		<description><![CDATA[I&#8217;ve made this to stress this blog a little, and see how many requests could it handle. #!/usr/bin/perl use strict; use LWP::Simple; use LWP::UserAgent; use Parallel::ForkManager; my $pm = new Parallel::ForkManager(3); for (1 .. 10_000) { my $pid = $pm-&#62;start and next; my $ua = new LWP::UserAgent; print &#34;Request $_\n&#34;; … <a href="http://www.rocchi.us/2010/04/simple-perl-script-to-stress-apache/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made this to stress this blog a little, and see how many requests could it handle.</p>
<pre class="syntax {perl}">
#!/usr/bin/perl

use strict;
use LWP::Simple;
use LWP::UserAgent;
use Parallel::ForkManager;

my $pm = new Parallel::ForkManager(3);

for (1 .. 10_000) {
	my $pid = $pm-&gt;start and next;
	my $ua = new LWP::UserAgent;
	print &quot;Request $_\n&quot;;
	$ua-&gt;timeout(120);
	my $url='http://www.rocchi.us/';
	my $request = new HTTP::Request('GET', $url);
	my $response = $ua-&gt;request($request);
	my $content = $response-&gt;content();
	#print $content;
	$pm-&gt;finish;
}
</pre>
<p>Bye</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2010/04/simple-perl-script-to-stress-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

