<?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>P0L0&#039;s Blog &#187; GNU/Linux</title>
	<atom:link href="http://p0l0.binware.org/index.php/category/gnulinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://p0l0.binware.org</link>
	<description>Opensource Projects and IT experiences</description>
	<lastBuildDate>Tue, 25 May 2010 06:24:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Spidermonkey &#8211; Execute javascript from console</title>
		<link>http://p0l0.binware.org/index.php/2010/05/24/spidermonkey-execute-javascript-from-console/</link>
		<comments>http://p0l0.binware.org/index.php/2010/05/24/spidermonkey-execute-javascript-from-console/#comments</comments>
		<pubDate>Mon, 24 May 2010 06:09:26 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=693</guid>
		<description><![CDATA[SpiderMonkey is the code-name for the Mozilla's C implementation of JavaScript. This is useful to test part of our JavaScript from the console or in scripts.
In Debian we have a package called spidermonkey-bin.

apt-get install spidermonkey-bin

After installing you will have a program called smjs.
If you start the program without parameters you will get a Javascript shell, [...]]]></description>
			<content:encoded><![CDATA[<p>SpiderMonkey is the code-name for the Mozilla's C implementation of JavaScript. This is useful to test part of our JavaScript from the console or in scripts.</p>
<p>In Debian we have a package called <strong>spidermonkey-bin</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> spidermonkey-bin</pre></div></div>

<p>After installing you will have a program called <strong>smjs</strong>.</p>
<p>If you start the program without parameters you will get a <strong>Javascript shell</strong>, in which you can write and test javascript.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>smjs
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
print<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'test'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">test</span>
<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    print<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;test&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">test</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
print<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'test'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
test2<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">123</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">function</span> test2<span style="color: #7a0874; font-weight: bold;">&#40;</span>param<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
print <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'test2: '</span> + param<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #7a0874; font-weight: bold;">test</span>
test2: <span style="color: #000000;">123</span>
js<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>To exit the shell, just press "<strong>Ctrl+D</strong>".</p>
<p>It's important to note that in spidermonkey you doesn't have the "<strong>document</strong>" Object. If you want to print out text, you cant use <strong>document.write</strong>, you should use <strong>print</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// In browser</span>
<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//spidermonkey</span></pre></div></div>

<p>You can also make <strong>smjs</strong> to execute the content of a file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>smjs test-local.js
Rand: <span style="color: #000000;">407</span>
Old: <span style="color: #000000;">600</span>
New: <span style="color: #000000;">800</span>
Result: old</pre></div></div>




Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F24%2Fspidermonkey-execute-javascript-from-console%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F24%2Fspidermonkey-execute-javascript-from-console%2F&amp;title=Spidermonkey%20-%20Execute%20javascript%20from%20console&amp;bodytext=SpiderMonkey%20is%20the%20code-name%20for%20the%20Mozilla%27s%20C%20implementation%20of%20JavaScript.%20This%20is%20useful%20to%20test%20part%20of%20our%20JavaScript%20from%20the%20console%20or%20in%20scripts.%0D%0A%0D%0AIn%20Debian%20we%20have%20a%20package%20called%20spidermonkey-bin.%0D%0A%0D%0A%0D%0Aapt-get%20install%20spidermonkey-bi" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F24%2Fspidermonkey-execute-javascript-from-console%2F&amp;title=Spidermonkey%20-%20Execute%20javascript%20from%20console&amp;notes=SpiderMonkey%20is%20the%20code-name%20for%20the%20Mozilla%27s%20C%20implementation%20of%20JavaScript.%20This%20is%20useful%20to%20test%20part%20of%20our%20JavaScript%20from%20the%20console%20or%20in%20scripts.%0D%0A%0D%0AIn%20Debian%20we%20have%20a%20package%20called%20spidermonkey-bin.%0D%0A%0D%0A%0D%0Aapt-get%20install%20spidermonkey-bi" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F24%2Fspidermonkey-execute-javascript-from-console%2F&amp;t=Spidermonkey%20-%20Execute%20javascript%20from%20console" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F24%2Fspidermonkey-execute-javascript-from-console%2F&amp;title=Spidermonkey%20-%20Execute%20javascript%20from%20console&amp;annotation=SpiderMonkey%20is%20the%20code-name%20for%20the%20Mozilla%27s%20C%20implementation%20of%20JavaScript.%20This%20is%20useful%20to%20test%20part%20of%20our%20JavaScript%20from%20the%20console%20or%20in%20scripts.%0D%0A%0D%0AIn%20Debian%20we%20have%20a%20package%20called%20spidermonkey-bin.%0D%0A%0D%0A%0D%0Aapt-get%20install%20spidermonkey-bi" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Spidermonkey%20-%20Execute%20javascript%20from%20console&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F24%2Fspidermonkey-execute-javascript-from-console%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F24%2Fspidermonkey-execute-javascript-from-console%2F&amp;title=Spidermonkey%20-%20Execute%20javascript%20from%20console&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=SpiderMonkey%20is%20the%20code-name%20for%20the%20Mozilla%27s%20C%20implementation%20of%20JavaScript.%20This%20is%20useful%20to%20test%20part%20of%20our%20JavaScript%20from%20the%20console%20or%20in%20scripts.%0D%0A%0D%0AIn%20Debian%20we%20have%20a%20package%20called%20spidermonkey-bin.%0D%0A%0D%0A%0D%0Aapt-get%20install%20spidermonkey-bi" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F24%2Fspidermonkey-execute-javascript-from-console%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Spidermonkey%20-%20Execute%20javascript%20from%20console%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F24%2Fspidermonkey-execute-javascript-from-console%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2010/05/24/spidermonkey-execute-javascript-from-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing TRAC with mod_wsgi using virtualenv</title>
		<link>http://p0l0.binware.org/index.php/2010/05/10/installing-trac-with-mod_wsgi-using-virtualenv/</link>
		<comments>http://p0l0.binware.org/index.php/2010/05/10/installing-trac-with-mod_wsgi-using-virtualenv/#comments</comments>
		<pubDate>Mon, 10 May 2010 19:33:03 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_wsgi]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=664</guid>
		<description><![CDATA[This guide is for installing Trac  as a user using virtualenv for a isolated Python environment so that the whole installation runs under a specific user.
First of all we need to install needed packages

apt-get install libapache2-mod-wsgi python-virtualenv python-setuptools

Once we have installed the required packages proceed to create the Python environment

mkdir /usr/local/trac
cd /usr/local/trac
virtualenv python

We now [...]]]></description>
			<content:encoded><![CDATA[<p>This guide is for installing <a href="http://trac.edgewall.org/" target="_blank">Trac </a> as a user using <a href="http://pypi.python.org/pypi/virtualenv/1.4.8" target="_blank">virtualenv</a> for a isolated Python environment so that the whole installation runs under a specific user.</p>
<p>First of all we need to install needed packages</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libapache2-mod-wsgi python-virtualenv python-setuptools</pre></div></div>

<p>Once we have installed the required packages proceed to create the Python environment</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac
virtualenv python</pre></div></div>

<p>We now have the isolated Python environment locate under <strong>/usr/local/trac/python</strong>.</p>
<p>To make possible to use <strong>easy_install</strong> with repositories we need to upgrade easy_install. I use this to install Trac plugins directly from SVN.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install <span style="color: #660033;">-U</span> trunk</pre></div></div>

<p>We now can install trac 0.12 using the 0.12b1 SVN Tag (<strong>http://svn.edgewall.com/repos/trac/tags/trac-0.12b1</strong> or <strong>Trac==0.12b1</strong>) or directly from SVN Trunk:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install http:<span style="color: #000000; font-weight: bold;">//</span>svn.edgewall.org<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>trunk</pre></div></div>

<p>This will download and install the latest trunk version for Trac.</p>
<p>To have webaccess to the Trac projects, we need a <strong>.wsgi</strong> script, were we define where our local python environment is located:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># Not needed if mod_wsgi &gt;= 3.0</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span> = <span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Load Trac</span>
<span style="color: #ff7700;font-weight:bold;">import</span> trac.<span style="color: black;">web</span>.<span style="color: black;">main</span>
application = trac.<span style="color: black;">web</span>.<span style="color: black;">main</span>.<span style="color: black;">dispatch_request</span></pre></div></div>

<p>And finally we need to configure apache. If you want only one Trac project, you should define <strong>trac.env</strong> to the location of your trac, but if you want multiproject support, you must use <strong>trac.env_parent_dir</strong> (this is what I used)</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">virtualhost</span> *:<span style="color: #ff0000;">80</span>&gt;
    <span style="color: #00007f;">ServerName</span> trac.dns.com
&nbsp;
    <span style="color: #00007f;">DocumentRoot</span> /usr/local/trac/htdocs
    <span style="color: #00007f;">ErrorLog</span> /var/log/apache2/trac-error.log
    <span style="color: #00007f;">CustomLog</span> /var/log/apache2/trac-access.log combined
&nbsp;
    <span style="color: #adadad; font-style: italic;"># Trac Auth</span>
    &lt;<span style="color: #000000; font-weight:bold;">location</span> /&gt;
        <span style="color: #00007f;">AuthType</span> Basic
        <span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Trac&quot;</span>
        <span style="color: #00007f;">AuthUserFile</span> /usr/local/trac/.htpasswd
        <span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span>
    &lt; /location&gt;
&nbsp;
    <span style="color: #adadad; font-style: italic;">#Trac</span>
    <span style="color: #adadad; font-style: italic;">#Define ProcessGroup with user and group under which it should run</span>
    WSGIDaemonProcess trac <span style="color: #00007f;">user</span>=trac <span style="color: #00007f;">group</span>=trac python-path=/usr/local/trac/python/lib/python2.5/site-packages python-eggs=/usr/local/trac/python/cache
    WSGIScriptAlias / /usr/local/trac/htdocs/trac.wsgi
&nbsp;
    &lt;<span style="color: #000000; font-weight:bold;">directory</span> /usr/local/trac/htdocs&gt;
        WSGIProcessGroup trac
        WSGIApplicationGroup %{GLOBAL}
        <span style="color: #00007f;">SetEnv</span> trac.env_parent_dir /usr/local/trac/projects
    &lt;/<span style="color: #000000; font-weight:bold;">directory</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">virtualhost</span>&gt;</pre></div></div>

<p>We need to create the user and change the permissions for <strong>/usr/local/trac</strong> for that user <strong>trac</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #660033;">--home</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac <span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #660033;">--no-create-home</span> trac
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> trac:trac <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac</pre></div></div>

<p>If you get an error <strong>"ImportError: No module named simplejson"</strong> just install it using easy_install</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install simplejson</pre></div></div>




Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F10%2Finstalling-trac-with-mod_wsgi-using-virtualenv%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F10%2Finstalling-trac-with-mod_wsgi-using-virtualenv%2F&amp;title=Installing%20TRAC%20with%20mod_wsgi%20using%20virtualenv&amp;bodytext=This%20guide%20is%20for%20installing%20Trac%20%20as%20a%20user%20using%20virtualenv%20for%20a%20isolated%20Python%20environment%20so%20that%20the%20whole%20installation%20runs%20under%20a%20specific%20user.%0D%0A%0D%0AFirst%20of%20all%20we%20need%20to%20install%20needed%20packages%0D%0A%0D%0A%0D%0Aapt-get%20install%20libapache2-mod-wsgi%20pyt" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F10%2Finstalling-trac-with-mod_wsgi-using-virtualenv%2F&amp;title=Installing%20TRAC%20with%20mod_wsgi%20using%20virtualenv&amp;notes=This%20guide%20is%20for%20installing%20Trac%20%20as%20a%20user%20using%20virtualenv%20for%20a%20isolated%20Python%20environment%20so%20that%20the%20whole%20installation%20runs%20under%20a%20specific%20user.%0D%0A%0D%0AFirst%20of%20all%20we%20need%20to%20install%20needed%20packages%0D%0A%0D%0A%0D%0Aapt-get%20install%20libapache2-mod-wsgi%20pyt" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F10%2Finstalling-trac-with-mod_wsgi-using-virtualenv%2F&amp;t=Installing%20TRAC%20with%20mod_wsgi%20using%20virtualenv" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F10%2Finstalling-trac-with-mod_wsgi-using-virtualenv%2F&amp;title=Installing%20TRAC%20with%20mod_wsgi%20using%20virtualenv&amp;annotation=This%20guide%20is%20for%20installing%20Trac%20%20as%20a%20user%20using%20virtualenv%20for%20a%20isolated%20Python%20environment%20so%20that%20the%20whole%20installation%20runs%20under%20a%20specific%20user.%0D%0A%0D%0AFirst%20of%20all%20we%20need%20to%20install%20needed%20packages%0D%0A%0D%0A%0D%0Aapt-get%20install%20libapache2-mod-wsgi%20pyt" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Installing%20TRAC%20with%20mod_wsgi%20using%20virtualenv&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F10%2Finstalling-trac-with-mod_wsgi-using-virtualenv%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F10%2Finstalling-trac-with-mod_wsgi-using-virtualenv%2F&amp;title=Installing%20TRAC%20with%20mod_wsgi%20using%20virtualenv&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=This%20guide%20is%20for%20installing%20Trac%20%20as%20a%20user%20using%20virtualenv%20for%20a%20isolated%20Python%20environment%20so%20that%20the%20whole%20installation%20runs%20under%20a%20specific%20user.%0D%0A%0D%0AFirst%20of%20all%20we%20need%20to%20install%20needed%20packages%0D%0A%0D%0A%0D%0Aapt-get%20install%20libapache2-mod-wsgi%20pyt" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F10%2Finstalling-trac-with-mod_wsgi-using-virtualenv%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Installing%20TRAC%20with%20mod_wsgi%20using%20virtualenv%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2010%2F05%2F10%2Finstalling-trac-with-mod_wsgi-using-virtualenv%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2010/05/10/installing-trac-with-mod_wsgi-using-virtualenv/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vlogin &#8211; Roundcube Plugin</title>
		<link>http://p0l0.binware.org/index.php/2009/10/02/vlogin-roundcube-plugin/</link>
		<comments>http://p0l0.binware.org/index.php/2009/10/02/vlogin-roundcube-plugin/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 04:04:26 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[roundcube]]></category>
		<category><![CDATA[sourceforge]]></category>
		<category><![CDATA[webmail]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=427</guid>
		<description><![CDATA[I just released the first version of my Vlogin Plugin for Roundcube. This plugin is based on the Vlogin for Squirrelmail.
For now the only implemented function is that you can login using only "user" and roundcube will authenticate against IMAP using the domain extracted from the webmail URL.
You can get download the plugin from the [...]]]></description>
			<content:encoded><![CDATA[<p>I just released the first version of my Vlogin Plugin for Roundcube. This plugin is based on the <a href="http://www.squirrelmail.org/plugin_view.php?id=47" target="_blank">Vlogin </a>for Squirrelmail.</p>
<p>For now the only implemented function is that you can login using only "user" and roundcube will authenticate against IMAP using the domain extracted from the webmail URL.</p>
<p>You can get download the plugin from the <a href="http://sourceforge.net/projects/roundcubevlogin/" target="_blank">Vlogin sourceforge</a> project page.</p>



Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F10%2F02%2Fvlogin-roundcube-plugin%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F10%2F02%2Fvlogin-roundcube-plugin%2F&amp;title=Vlogin%20-%20Roundcube%20Plugin&amp;bodytext=I%20just%20released%20the%20first%20version%20of%20my%20Vlogin%20Plugin%20for%20Roundcube.%20This%20plugin%20is%20based%20on%20the%20Vlogin%20for%20Squirrelmail.%0D%0A%0D%0AFor%20now%20the%20only%20implemented%20function%20is%20that%20you%20can%20login%20using%20only%20%22user%22%20and%20roundcube%20will%20authenticate%20against%20IMAP%20us" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F10%2F02%2Fvlogin-roundcube-plugin%2F&amp;title=Vlogin%20-%20Roundcube%20Plugin&amp;notes=I%20just%20released%20the%20first%20version%20of%20my%20Vlogin%20Plugin%20for%20Roundcube.%20This%20plugin%20is%20based%20on%20the%20Vlogin%20for%20Squirrelmail.%0D%0A%0D%0AFor%20now%20the%20only%20implemented%20function%20is%20that%20you%20can%20login%20using%20only%20%22user%22%20and%20roundcube%20will%20authenticate%20against%20IMAP%20us" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F10%2F02%2Fvlogin-roundcube-plugin%2F&amp;t=Vlogin%20-%20Roundcube%20Plugin" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F10%2F02%2Fvlogin-roundcube-plugin%2F&amp;title=Vlogin%20-%20Roundcube%20Plugin&amp;annotation=I%20just%20released%20the%20first%20version%20of%20my%20Vlogin%20Plugin%20for%20Roundcube.%20This%20plugin%20is%20based%20on%20the%20Vlogin%20for%20Squirrelmail.%0D%0A%0D%0AFor%20now%20the%20only%20implemented%20function%20is%20that%20you%20can%20login%20using%20only%20%22user%22%20and%20roundcube%20will%20authenticate%20against%20IMAP%20us" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Vlogin%20-%20Roundcube%20Plugin&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F10%2F02%2Fvlogin-roundcube-plugin%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F10%2F02%2Fvlogin-roundcube-plugin%2F&amp;title=Vlogin%20-%20Roundcube%20Plugin&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=I%20just%20released%20the%20first%20version%20of%20my%20Vlogin%20Plugin%20for%20Roundcube.%20This%20plugin%20is%20based%20on%20the%20Vlogin%20for%20Squirrelmail.%0D%0A%0D%0AFor%20now%20the%20only%20implemented%20function%20is%20that%20you%20can%20login%20using%20only%20%22user%22%20and%20roundcube%20will%20authenticate%20against%20IMAP%20us" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F10%2F02%2Fvlogin-roundcube-plugin%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Vlogin%20-%20Roundcube%20Plugin%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F10%2F02%2Fvlogin-roundcube-plugin%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2009/10/02/vlogin-roundcube-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix+Amavisd-new+Spamassasin+Clamav</title>
		<link>http://p0l0.binware.org/index.php/2009/08/08/postfixamavisd-newspamassasinclamav/</link>
		<comments>http://p0l0.binware.org/index.php/2009/08/08/postfixamavisd-newspamassasinclamav/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 18:50:24 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[amavis]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[binware]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spamassasin]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=384</guid>
		<description><![CDATA[Since I had to disable the PTR check in Postfix at Binware because in Spain 90% of mail servers are badly configured and they were all rejected, and now we have lot of spam.
So I decided to install Spamassassin and Clamav to detect and reject some of this spam.
First of all, we need to install [...]]]></description>
			<content:encoded><![CDATA[<p>Since I had to disable the PTR check in Postfix at <a href="http://binware.org">Binware</a> because in Spain 90% of mail servers are badly configured and they were all rejected, and now we have lot of spam.</p>
<p>So I decided to install Spamassassin and Clamav to detect and reject some of this spam.</p>
<p>First of all, we need to install needed packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> spamassassin amavisd-new clamav clamav-daemon</pre></div></div>

<p>We will begin configuring amavisd-new, the configuration files are at <strong>/etc/amavis/conf.</strong></p>
<p>In file <strong>20-debian_default</strong>s I changed the header that will be added to each mail processed:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$X_HEADER_LINE</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;AntiSpam/Antivirus Scanner at $mydomain&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We need to activate antispam and antivirus check in amavis, this is found in file <strong>15-content_filter_mode</strong>. We need to uncomment @bypass_virus_checks_maps and @bypass_spam_checks_maps. The file will look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># You can modify this file to re-enable SPAM checking through spamassassin</span>
<span style="color: #666666; font-style: italic;"># and to re-enable antivirus checking.</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default antivirus checking mode</span>
<span style="color: #666666; font-style: italic;"># Please note, that anti-virus checking is DISABLED by</span>
<span style="color: #666666; font-style: italic;"># default.</span>
<span style="color: #666666; font-style: italic;"># If You wish to enable it, please uncomment the following lines:</span>
&nbsp;
&nbsp;
<span style="color: #0000ff;">@bypass_virus_checks_maps</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
   <span style="color: #0000ff;">\%bypass_virus_checks</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">\@bypass_virus_checks_acl</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">\$bypass_virus_checks_re</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default SPAM checking mode</span>
<span style="color: #666666; font-style: italic;"># Please note, that anti-spam checking is DISABLED by</span>
<span style="color: #666666; font-style: italic;"># default.</span>
<span style="color: #666666; font-style: italic;"># If You wish to enable it, please uncomment the following lines:</span>
&nbsp;
&nbsp;
<span style="color: #0000ff;">@bypass_spam_checks_maps</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
   <span style="color: #0000ff;">\%bypass_spam_checks</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">\@bypass_spam_checks_acl</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">\$bypass_spam_checks_re</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;"># ensure a defined return</span></pre></div></div>

<p>By default, amavis will use the hostname for <strong><em>$mydomain</em></strong>, but thats not what I want, so I edited file <strong>05-domain_id</strong>, setting <strong><em>$mydomain</em></strong> to <strong>binware.org</strong></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># $mydomain is used just for convenience in the config files and it is not</span>
<span style="color: #666666; font-style: italic;"># used internally by amavisd-new except in the default X_HEADER_LINE (which</span>
<span style="color: #666666; font-style: italic;"># Debian overrides by default anyway).</span>
&nbsp;
<span style="color: #0000ff;">$mydomain</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'binware.org'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># amavisd-new needs to know which email domains are to be considered local</span>
<span style="color: #666666; font-style: italic;"># to the administrative domain.  Only emails to &quot;local&quot; domains are subject</span>
<span style="color: #666666; font-style: italic;"># to certain functionality, such as the addition of spam tags.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default local domains to $mydomain and all subdomains.  Remember to</span>
<span style="color: #666666; font-style: italic;"># override or redefine this if $mydomain is changed later in the config</span>
<span style="color: #666666; font-style: italic;"># sequence.</span>
&nbsp;
<span style="color: #0000ff;">@local_domains_acl</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;.$mydomain&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;"># ensure a defined return</span></pre></div></div>

<p>Next step is to add the <strong>clamav</strong> user to the <strong>amavis</strong> group, so that amavis can call clamav</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser clamav amavis</pre></div></div>

<p>Now it's time to configure postfix. The first file to edit is <strong>main.cf</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="xorg_conf" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># Amavisd-new</span>
content_filter = amavis:<span class="br0">&#91;</span>127.0.0.1<span class="br0">&#93;</span>:<span style="color: #cc66cc;">10024</span></pre></div></div>

<p>And in <strong>master.conf</strong> add this at the end of file:</p>

<div class="wp_syntax"><div class="code"><pre class="xorg_conf" style="font-family:monospace;">amavis unix - - - - <span style="color: #cc66cc;">2</span> smtp
  -o smtp_data_done_timeout=<span style="color: #cc66cc;">1200</span>
  -o smtp_send_xforward_command=yes
&nbsp;
127.0.0.1:<span style="color: #cc66cc;">10025</span> inet n - - - - smtpd
  -o content_filter=
  -o local_recipient_maps=
  -o relay_recipient_maps=
  -o smtpd_restriction_classes=
  -o smtpd_client_restrictions=
  -o smtpd_helo_restrictions=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o mynetworks=127.0.0.0/<span style="color: #cc66cc;">8</span>
  -o strict_rfc821_envelopes=yes
  -o smtpd_bind_address=127.0.0.1</pre></div></div>

<p>That's all! Now restart services:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>clamav-daemon restart
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>clamav-freshclam restart
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>amavis restart
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>postfix restart</pre></div></div>




Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F08%2F08%2Fpostfixamavisd-newspamassasinclamav%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F08%2F08%2Fpostfixamavisd-newspamassasinclamav%2F&amp;title=Postfix%2BAmavisd-new%2BSpamassasin%2BClamav&amp;bodytext=Since%20I%20had%20to%20disable%20the%20PTR%20check%20in%20Postfix%20at%20Binware%20because%20in%20Spain%2090%25%20of%20mail%20servers%20are%20badly%20configured%20and%20they%20were%20all%20rejected%2C%20and%20now%20we%20have%20lot%20of%20spam.%0D%0A%0D%0ASo%20I%20decided%20to%20install%20Spamassassin%20and%20Clamav%20to%20detect%20and%20reject%20some" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F08%2F08%2Fpostfixamavisd-newspamassasinclamav%2F&amp;title=Postfix%2BAmavisd-new%2BSpamassasin%2BClamav&amp;notes=Since%20I%20had%20to%20disable%20the%20PTR%20check%20in%20Postfix%20at%20Binware%20because%20in%20Spain%2090%25%20of%20mail%20servers%20are%20badly%20configured%20and%20they%20were%20all%20rejected%2C%20and%20now%20we%20have%20lot%20of%20spam.%0D%0A%0D%0ASo%20I%20decided%20to%20install%20Spamassassin%20and%20Clamav%20to%20detect%20and%20reject%20some" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F08%2F08%2Fpostfixamavisd-newspamassasinclamav%2F&amp;t=Postfix%2BAmavisd-new%2BSpamassasin%2BClamav" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F08%2F08%2Fpostfixamavisd-newspamassasinclamav%2F&amp;title=Postfix%2BAmavisd-new%2BSpamassasin%2BClamav&amp;annotation=Since%20I%20had%20to%20disable%20the%20PTR%20check%20in%20Postfix%20at%20Binware%20because%20in%20Spain%2090%25%20of%20mail%20servers%20are%20badly%20configured%20and%20they%20were%20all%20rejected%2C%20and%20now%20we%20have%20lot%20of%20spam.%0D%0A%0D%0ASo%20I%20decided%20to%20install%20Spamassassin%20and%20Clamav%20to%20detect%20and%20reject%20some" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Postfix%2BAmavisd-new%2BSpamassasin%2BClamav&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F08%2F08%2Fpostfixamavisd-newspamassasinclamav%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F08%2F08%2Fpostfixamavisd-newspamassasinclamav%2F&amp;title=Postfix%2BAmavisd-new%2BSpamassasin%2BClamav&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=Since%20I%20had%20to%20disable%20the%20PTR%20check%20in%20Postfix%20at%20Binware%20because%20in%20Spain%2090%25%20of%20mail%20servers%20are%20badly%20configured%20and%20they%20were%20all%20rejected%2C%20and%20now%20we%20have%20lot%20of%20spam.%0D%0A%0D%0ASo%20I%20decided%20to%20install%20Spamassassin%20and%20Clamav%20to%20detect%20and%20reject%20some" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F08%2F08%2Fpostfixamavisd-newspamassasinclamav%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Postfix%2BAmavisd-new%2BSpamassasin%2BClamav%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2009%2F08%2F08%2Fpostfixamavisd-newspamassasinclamav%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2009/08/08/postfixamavisd-newspamassasinclamav/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AEAT+Firefox = &#8220;ha generado una firma no valida&#8221;</title>
		<link>http://p0l0.binware.org/index.php/2008/07/18/aeatfirefox-ha-generado-una-firma-no-valida/</link>
		<comments>http://p0l0.binware.org/index.php/2008/07/18/aeatfirefox-ha-generado-una-firma-no-valida/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 06:37:12 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[aeat]]></category>
		<category><![CDATA[certificado]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[fnmt]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=258</guid>
		<description><![CDATA[Como cada trimestre, toca presentar las declaraciones del IVA, por lo que me decido a arrancar VMware para hacerlo desde windows como siempre, pero por alguna razon extraña, IE7 no me deja elegir el certificado, asi que decido probarlo con Firefox3 y cual es mi sorpresa al ver que ya puedo acceder sin problemas a [...]]]></description>
			<content:encoded><![CDATA[<p>Como cada trimestre, toca presentar las declaraciones del IVA, por lo que me decido a arrancar VMware para hacerlo desde windows como siempre, pero por alguna razon extraña, IE7 no me deja elegir el certificado, asi que decido probarlo con Firefox3 y cual es mi sorpresa al ver que ya puedo acceder sin problemas a las pantallas de presentacion de declaracion, pero cuando le doy a "FIRMAR Y ENVIAR", me sale un bonito mensaje que dice "ha genereado una firma no valida" y no me deja continuar.</p>
<p>Despues de buscar un poco por google me encuentro con <a href="http://www.reparacion-informatica.es/archives/520.html" target="_blank">este</a> articulo que explica como hacer funcionar el certificado en Linux con Firefox. Asi que me puse a mirarlo con Firefox3, el cual ya tiene el certificado de FNMT instalado.</p>
<div style="text-align: center;"><a href="http://p0l0.binware.org/wp-content/uploads/2008/07/aeat-fnmt_ca.png" rel="lightbox[258]"><img class="alignnone size-medium wp-image-261 aligncenter" title="FNMT CA" src="http://p0l0.binware.org/wp-content/uploads/2008/07/aeat-fnmt_ca-300x162.png" alt="" width="300" height="162" /></a></div>
<p>Asi que lo unico que necesitamos hacer es ir a <strong>about:config</strong> aceptar el mensaje de aviso que nos sale</p>
<div style="text-align: center;"><a href="http://p0l0.binware.org/wp-content/uploads/2008/07/aeat-about_config_warning.png" rel="lightbox[258]"><img class="alignnone size-medium wp-image-260 aligncenter" title="about:config Firefox3 warning" src="http://p0l0.binware.org/wp-content/uploads/2008/07/aeat-about_config_warning-300x87.png" alt="" width="300" height="87" /></a></div>
<p style="text-align: left;">Y buscar el string <strong>signed.applets.codebase_principal_support</strong> y dandole doble-click dejarlo en <strong>true</strong></p>
<div style="text-align: center;"><a href="http://p0l0.binware.org/wp-content/uploads/2008/07/aeat-about_config.png" rel="lightbox[258]"><img class="alignnone size-medium wp-image-259 aligncenter" title="about:config" src="http://p0l0.binware.org/wp-content/uploads/2008/07/aeat-about_config-300x35.png" alt="" width="300" height="35" /></a></div>
<p style="text-align: left;">Con esto listo, simplemente reiniciamos Firefox y ya podemos empezar a presentar nuestras declaraciones sin tener que arrancar VMware ;o)</p>



Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2008%2F07%2F18%2Faeatfirefox-ha-generado-una-firma-no-valida%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2008%2F07%2F18%2Faeatfirefox-ha-generado-una-firma-no-valida%2F&amp;title=AEAT%2BFirefox%20%3D%20%22ha%20generado%20una%20firma%20no%20valida%22&amp;bodytext=Como%20cada%20trimestre%2C%20toca%20presentar%20las%20declaraciones%20del%20IVA%2C%20por%20lo%20que%20me%20decido%20a%20arrancar%20VMware%20para%20hacerlo%20desde%20windows%20como%20siempre%2C%20pero%20por%20alguna%20razon%20extra%C3%B1a%2C%20IE7%20no%20me%20deja%20elegir%20el%20certificado%2C%20asi%20que%20decido%20probarlo%20con%20Firefox3%20" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2008%2F07%2F18%2Faeatfirefox-ha-generado-una-firma-no-valida%2F&amp;title=AEAT%2BFirefox%20%3D%20%22ha%20generado%20una%20firma%20no%20valida%22&amp;notes=Como%20cada%20trimestre%2C%20toca%20presentar%20las%20declaraciones%20del%20IVA%2C%20por%20lo%20que%20me%20decido%20a%20arrancar%20VMware%20para%20hacerlo%20desde%20windows%20como%20siempre%2C%20pero%20por%20alguna%20razon%20extra%C3%B1a%2C%20IE7%20no%20me%20deja%20elegir%20el%20certificado%2C%20asi%20que%20decido%20probarlo%20con%20Firefox3%20" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2008%2F07%2F18%2Faeatfirefox-ha-generado-una-firma-no-valida%2F&amp;t=AEAT%2BFirefox%20%3D%20%22ha%20generado%20una%20firma%20no%20valida%22" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2008%2F07%2F18%2Faeatfirefox-ha-generado-una-firma-no-valida%2F&amp;title=AEAT%2BFirefox%20%3D%20%22ha%20generado%20una%20firma%20no%20valida%22&amp;annotation=Como%20cada%20trimestre%2C%20toca%20presentar%20las%20declaraciones%20del%20IVA%2C%20por%20lo%20que%20me%20decido%20a%20arrancar%20VMware%20para%20hacerlo%20desde%20windows%20como%20siempre%2C%20pero%20por%20alguna%20razon%20extra%C3%B1a%2C%20IE7%20no%20me%20deja%20elegir%20el%20certificado%2C%20asi%20que%20decido%20probarlo%20con%20Firefox3%20" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=AEAT%2BFirefox%20%3D%20%22ha%20generado%20una%20firma%20no%20valida%22&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2008%2F07%2F18%2Faeatfirefox-ha-generado-una-firma-no-valida%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2008%2F07%2F18%2Faeatfirefox-ha-generado-una-firma-no-valida%2F&amp;title=AEAT%2BFirefox%20%3D%20%22ha%20generado%20una%20firma%20no%20valida%22&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=Como%20cada%20trimestre%2C%20toca%20presentar%20las%20declaraciones%20del%20IVA%2C%20por%20lo%20que%20me%20decido%20a%20arrancar%20VMware%20para%20hacerlo%20desde%20windows%20como%20siempre%2C%20pero%20por%20alguna%20razon%20extra%C3%B1a%2C%20IE7%20no%20me%20deja%20elegir%20el%20certificado%2C%20asi%20que%20decido%20probarlo%20con%20Firefox3%20" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2008%2F07%2F18%2Faeatfirefox-ha-generado-una-firma-no-valida%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=AEAT%2BFirefox%20%3D%20%22ha%20generado%20una%20firma%20no%20valida%22%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2008%2F07%2F18%2Faeatfirefox-ha-generado-una-firma-no-valida%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2008/07/18/aeatfirefox-ha-generado-una-firma-no-valida/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mysql Replication</title>
		<link>http://p0l0.binware.org/index.php/2007/04/18/mysql-replication/</link>
		<comments>http://p0l0.binware.org/index.php/2007/04/18/mysql-replication/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 07:32:59 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2007/04/18/mysql-replication/</guid>
		<description><![CDATA[Aqui voy a explicar como poder montar un sistema de maestro-esclavo(s) en mysql. La idea es que hay un servidor principal, que es en el que se modifican los datos y los esclavos solo estan ahi para tenerlo todo duplicado, esto es perfecto para hacer copias de seguridad. Si la idea es tener transferencia de [...]]]></description>
			<content:encoded><![CDATA[<p>Aqui voy a explicar como poder montar un sistema de maestro-esclavo(s) en mysql. La idea es que hay un servidor principal, que es en el que se modifican los datos y los esclavos solo estan ahi para tenerlo todo duplicado, esto es perfecto para hacer copias de seguridad. Si la idea es tener transferencia de datos bidireccional, hay que montar un "<a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster.html" target="_new">MySQL Cluster</a>"</p>
<p>La replicacion funciona por medio de los binary log de mysql, asi que lo primero sera configurar correctamente el servidor maestro. Asi que añadimos estas opciones en el fichero my.cnf si aun no estan.</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>mysql<span style="">&#93;</span></span>
#Activamos el log binario
<span style="color: #000099;">log-bin</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">mysql-bin</span>
#Establecemos un id para el servidor, el maestro SIEMPRE sera <span style="">1</span>
<span style="color: #000099;">server_id</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
#Esto ayuda por si el master tiene un cuelgue y no haya problemas en la replicacion al volver a arrancarlo
<span style="color: #000099;">sync_binlog</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
#Si trabajamos con INNODB, hay que activar esto
<span style="color: #000099;">innodb_flush_log_at_trx_commit</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span></pre></div></div>

<p><strong>IMPORTANTE</strong>: Hay que comprobar que la linea <em>skip-networking </em>no este puesta en el master, ya que sino no abrira el puerto</p>
<p>Ahora dejaremos lista la configuracion en el esclavo</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>mysql<span style="">&#93;</span></span>
#Activamos el log binario
<span style="color: #000099;">log-bin</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">mysql-bin</span>
#Id del esclavo, este tiene que ser unico
<span style="color: #000099;">server_id</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">2</span></pre></div></div>

<p>Ahora en el maestro le damos permisos al esclavo</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">GRANT</span> REPLICATION SLAVE <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">*.*</span> <span style="color: #993333; font-weight: bold;">TO</span> slave@IP_ESCLAVO <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'slavepass'</span>;</pre></div></div>

<p>Ahora vamos a hacer un <em>snapshot</em> de la posicion actual del maestro para dejar el esclavo en la misma posicion para empezar a replicar. Nos conectamos al servidor maestro y ejecutamos lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">FLUSH</span> <span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">WITH</span> <span style="color: #993333; font-weight: bold;">READ</span> <span style="color: #993333; font-weight: bold;">LOCK</span>;
<span style="color: #993333; font-weight: bold;">SHOW</span> MASTER <span style="color: #993333; font-weight: bold;">STATUS</span>;</pre></div></div>

<p>Esto nos va a devolver la posicion actual del log, asi que apuntamos "<strong>File</strong>" y "<strong>Position</strong>", que lo necesitaremos para ponerselo al esclavo, en caso de que salga en blanco "<strong>File</strong>" es <strong>''</strong> y "<strong>Position</strong>" es <strong>4</strong></p>
<p>Ahora sin cerrar la conexion mysql (sino se pondria en marcha otra vez), ejecutamos esto desde otro terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysqladmin <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> shutdown</pre></div></div>

<p>Realizamos ahora la copia de la base de datos, hay dos metodos:</p>
<ul>
<li>mysqldump

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysqldump <span style="color: #660033;">--all-databases</span> <span style="color: #660033;">--master-data</span> <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>dump.sql</pre></div></div>

</li>
<li>tar

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib ; <span style="color: #c20cb9; font-weight: bold;">tar</span> cf <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>mysql.tar mysql</pre></div></div>

</li>
</ul>
<p>Pasamos la copia al esclavo y lo importamos:</p>
<ul>
<li>mysqldump

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>dump.sql</pre></div></div>

</li>
<li>tar

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib ; <span style="color: #c20cb9; font-weight: bold;">tar</span> xcf <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>mysql.tar</pre></div></div>

</li>
</ul>
<p>Lo siguiente es ponerle los datos del maestro al esclavo:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CHANGE</span> MASTER <span style="color: #993333; font-weight: bold;">TO</span> master_host<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'IP_MAESTRO'</span><span style="color: #66cc66;">,</span> master_user<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'slave'</span><span style="color: #66cc66;">,</span> master_password<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'slavepass'</span><span style="color: #66cc66;">,</span> master_log_file<span style="color: #66cc66;">=</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">,</span> master_log_pos<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">4</span>;
start slave;</pre></div></div>




Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F04%2F18%2Fmysql-replication%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F04%2F18%2Fmysql-replication%2F&amp;title=Mysql%20Replication&amp;bodytext=Aqui%20voy%20a%20explicar%20como%20poder%20montar%20un%20sistema%20de%20maestro-esclavo%28s%29%20en%20mysql.%20La%20idea%20es%20que%20hay%20un%20servidor%20principal%2C%20que%20es%20en%20el%20que%20se%20modifican%20los%20datos%20y%20los%20esclavos%20solo%20estan%20ahi%20para%20tenerlo%20todo%20duplicado%2C%20esto%20es%20perfecto%20para%20hacer%20" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F04%2F18%2Fmysql-replication%2F&amp;title=Mysql%20Replication&amp;notes=Aqui%20voy%20a%20explicar%20como%20poder%20montar%20un%20sistema%20de%20maestro-esclavo%28s%29%20en%20mysql.%20La%20idea%20es%20que%20hay%20un%20servidor%20principal%2C%20que%20es%20en%20el%20que%20se%20modifican%20los%20datos%20y%20los%20esclavos%20solo%20estan%20ahi%20para%20tenerlo%20todo%20duplicado%2C%20esto%20es%20perfecto%20para%20hacer%20" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F04%2F18%2Fmysql-replication%2F&amp;t=Mysql%20Replication" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F04%2F18%2Fmysql-replication%2F&amp;title=Mysql%20Replication&amp;annotation=Aqui%20voy%20a%20explicar%20como%20poder%20montar%20un%20sistema%20de%20maestro-esclavo%28s%29%20en%20mysql.%20La%20idea%20es%20que%20hay%20un%20servidor%20principal%2C%20que%20es%20en%20el%20que%20se%20modifican%20los%20datos%20y%20los%20esclavos%20solo%20estan%20ahi%20para%20tenerlo%20todo%20duplicado%2C%20esto%20es%20perfecto%20para%20hacer%20" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Mysql%20Replication&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F04%2F18%2Fmysql-replication%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F04%2F18%2Fmysql-replication%2F&amp;title=Mysql%20Replication&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=Aqui%20voy%20a%20explicar%20como%20poder%20montar%20un%20sistema%20de%20maestro-esclavo%28s%29%20en%20mysql.%20La%20idea%20es%20que%20hay%20un%20servidor%20principal%2C%20que%20es%20en%20el%20que%20se%20modifican%20los%20datos%20y%20los%20esclavos%20solo%20estan%20ahi%20para%20tenerlo%20todo%20duplicado%2C%20esto%20es%20perfecto%20para%20hacer%20" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F04%2F18%2Fmysql-replication%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Mysql%20Replication%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F04%2F18%2Fmysql-replication%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2007/04/18/mysql-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP5 eAccelerator</title>
		<link>http://p0l0.binware.org/index.php/2007/01/23/php5-eaccelerator/</link>
		<comments>http://p0l0.binware.org/index.php/2007/01/23/php5-eaccelerator/#comments</comments>
		<pubDate>Tue, 23 Jan 2007 19:30:59 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2007/01/23/php5-eaccelerator/</guid>
		<description><![CDATA[Hacia tiempo que queria poner esto, pero nunca me he puesto. eAccelerator es un modulo de php que compila y carga en memoria las aplicaciones php, y con esto consigue que haya una mejora de respuesta y descarga bastante el servidor. Aqui os explico como instalar eAccelerator con PHP5 en una debian.
Lo primero que hay [...]]]></description>
			<content:encoded><![CDATA[<p>Hacia tiempo que queria poner esto, pero nunca me he puesto. eAccelerator es un modulo de php que compila y carga en memoria las aplicaciones php, y con esto consigue que haya una mejora de respuesta y descarga bastante el servidor. Aqui os explico como instalar eAccelerator con PHP5 en una debian.</p>
<p>Lo primero que hay que hacer es descargarse la ultima version de <a title="Download eAccelerator" href="http://sourceforge.net/project/showfiles.php?group_id=122249" target="_blank">eAccelerator</a>, tambien necesitaremos en el server las utilidades de desarrollo de php</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> php5-dev</pre></div></div>

<p>La instalacion es realmente muy sencilla, solo tenemos que descomprimir, compiler, instalar y configurar.</p>
<ul>
<li>Descomprimimos</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvfj eaccelerator-0.9.5.tar.bz2</pre></div></div>

<ul>
<li>Compilamos</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> eaccelerator-0.9.5
phpize
.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<ul>
<li>Instalamos (nos pondra el modulo en la carpeta de modulos de php)</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<ul>
<li>Copiamos la configuracion para que la cargue php</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> eaccelerator.ini <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Lo primero que hay que hacer en la configuracion es decirle que no es una zend_extension, por lo tanto cambiamos</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">zend_extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;/usr/lib/php4/eaccelerator.so&quot;</span></pre></div></div>

<p>por</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;eaccelerator.so&quot;</span></pre></div></div>

<p>Luego yo en la configuracion he dejado todo como venia por defecto excepto</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">eaccelerator.log_file <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #933;">&quot;/var/log/apache/eaccelerator_log&quot;</span></pre></div></div>




Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F01%2F23%2Fphp5-eaccelerator%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F01%2F23%2Fphp5-eaccelerator%2F&amp;title=PHP5%20eAccelerator&amp;bodytext=Hacia%20tiempo%20que%20queria%20poner%20esto%2C%20pero%20nunca%20me%20he%20puesto.%20eAccelerator%20es%20un%20modulo%20de%20php%20que%20compila%20y%20carga%20en%20memoria%20las%20aplicaciones%20php%2C%20y%20con%20esto%20consigue%20que%20haya%20una%20mejora%20de%20respuesta%20y%20descarga%20bastante%20el%20servidor.%20Aqui%20os%20explico%20c" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F01%2F23%2Fphp5-eaccelerator%2F&amp;title=PHP5%20eAccelerator&amp;notes=Hacia%20tiempo%20que%20queria%20poner%20esto%2C%20pero%20nunca%20me%20he%20puesto.%20eAccelerator%20es%20un%20modulo%20de%20php%20que%20compila%20y%20carga%20en%20memoria%20las%20aplicaciones%20php%2C%20y%20con%20esto%20consigue%20que%20haya%20una%20mejora%20de%20respuesta%20y%20descarga%20bastante%20el%20servidor.%20Aqui%20os%20explico%20c" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F01%2F23%2Fphp5-eaccelerator%2F&amp;t=PHP5%20eAccelerator" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F01%2F23%2Fphp5-eaccelerator%2F&amp;title=PHP5%20eAccelerator&amp;annotation=Hacia%20tiempo%20que%20queria%20poner%20esto%2C%20pero%20nunca%20me%20he%20puesto.%20eAccelerator%20es%20un%20modulo%20de%20php%20que%20compila%20y%20carga%20en%20memoria%20las%20aplicaciones%20php%2C%20y%20con%20esto%20consigue%20que%20haya%20una%20mejora%20de%20respuesta%20y%20descarga%20bastante%20el%20servidor.%20Aqui%20os%20explico%20c" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=PHP5%20eAccelerator&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F01%2F23%2Fphp5-eaccelerator%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F01%2F23%2Fphp5-eaccelerator%2F&amp;title=PHP5%20eAccelerator&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=Hacia%20tiempo%20que%20queria%20poner%20esto%2C%20pero%20nunca%20me%20he%20puesto.%20eAccelerator%20es%20un%20modulo%20de%20php%20que%20compila%20y%20carga%20en%20memoria%20las%20aplicaciones%20php%2C%20y%20con%20esto%20consigue%20que%20haya%20una%20mejora%20de%20respuesta%20y%20descarga%20bastante%20el%20servidor.%20Aqui%20os%20explico%20c" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F01%2F23%2Fphp5-eaccelerator%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=PHP5%20eAccelerator%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2007%2F01%2F23%2Fphp5-eaccelerator%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2007/01/23/php5-eaccelerator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hacker::quiz</title>
		<link>http://p0l0.binware.org/index.php/2006/12/11/hackerquiz/</link>
		<comments>http://p0l0.binware.org/index.php/2006/12/11/hackerquiz/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 14:30:08 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[bkp]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/12/11/hackerquiz/</guid>
		<description><![CDATA[Ya ha acabado la bkp 7ª edicion, y para quien le interese aqui os cuelgo aqui el codigo del hacker::quiz de este año. Realmente es muy sencillo, pero aun asi os colgare las soluciones.
Descargar hacker::quiz

Level1


Aparentemente no parece que hay ningun error de programacion, pero si pruebas de buscar los .bak, *~... encuentras el fichero login.php~ [...]]]></description>
			<content:encoded><![CDATA[<p>Ya ha acabado la <a title="Bkp 7ª edicion" target="_blank" href="https://www.balearikus-party.org/2006/principal.php?recordID=1">bkp 7ª edicion</a>, y para quien le interese aqui os cuelgo aqui el codigo del <a title="hacker::quiz" target="_blank" href="https://www.balearikus-party.org/2006/info_evento.php?recordID=10&#038;eventID=2">hacker::quiz</a> de este año. Realmente es muy sencillo, pero aun asi os colgare las soluciones.</p>
<p><a target="_blank" title="hacker::quiz 2006" href="http://p0l0.binware.org/wp-content/2006/12/hackerQuiz.tar.bz2">Descargar hacker::quiz</a></p>
<ul>
<li>Level1</li>
</ul>
<ul>
<li>Aparentemente no parece que hay ningun error de programacion, pero si pruebas de buscar los .bak, *~... encuentras el fichero login.php~ y en el aparece la contraseña en md5. Con un cracker de md5 como por ejemplo <a title="Lepton's Crack" target="_blank" href="http://freshmeat.net/projects/lcrack/">lcrack</a>. En pocos minutos saldra la contraseña del nivel.</li>
</ul>
<ul>
<li>Level2</li>
</ul>
<ul>
<li>Aqui hay que fijarse que en el codigo hay un "src=javascript" y que el codigo bueno esta en el fichero javascript. Aqui se una un algoritmo de encriptacion super sencillo, que se puede desencriptar facilmente cambiando la funcion generatePass para sacar la contraseña.</li>
</ul>
<ul>
<li>Level3</li>
</ul>
<ul>
<li>Este nivel es un formulario con sql injection super sencillo, cuando pones un ' el error cambia a "Error Sql", por lo tanto con un sencillo "' OR 1=1 -- a" te saltas la autenficiacion y pasas al siguiente nivel</li>
</ul>
<ul>
<li>Level4</li>
</ul>
<ul>
<li>En este nivel hay un applet java que gestiona la autentificacion. Descargando el .class y descompilandolo con un java decompiler tipo <a title="Java Decompiler" target="_blank" href="http://www.kpdus.com/jad.html">jad</a>. Analizando el codigo ves que accede a un fichero del que saca el usuario y contraseña.</li>
</ul>
<ul>
<li>Level5</li>
</ul>
<ul>
<li>En este nivel, se puede ver que el formulario es multi-idioma, pero si cambias el parametro del idioma, intenta acceder a un fichero, por lo tanto, cuando pones "login/index" da un error de que no encuentra authdata.php, apuntas a ese fichero y te aparece el usuario y contraseña por pantalla</li>
</ul>
<ul>
<li>Level6</li>
</ul>
<ul>
<li>Aqui puedes ver que la autentificacion tiene unas estadisticas creadas con awstats, investigando un poco te das cuenta que la version de awstats es vulnerable a injeccion de comandos en la variable "configdir". Haciendo un ls ves que hay un fichero "instructions-next-level.pl", haciendole un simple "cat" se puede ver en los comentarios la contraseña</li>
</ul>
<ul>
<li>Level7</li>
</ul>
<ul>
<li>Aqui te dan una linea de un usuario de la maquina, al cual con por ejemplo "john the ripper" crackeas la contraseña y consigues acceso a la maquina. Una vez dentro de la maquina, buscando un poco te encuentras con un fichero "getsh" (el codigo fuente esta incluido en el fichero) con suid en "/opt/.../". Analizando el fichero con un editor normal o un editor hexadecimal, encuentras el string "/opt/.../theshell", y basta con copiar el fichero "mysh" a "theshell" y ejecutas el "getsh" y ya eres root.</li>
</ul>



Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F11%2Fhackerquiz%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F11%2Fhackerquiz%2F&amp;title=hacker%3A%3Aquiz&amp;bodytext=Ya%20ha%20acabado%20la%20bkp%207%C2%AA%20edicion%2C%20y%20para%20quien%20le%20interese%20aqui%20os%20cuelgo%20aqui%20el%20codigo%20del%20hacker%3A%3Aquiz%20de%20este%20a%C3%B1o.%20Realmente%20es%20muy%20sencillo%2C%20pero%20aun%20asi%20os%20colgare%20las%20soluciones.%0D%0A%0D%0ADescargar%20hacker%3A%3Aquiz%0D%0A%0D%0A%09Level1%0D%0A%0D%0A%0D%0A%09Aparentemente%20no%20par" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F11%2Fhackerquiz%2F&amp;title=hacker%3A%3Aquiz&amp;notes=Ya%20ha%20acabado%20la%20bkp%207%C2%AA%20edicion%2C%20y%20para%20quien%20le%20interese%20aqui%20os%20cuelgo%20aqui%20el%20codigo%20del%20hacker%3A%3Aquiz%20de%20este%20a%C3%B1o.%20Realmente%20es%20muy%20sencillo%2C%20pero%20aun%20asi%20os%20colgare%20las%20soluciones.%0D%0A%0D%0ADescargar%20hacker%3A%3Aquiz%0D%0A%0D%0A%09Level1%0D%0A%0D%0A%0D%0A%09Aparentemente%20no%20par" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F11%2Fhackerquiz%2F&amp;t=hacker%3A%3Aquiz" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F11%2Fhackerquiz%2F&amp;title=hacker%3A%3Aquiz&amp;annotation=Ya%20ha%20acabado%20la%20bkp%207%C2%AA%20edicion%2C%20y%20para%20quien%20le%20interese%20aqui%20os%20cuelgo%20aqui%20el%20codigo%20del%20hacker%3A%3Aquiz%20de%20este%20a%C3%B1o.%20Realmente%20es%20muy%20sencillo%2C%20pero%20aun%20asi%20os%20colgare%20las%20soluciones.%0D%0A%0D%0ADescargar%20hacker%3A%3Aquiz%0D%0A%0D%0A%09Level1%0D%0A%0D%0A%0D%0A%09Aparentemente%20no%20par" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=hacker%3A%3Aquiz&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F11%2Fhackerquiz%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F11%2Fhackerquiz%2F&amp;title=hacker%3A%3Aquiz&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=Ya%20ha%20acabado%20la%20bkp%207%C2%AA%20edicion%2C%20y%20para%20quien%20le%20interese%20aqui%20os%20cuelgo%20aqui%20el%20codigo%20del%20hacker%3A%3Aquiz%20de%20este%20a%C3%B1o.%20Realmente%20es%20muy%20sencillo%2C%20pero%20aun%20asi%20os%20colgare%20las%20soluciones.%0D%0A%0D%0ADescargar%20hacker%3A%3Aquiz%0D%0A%0D%0A%09Level1%0D%0A%0D%0A%0D%0A%09Aparentemente%20no%20par" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F11%2Fhackerquiz%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=hacker%3A%3Aquiz%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F11%2Fhackerquiz%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/12/11/hackerquiz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MRTG Total</title>
		<link>http://p0l0.binware.org/index.php/2006/12/05/mrtg-total/</link>
		<comments>http://p0l0.binware.org/index.php/2006/12/05/mrtg-total/#comments</comments>
		<pubDate>Tue, 05 Dec 2006 15:41:08 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mrtg]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/12/05/mrtg-total/</guid>
		<description><![CDATA[MRTG es una utilidad para monitorizar y generar graficos por medio de snmp. Para los que tengan como yo limite de consumo de trafico mensual, va muy bien tener un contador del total de consumo por dias y por meses.
Lo primero que tenemos que hacer es instalar los paquetes necesarios:

apt-get install mrtg libgd-graph-perl libgd-graph3d-perl snmpd

Una [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" title="MRTG" href="http://oss.oetiker.ch/mrtg/">MRTG</a> es una utilidad para monitorizar y generar graficos por medio de snmp. Para los que tengan como yo limite de consumo de trafico mensual, va muy bien tener un contador del total de consumo por dias y por meses.</p>
<p>Lo primero que tenemos que hacer es instalar los paquetes necesarios:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mrtg libgd-graph-perl libgd-graph3d-perl snmpd</pre></div></div>

<p>Una vez instalado, configuramos <a target="_blank" title="MRTG" href="http://oss.oetiker.ch/mrtg/">MRTG</a> (<strong>/etc/mrtg.cfg</strong>):</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">#################################################
# Multi Router Traffic Grapher -- Sample Configuration File
#################################################
# This file is for use with mrtg-2.5.4c
&nbsp;
# Global configuration
WorkDir: /var/www/mrtg
&nbsp;
#General title
Title<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>^<span style="">&#93;</span></span>: Traffic Analysis for Atlantis
&nbsp;
#We dont need Ipv6
EnableIPV6: no
#Count in bits, grow from right to left, log unknow data as zero
Options<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>_<span style="">&#93;</span></span>: bits,growright,unknaszero
&nbsp;
#Target to monitor
Target<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: <span style="">2</span>:atlantis@localhost
&nbsp;
#Page title
Title<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: Traffic Analysis for Atlantis
PageTop<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: &amp;lt<span style="color: #666666; font-style: italic;">;H1&amp;gt;Our 100mbps link to the outside world&amp;lt;/H1&amp;gt;</span>
#100mb
MaxBytes<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: <span style="">12500000</span>
WithPeak<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: ymw
AbsMax<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: <span style="">1000000000000</span>
&nbsp;
#MRTG Total config <span style="">&#40;</span>Title, Unit <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> M<span style="">&#40;</span>Bytes<span style="">&#41;</span><span style="">&#41;</span></span>
#-#Total<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: Traffic Totals for Atlantis
#-#Total-Unit<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: M
#-#Total:Ratio<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>atlantis<span style="">&#93;</span></span>: yes</pre></div></div>

<p>Configurar SNMP (<strong>/etc/snmp/snmpd.conf</strong>):</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">com2sec local localhost atlantis
com2sec atlantis 66.111.52.100 atlantis
&nbsp;
group MyROGroup v1         local
group MyROGroup v1      atlantis
&nbsp;
view all-nibs included .1 <span style="">80</span>
&nbsp;
access MyROGroup <span style="color: #933;">&quot;&quot;</span>      v1       noauth    exact  all-nibs    none   none
&nbsp;
syslocation altantis
syscontact Root</pre></div></div>

<p>Configuramos iptables para que no puedan acceder al SNMP desde fuera</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#SNMPD Solo Local</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> 127.0.0.1 <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">199</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> 127.0.0.1 <span style="color: #660033;">-p</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">161</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> 85.17.1.127 <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">199</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> 85.17.1.127 <span style="color: #660033;">-p</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">161</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">199</span> <span style="color: #660033;">-j</span> DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-s</span> <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span> <span style="color: #660033;">-p</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">161</span> <span style="color: #660033;">-j</span> DROP</pre></div></div>

<p><a target="_blank" title="MRTG Total" href="http://p0l0.binware.org/wp-content/2006/11/mrtg_total.tar.bz2">Descargamos</a> mrtg_total y lo descomprimimos:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvfj mrtg_total.tar.bz2
<span style="color: #7a0874; font-weight: bold;">cd</span> mrt_total
<span style="color: #c20cb9; font-weight: bold;">unzip</span> mrtg_total.zip</pre></div></div>

<p>El script importante es mrtg_total.pl, y hay que añadirle en la primera linea del fichero <strong>#!/usr/bin/perl</strong></p>
<p>Ahora añadimos al crontab que ejecute mrtg_total, por ejemplo cada 3 horas (<strong>/etc/crontab</strong>):</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="">0</span> */<span style="">3</span> * * * root  /path/to/mrtg_total.pl /etc/mrtg.cfg</pre></div></div>

<p>Esto nos va a generar cada 3 horas una version actualizada del consumo en /var/www/mrtg, lo suyo es protegerlo con contraseña para que no pueda acceder todo el mundo. Creamos un ficheros <strong>.htaccess</strong> en /var/www/mrtg</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">AuthType Basic
AuthName <span style="color: #933;">&quot;MRTG&quot;</span>
AuthUserFile /var/www/mrtg/.htpasswd
Require valid-user</pre></div></div>

<p>Y ahora creamos el <strong>.htpasswd</strong> de la siguiente forma:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-c</span> .htpasswd mrtg</pre></div></div>

<p>Ahora con todo configurado, tendremos:</p>
<p>http://nuestroserver/mrtg/atlantis.html (estadisticas de MRTG)</p>
<div style="text-align: center"><a target="_blank" title="MRTG" href="http://p0l0.binware.org/wp-content/2006/12/mrtg.png" rel="lightbox[228]"><img width="68" height="96" border="0" id="image235" alt="MRTG" src="http://p0l0.binware.org/wp-content/2006/12/mrtg.miniatura.png" /></a></div>
<p>http://nuestroserver/mrtg/atlantis.total.2006.html (estadisticas MRTG total)</p>
<div style="text-align: center"><a target="_blank" title="MRTG Total" href="http://p0l0.binware.org/wp-content/2006/12/mrtg-total.png" rel="lightbox[228]"><img width="90" height="96" border="0" id="image233" alt="Mrtg Total" src="http://p0l0.binware.org/wp-content/2006/12/mrtg-total.miniatura.png" /></a></div>
<p><a target="_blank" title="MRTG Total" href="http://p0l0.binware.org/wp-content/2006/11/mrtg_total.tar.bz2">Download MRTG_TOTAL<br />
</a></p>



Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F05%2Fmrtg-total%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F05%2Fmrtg-total%2F&amp;title=MRTG%20Total&amp;bodytext=MRTG%20es%20una%20utilidad%20para%20monitorizar%20y%20generar%20graficos%20por%20medio%20de%20snmp.%20Para%20los%20que%20tengan%20como%20yo%20limite%20de%20consumo%20de%20trafico%20mensual%2C%20va%20muy%20bien%20tener%20un%20contador%20del%20total%20de%20consumo%20por%20dias%20y%20por%20meses.%0D%0A%0D%0ALo%20primero%20que%20tenemos%20que%20hacer" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F05%2Fmrtg-total%2F&amp;title=MRTG%20Total&amp;notes=MRTG%20es%20una%20utilidad%20para%20monitorizar%20y%20generar%20graficos%20por%20medio%20de%20snmp.%20Para%20los%20que%20tengan%20como%20yo%20limite%20de%20consumo%20de%20trafico%20mensual%2C%20va%20muy%20bien%20tener%20un%20contador%20del%20total%20de%20consumo%20por%20dias%20y%20por%20meses.%0D%0A%0D%0ALo%20primero%20que%20tenemos%20que%20hacer" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F05%2Fmrtg-total%2F&amp;t=MRTG%20Total" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F05%2Fmrtg-total%2F&amp;title=MRTG%20Total&amp;annotation=MRTG%20es%20una%20utilidad%20para%20monitorizar%20y%20generar%20graficos%20por%20medio%20de%20snmp.%20Para%20los%20que%20tengan%20como%20yo%20limite%20de%20consumo%20de%20trafico%20mensual%2C%20va%20muy%20bien%20tener%20un%20contador%20del%20total%20de%20consumo%20por%20dias%20y%20por%20meses.%0D%0A%0D%0ALo%20primero%20que%20tenemos%20que%20hacer" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=MRTG%20Total&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F05%2Fmrtg-total%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F05%2Fmrtg-total%2F&amp;title=MRTG%20Total&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=MRTG%20es%20una%20utilidad%20para%20monitorizar%20y%20generar%20graficos%20por%20medio%20de%20snmp.%20Para%20los%20que%20tengan%20como%20yo%20limite%20de%20consumo%20de%20trafico%20mensual%2C%20va%20muy%20bien%20tener%20un%20contador%20del%20total%20de%20consumo%20por%20dias%20y%20por%20meses.%0D%0A%0D%0ALo%20primero%20que%20tenemos%20que%20hacer" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F05%2Fmrtg-total%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=MRTG%20Total%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F12%2F05%2Fmrtg-total%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/12/05/mrtg-total/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiples proyectos con trac y svn usando HTTPS</title>
		<link>http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/</link>
		<comments>http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/#comments</comments>
		<pubDate>Tue, 03 Oct 2006 17:51:55 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[binware]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/</guid>
		<description><![CDATA[Voy a explicar como montar el sistema de gestion de proyectos trac y subversion usando https para trabajar con subversion. Yo lo he montado en una debian usando apache2, asi que lo primero que necesitamos es instalar todo lo necesario

apt-get install trac subversion apache2 subversion libapache2-svn libapache2-mod-python2.3

Una vez descargado e instalado creamos el certificado necesario [...]]]></description>
			<content:encoded><![CDATA[<p>Voy a explicar como montar el sistema de gestion de proyectos <a target="_blank" title="Trac" href="http://trac.edgewall.com/">trac</a> y <a target="_blank" title="Subversion" href="http://subversion.tigris.org/">subversion</a> usando https para trabajar con subversion. Yo lo he montado en una debian usando apache2, asi que lo primero que necesitamos es instalar todo lo necesario</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> trac subversion apache2 subversion libapache2-svn libapache2-mod-python2.3</pre></div></div>

<p>Una vez descargado e instalado creamos el certificado necesario para usar tanto trac y subversion bajo https. Entra en el directorio <strong>/etc/apache2/ssl</strong> y ejecuta lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> server.key <span style="color: #000000;">1024</span>
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> server.key <span style="color: #660033;">-out</span> server.csr
<span style="color: #c20cb9; font-weight: bold;">cp</span> server.key server.key.org
openssl rsa <span style="color: #660033;">-in</span> server.key.org <span style="color: #660033;">-out</span> server.key
openssl x509 <span style="color: #660033;">-req</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span> <span style="color: #660033;">-in</span> server.csr <span style="color: #660033;">-signkey</span> server.key <span style="color: #660033;">-out</span> server.crt</pre></div></div>

<p>Ahora ya tenemos listo los certificados, asi que ahora solo nos queda configurar el apache. Yo he creado un trac.dominio.ext y un svn.dominio.ext para hacer esto, pero esto va a gusto de cada uno. Yo como uso dos subdominios distintos, lo tengo en ficheros separados.</p>
<p>Primero editaremos el trac, asi que creamos el fichero <strong>/etc/apache2/sites-available/trac.domain.ext</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">NameVirtualHost *:<span style="">443</span>
&lt;VirtualHost *:<span style="">443</span>&gt;
#Activate SSL
SSLEngine on
&nbsp;
SSLCertificateFile    /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
&nbsp;
#VirtualHost Servername
ServerName trac.domain.ext
ServerAdmin trac@domain.ext
&nbsp;
DocumentRoot /opt/projects/trac
&nbsp;
#Authentication
&lt;Location /&gt;
AuthType Basic
AuthName <span style="color: #933;">&quot;Trac&quot;</span>
AuthUserFile /opt/projects/.htpasswd
Require valid-user
&nbsp;
#Trac
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /opt/projects/trac/
PythonOption TracUriRoot /
&nbsp;
&lt;/Location&gt;
&lt;/VirtualHost&gt;</pre></div></div>

<p>El fichero no necesita demasiada explicacion, simplemente le decimos que active el SSL, que pida autentificacion y cargamos el modulo del trac y le especificamos el path de donde estan todos nuestros proyectos.</p>
<p>Ahora vamos con el fichero <strong>/etc/apache2/sites-available/svn.domain.ext</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">NameVirtualHost *:<span style="">443</span>
&lt;VirtualHost *:<span style="">443</span>&gt;
#Activate SSL
SSLEngine on
&nbsp;
SSLCertificateFile    /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
&nbsp;
#VirtualHost Servername
ServerName svn.domain.ext
ServerAdmin svn@domain.ext
&nbsp;
DocumentRoot /opt/projects/svn
&lt;Location /&gt;
DAV svn
&nbsp;
#Authentication
AuthType Basic
AuthName <span style="color: #933;">&quot;Subversion&quot;</span>
AuthUserFile /opt/projects/.htpasswd
Require valid-user
&nbsp;
#Subversion
SVNParentPath /opt/projects/svn
SVNListParentPath on
SVNAutoVersioning On
&lt;/Location&gt;
&nbsp;
&lt;LocationMatch <span style="color: #933;">&quot;/.+&quot;</span>&gt;
#Subversion permission file
AuthzSVNAccessFile /opt/projects/svn/.htpasswd
&lt;/LocationMatch&gt;
&lt;/VirtualHost&gt;</pre></div></div>

<p>Es importante separar el <strong>AuthzSVNAccessFile</strong> de <strong>&lt;Location /&gt;</strong> ya que sino no listara todos los proyectos en http://svn.domain.ext/ por problemas de permisos.</p>
<p>Ahora que tenemos estos ficheros listos, hay que activar el modulo de ssl en el apache2 y los dos dominios.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>ports.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">&lt;IfModule mod_ssl.c&gt;
Listen <span style="">443</span>
&lt;/IfModule&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-enabled
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>dav.load .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>dav_svn.load .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>mod_python.load .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>ssl.conf .
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>mods-available<span style="color: #000000; font-weight: bold;">/</span>ssl.load .
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-enabled
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>svn.domain.ext 001-svn.domain.ext
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>trac.domain.ext 001-trac.domain.ext</pre></div></div>

<p>Ahora vamos a crear un proyecto de prueba</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>trac
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>NewProject
trac-admin <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>NewProject initenv</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">Project Name <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>My Project<span style="">&#93;</span></span>&gt; NewProject
Database connection string <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>sqlite:db/trac.db<span style="">&#93;</span></span>&gt;
Path to repository <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>/var/svn/test<span style="">&#93;</span></span>&gt; /opt/projects/svn/NewProject
Templates directory <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>/usr/share/trac/templates<span style="">&#93;</span></span>&gt;
Creating and Initializing Project
Configuring Project
trac.repository_dir
trac.database
trac.templates_dir
project.name
Installing default wiki pages
..............</pre></div></div>

<pre lang="bash"
chown -R www-data:www-data /opt/projects/
</pre>
<p>Ahora creamos los ficheros de acceso de usuarios.</p>
</pre>
<pre lang="bash>
htpasswd -c /opt/projects/.htpasswd user1
htpasswd /opt/projects/.htpasswd user2
</pre>
<p>Y el archivo de permisos de subversion, que tiene el siguiente formato</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Repositorio:/Path<span style="">&#93;</span></span>
<span style="color: #000099;">user</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span> <span style="">&#91;</span>r<span style="">&#91;</span>w<span style="">&#93;</span><span style="">&#93;</span><span style="">&#93;</span></span></span></pre></div></div>

<p>Por ejemplo, queremos que el user1 pueda leer y escribir, el user2 leer, y anonymous nada (no deberia haber anonymous ya que el htpasswd no los deja pasar, pero siempre viene bien protegerse por si acaso), el fichero quedaria asi</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>NewProject:/<span style="">&#93;</span></span>
<span style="color: #000099;">user1</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> rw</span>
<span style="color: #000099;">user2</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> r</span>
* <span style="color: #000066; font-weight:bold;">=</span></pre></div></div>

<p>Ahora ya tenemos todo listo, podemos instalar el modulo <a target="_blank" title="Trac Web Admin" href="http://trac.edgewall.org/wiki/WebAdmin">TracWebAdmin</a> para que sea mas facil la administracion del trac.</p>



Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F10%2F03%2Fmultiples-proyectos-con-trac-y-svn-usando-https%2F&amp;partner=sociable" title="Print"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F10%2F03%2Fmultiples-proyectos-con-trac-y-svn-usando-https%2F&amp;title=Multiples%20proyectos%20con%20trac%20y%20svn%20usando%20HTTPS&amp;bodytext=Voy%20a%20explicar%20como%20montar%20el%20sistema%20de%20gestion%20de%20proyectos%20trac%20y%20subversion%20usando%20https%20para%20trabajar%20con%20subversion.%20Yo%20lo%20he%20montado%20en%20una%20debian%20usando%20apache2%2C%20asi%20que%20lo%20primero%20que%20necesitamos%20es%20instalar%20todo%20lo%20necesario%0D%0A%0D%0Aapt-get%20inst" title="Digg"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F10%2F03%2Fmultiples-proyectos-con-trac-y-svn-usando-https%2F&amp;title=Multiples%20proyectos%20con%20trac%20y%20svn%20usando%20HTTPS&amp;notes=Voy%20a%20explicar%20como%20montar%20el%20sistema%20de%20gestion%20de%20proyectos%20trac%20y%20subversion%20usando%20https%20para%20trabajar%20con%20subversion.%20Yo%20lo%20he%20montado%20en%20una%20debian%20usando%20apache2%2C%20asi%20que%20lo%20primero%20que%20necesitamos%20es%20instalar%20todo%20lo%20necesario%0D%0A%0D%0Aapt-get%20inst" title="del.icio.us"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F10%2F03%2Fmultiples-proyectos-con-trac-y-svn-usando-https%2F&amp;t=Multiples%20proyectos%20con%20trac%20y%20svn%20usando%20HTTPS" title="Facebook"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F10%2F03%2Fmultiples-proyectos-con-trac-y-svn-usando-https%2F&amp;title=Multiples%20proyectos%20con%20trac%20y%20svn%20usando%20HTTPS&amp;annotation=Voy%20a%20explicar%20como%20montar%20el%20sistema%20de%20gestion%20de%20proyectos%20trac%20y%20subversion%20usando%20https%20para%20trabajar%20con%20subversion.%20Yo%20lo%20he%20montado%20en%20una%20debian%20usando%20apache2%2C%20asi%20que%20lo%20primero%20que%20necesitamos%20es%20instalar%20todo%20lo%20necesario%0D%0A%0D%0Aapt-get%20inst" title="Google Bookmarks"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=Multiples%20proyectos%20con%20trac%20y%20svn%20usando%20HTTPS&amp;body=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F10%2F03%2Fmultiples-proyectos-con-trac-y-svn-usando-https%2F" title="email"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F10%2F03%2Fmultiples-proyectos-con-trac-y-svn-usando-https%2F&amp;title=Multiples%20proyectos%20con%20trac%20y%20svn%20usando%20HTTPS&amp;source=P0L0%26%23039%3Bs+Blog+Opensource+Projects+and+IT+experiences&amp;summary=Voy%20a%20explicar%20como%20montar%20el%20sistema%20de%20gestion%20de%20proyectos%20trac%20y%20subversion%20usando%20https%20para%20trabajar%20con%20subversion.%20Yo%20lo%20he%20montado%20en%20una%20debian%20usando%20apache2%2C%20asi%20que%20lo%20primero%20que%20necesitamos%20es%20instalar%20todo%20lo%20necesario%0D%0A%0D%0Aapt-get%20inst" title="LinkedIn"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://meneame.net/submit.php?url=http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F10%2F03%2Fmultiples-proyectos-con-trac-y-svn-usando-https%2F" title="Meneame"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/meneame.png" title="Meneame" alt="Meneame" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Multiples%20proyectos%20con%20trac%20y%20svn%20usando%20HTTPS%20-%20http%3A%2F%2Fp0l0.binware.org%2Findex.php%2F2006%2F10%2F03%2Fmultiples-proyectos-con-trac-y-svn-usando-https%2F" title="Twitter"><img src="http://p0l0.binware.org/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/10/03/multiples-proyectos-con-trac-y-svn-usando-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
