<?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>Sun, 30 Oct 2011 08:39:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Git Over HTTP (git-http-backend)</title>
		<link>http://p0l0.binware.org/index.php/2011/08/26/git-over-http-git-http-backend/</link>
		<comments>http://p0l0.binware.org/index.php/2011/08/26/git-over-http-git-http-backend/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 19:03:37 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dvcs]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=1036</guid>
		<description><![CDATA[I found really annoying that all Git guides I found talked about using Git over SSH, thats because I googled until I found that Git now comes with git-http-backend, which lets you to configure your webserver to serve git over HTTP/HTTPS. Here is a little guide how to setup git-http-backend using apache. First of all [...]]]></description>
			<content:encoded><![CDATA[<p>I found really annoying that all Git guides I found talked about using Git over SSH, thats because I googled until I found that Git now comes with <a href="http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html" title="git-http-backend(1)" target="_blank">git-http-backend</a>, which lets you to configure your webserver to serve git over HTTP/HTTPS.</p>
<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><br />
<span id="more-1036"></span><br />
Here is a little guide how to setup git-http-backend using apache. First of all we need to install git on our server:</p>
<pre class="brush: bash; title: ; notranslate">
apt-get install git-core
</pre>
<p>Once git is installed we will found git-http-backend under <em>/usr/lib/git-core/git-http-backend</em>. Next step is to setup the Apache configuration:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_ssl.c&gt;
&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">443</span>&gt;
    <span style="color: #00007f;">SSLEngine</span> <span style="color: #0000ff;">on</span>
&nbsp;
    <span style="color: #00007f;">SSLCertificateFile</span> /etc/ssl/server.crt
    <span style="color: #00007f;">SSLCertificateKeyFile</span> /etc/ssl/server.key
    <span style="color: #00007f;">SetEnvIf</span> User-Agent <span style="color: #7f007f;">&quot;.*MSIE.*&quot;</span> <span style="color: #0000ff;">nokeepalive</span> ssl-unclean-shutdown
&nbsp;
    <span style="color: #00007f;">ServerName</span> git.example.com
    <span style="color: #00007f;">ErrorLog</span> /var/log/apache2/git-error.log
    <span style="color: #00007f;">CustomLog</span> /var/log/apache2/git-access.log combined
&nbsp;
    <span style="color: #adadad; font-style: italic;"># GIT Config</span>
    <span style="color: #00007f;">SetEnv</span> GIT_PROJECT_ROOT /opt/git/repositories
    <span style="color: #00007f;">SetEnv</span> GIT_HTTP_EXPORT_ALL
&nbsp;
    <span style="color: #adadad; font-style: italic;"># Route Git-Http-Backend</span>
    <span style="color: #00007f;">ScriptAlias</span> / /usr/lib/git-core/git-http-backend/
&nbsp;
    <span style="color: #adadad; font-style: italic;"># Require Acces for all resources</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;Private&quot;</span>
        <span style="color: #00007f;">Require</span> valid-<span style="color: #00007f;">user</span>
        <span style="color: #00007f;">AuthUserFile</span> /opt/git/<span style="color: #00007f;">user</span>.passwd
    &lt;/<span style="color: #000000; font-weight:bold;">Location</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;</pre></div></div>

<p>Now we only need to create our repositories under <em>/opt/git/repositories</em> (The repositories must be owned by the apache user to work):</p>
<pre class="brush: bash; title: ; notranslate">
cd /opt/git/repositories
git --bare init test.git
chown -R www-data:www-data /opt/git/repositories
</pre>
<p>And thats all, now we can checkout the repository using the url <em>https://git.example.com/test.git</em>:</p>
<pre class="brush: bash; title: ; notranslate">
git clone https://username@git.example.com/test.git
cd test
mkdir testdir
touch testdir/README
git add .
git commit -m 'test commit'
git push origin master
</pre>
<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
<p>This two environment variables are usefull to avoid problems checking out your repository:</p>
<pre class="brush: bash; title: ; notranslate">
# Disable SSL Certificate verification,
# usefull with self-signed certificates
export GIT_SSL_NO_VERIFY=true

# Activates verbosity for HTTP Requests
export GIT_CURL_VERBOSE=1
</pre>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2011/08/26/git-over-http-git-http-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ChiliProject 1.4.0 + Ruby Enterprise + Passenger + Apache2</title>
		<link>http://p0l0.binware.org/index.php/2011/05/30/redmine-1-2-ruby-enterprise-passenger-apache2/</link>
		<comments>http://p0l0.binware.org/index.php/2011/05/30/redmine-1-2-ruby-enterprise-passenger-apache2/#comments</comments>
		<pubDate>Mon, 30 May 2011 18:29:43 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[chiliproject]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=732</guid>
		<description><![CDATA[I was a happy Trac user, but after seeing Redmine, I realized that Trac has many missing features and that you must do a lot of things with plugins, Redmine has this features out-of-box. After working a bit with Redmine I discovered ChiliProject, which is a fork of Redmine, and its actually compatible with Redmine [...]]]></description>
			<content:encoded><![CDATA[<p>I was a happy <a href="http://trac.edgewall.org/" target="_blank">Trac</a> user, but after seeing <a href="http://www.redmine.org/" target="_blank">Redmine</a>, I realized that Trac has many missing features and that you must do a lot of things with plugins, Redmine has this features out-of-box. After working a bit with Redmine I discovered <a href="https://www.chiliproject.org/" target="_blank">ChiliProject</a>, which is a <a href="https://www.chiliproject.org/projects/chiliproject/wiki/Why_Fork" target="_blank">fork</a> of Redmine, and its actually compatible with Redmine <a href="http://www.redmine.org/projects/redmine/wiki/Theme_List" target="_blank">Themes</a> and <a href="http://www.redmine.org/plugins" target="_blank">Plugins</a>.</p>
<p>Here is a comparison of Redmine/ChiliProject and Trac features:<br />
<span id="more-732"></span></p>
<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
<table>
<tr>
<th>Feature</th>
<th>Redmine/ChiliProject</th>
<th>Trac</th>
</tr>
<tr>
<td>Multiple projects support</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (with plugin, planned 0.14)</td>
</tr>
<tr>
<td>Flexible role based access control</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No</td>
</tr>
<tr>
<td>Flexible issue tracking system</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">Yes (no bulk ticket changes and ticket dependencies)</td>
</tr>
<tr>
<td>Gantt chart and calendar</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No (<a href="http://trac-hacks.org/wiki/GanttCalendarPlugin" target="_blank" style="color: red;">GanttCalendarPlugin</a>)</td>
</tr>
<tr>
<td>Feeds &#038; email notifications</td>
<td style="color: green;">Yes</td>
<td style="color: red;">Yes</td>
</tr>
<tr>
<td>Per project wiki</td>
<td style="color: green;">Yes</td>
<td style="color: red;">Yes</td>
</tr>
<tr>
<td>Per project forums</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No (<a href="http://trac-hacks.org/wiki/DiscussionPlugin" target="_blank" style="color: red;">DiscussionPlugin</a>)</td>
</tr>
<tr>
<td>Time tracking</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac.edgewall.org/wiki/TimeTracking" target="_blank" style="color: orange;">Plugins or custom field</a>)</td>
</tr>
<tr>
<td>Custom fields for issues, time-entries, projects and users</td>
<td style="color: green;">Yes</td>
<td style="color: green;">Yes (<a href="http://trac.edgewall.org/wiki/TracTicketsCustomFields" target="_blank" style="color: green;">editing trac.ini</a>)</td>
</tr>
<tr>
<td>SCM integration</td>
<td style="color: green;">SVN, CVS, Git, Mercurial, Bazaar and Darcs</td>
<td style="color: orange;">SVN in core, others with Plugins</td>
</tr>
<tr>
<td>Issue creation via email</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac-hacks.org/wiki/MailToTracPlugin" target="_blank" style="color: orange;">MailToTracPlugin</a>)</td>
</tr>
<tr>
<td>Multiple LDAP authentication support</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac-hacks.org/wiki/LdapPlugin" target="_blank" style="color: orange;">LDAPPlugin</a>)</td>
</tr>
<tr>
<td>User self-registration support</td>
<td style="color: green;">Yes</td>
<td style="color: orange;">No (<a href="http://trac-hacks.org/wiki/AccountManagerPlugin" target="_blank" style="color: orange;">AccountManagerPlugin</a>)</td>
</tr>
<tr>
<td>Multilanguage support</td>
<td style="color: green;">Yes</td>
<td style="color: green;">Yes</td>
</tr>
<tr>
<td>Multiple databases support</td>
<td style="color: green;">MySQL, PostgreSQL, SQLite</td>
<td style="color: orange;">MySQL (unstable), PostgreSQL, SQLite</td>
</tr>
<tr>
<td>iPhone/Android Apps</td>
<td style="color: green;">Yes</td>
<td style="color: red;">No</td>
</tr>
</table>
<p>The first thing that made me not to test Redmine/ChiliProject immediately was that it is RoR and the complexity to make it run stable under apache, but after searching a bit, I found <a href="http://www.modrails.com/" target="_blank">Phusion Passenger</a> and <a href="http://www.rubyenterpriseedition.com/" target="_blank">Ruby Enterprise</a>, which is a very good solution to run RoR products stable under Apache, and you have the ability to run Ruby with custom user, usefull for shared environments.</p>
<h3>Installation</h3>
<ol>
<li>
<p>Ruby Enterprise</p>
<p>I downloaded and installer from source code, so that it&#8217;s compiled for my server and I can store it in a specific location. So, the first we have to do is download latest version from <a href="http://www.rubyenterpriseedition.com/download.html" target="_blank">Ruby Enterprise Download page</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyenterpriseedition.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span>.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span>
.<span style="color: #000000; font-weight: bold;">/</span>installer</pre></div></div>

<p>Follow installer instructions, and install dependencies if needed (the installer tells us which packages we need for our Linux distro)</p>
</li>
<li>
<p>Phusion Passenger</p>
<p>Next thing to do, is install the Passanger module for apache, this can be done with the <em>passenger-install-apache2-module</em> script available at Ruby Enterprise installation</p>

<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>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin
.<span style="color: #000000; font-weight: bold;">/</span>passenger-install-apache2-module</pre></div></div>

<p>This script also checks the dependencies and says what packages you need for your Linux distro</p>
</li>
<li>
<p>Apache</p>
<p>Now we need to configure apache, first we need to activate and configure the passenger module</p>
<p><strong>/etc/apache2/mods-enabled/passenger.load</strong></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">LoadModule</span> passenger_module /opt/ruby-enterprise-1.8.7-<span style="color: #ff0000;">2011.03</span>/lib/ruby/gems/<span style="color: #ff0000;">1.8</span>/gems/passenger-3.0.7/ext/apache2/mod_passenger.so</pre></div></div>

<p><strong>/etc/apache2/mods-enabled/passenger.conf</strong></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">ifmodule</span> mod_passenger.c&gt;
  PassengerRoot /opt/ruby-enterprise-1.8.7-<span style="color: #ff0000;">2011.03</span>/lib/ruby/gems/<span style="color: #ff0000;">1.8</span>/gems/passenger-3.0.7
  PassengerRuby /opt/ruby-enterprise-1.8.7-<span style="color: #ff0000;">2011.03</span>/bin/ruby
&nbsp;
  PassengerFriendlyErrorPages <span style="color: #0000ff;">Off</span>
  PassengerUserSwitching <span style="color: #0000ff;">On</span>
  PassengerDefaultUser www-data
  PassengerDefaultGroup www-data
&lt;/<span style="color: #000000; font-weight:bold;">ifmodule</span>&gt;</pre></div></div>

<p>And the last thing is configure a vhost under which we will run this ChiliProject installation</p>
<p><strong>/etc/apache2/sites-enabled/chiliproject</strong></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">NameVirtualHost</span> *:<span style="color: #ff0000;">443</span>
&lt;<span style="color: #000000; font-weight:bold;">virtualhost</span> *:<span style="color: #ff0000;">443</span>&gt;
	<span style="color: #00007f;">SSLEngine</span> <span style="color: #0000ff;">on</span>
&nbsp;
	<span style="color: #00007f;">SSLCertificateFile</span>    /etc/apache2/ssl/server.crt
	<span style="color: #00007f;">SSLCertificateKeyFile</span> /etc/apache2/ssl/server.key
&nbsp;
	&lt;<span style="color: #000000; font-weight:bold;">ifmodule</span> mod_passenger.c&gt;
		PassengerUser chiliproject
		PassengerGroup chiliproject
	&lt;/<span style="color: #000000; font-weight:bold;">ifmodule</span>&gt;
&nbsp;
        <span style="color: #00007f;">ServerAdmin</span> webmaster@chiliproject.org
	<span style="color: #00007f;">ServerName</span> chiliproject.org
&nbsp;
	<span style="color: #00007f;">DocumentRoot</span> /home/chiliproject/public
	&lt;<span style="color: #000000; font-weight:bold;">directory</span> /&gt;
		<span style="color: #00007f;">Options</span> -MultiViews
		<span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">All</span>
	&lt; /Directory&gt;
&nbsp;
	<span style="color: #00007f;">ErrorLog</span> /var/log/apache2/chiliproject-error.log
&nbsp;
	<span style="color: #00007f;">CustomLog</span> /var/log/apache2/chiliproject-access.log combined
&lt;/<span style="color: #000000; font-weight:bold;">virtualhost</span>&gt;</pre></div></div>

</li>
<li>
<p>ChiliProject</p>
<p>First install needed gems</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span>=0.4.2 i18n
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span>=1.0.1 rack
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql</pre></div></div>

<p>Download the last available ChiliProject version from <a href="https://www.chiliproject.org/projects/chiliproject/files" target="_blank">ChiliProject Files Page</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> https:<span style="color: #000000; font-weight: bold;">//</span>www.chiliproject.org<span style="color: #000000; font-weight: bold;">/</span>attachments<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">/</span>chiliproject-1.4.0.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf chiliproject-1.4.0.tar.gz
<span style="color: #c20cb9; font-weight: bold;">mv</span> chiliproject-1.4.0 <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chiliproject</pre></div></div>

<p>Create the mysql database and user for ChiliProject</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> chiliproject <span style="color: #993333; font-weight: bold;">CHARACTER</span> <span style="color: #993333; font-weight: bold;">SET</span> utf8 <span style="color: #993333; font-weight: bold;">COLLATE</span> utf8_unicode_ci;
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> privileges <span style="color: #993333; font-weight: bold;">ON</span> chiliproject<span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'chiliproject'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'my_password'</span>;</pre></div></div>

<p>Configure ChiliProject Database Connection</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml.example config<span style="color: #000000; font-weight: bold;">/</span>database.yml</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="yml" style="font-family:monospace;">production:
  adapter: mysql
  database: chiliproject
  host: localhost
  username: chiliproject
  password: my_password</pre></div></div>

<p>Now initialize ChiliProject (session Store, DB Tables, DB Default Data</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake generate_session_store
<span style="color: #007800;">RAILS_ENV</span>=production <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake db:migrate
<span style="color: #007800;">RAILS_ENV</span>=production <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake redmine:load_default_data</pre></div></div>

<p>And the last thing we need to do before we can restart apache and begin to use the new installed ChiliProject, we need to create the <em>chiliproject</em> user</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>home<span style="color: #000000; font-weight: bold;">/</span>chiliproject <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> chiliproject
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> chiliproject:chiliproject <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chiliproject</pre></div></div>

</li>
<div style="margin-left: -40px;">
<div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
</div>
<li>
<p>(Optinal) Rmagick</p>
<p>If we would like to enable Gantt export to png image we need to install Rmagick (available as gem). First we need to install imagemagick ang graphicsmagick dev packages and then we can install the rmagick gem.</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> libmagickcore-dev libgraphicsmagick1-dev libmagickwand-dev
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2011.03</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> rmagick</pre></div></div>

</li>
</ol>
<p>Now we only need to restart Apache and load ChiliProject in our Browser. The default user is <em><strong>admin/admin</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2011/05/30/redmine-1-2-ruby-enterprise-passenger-apache2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>SpiderMonkey is the code-name for the Mozilla&#8217;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>
<p><span id="more-693"></span></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><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
<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 &#8220;<strong>Ctrl+D</strong>&#8220;.</p>
<p>It&#8217;s important to note that in spidermonkey you doesn&#8217;t have the &#8220;<strong>document</strong>&#8221; 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>

<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
]]></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 [...]]]></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>&#8220;ImportError: No module named simplejson&#8221;</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>

<p><div style="margin-left: -20px; margin-top: 20px; margin-bottom: 20px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-5682258244719056";
/* Inline Post */
google_ad_slot = "6946080416";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></p>
]]></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>5</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 &#8220;user&#8221; and roundcube will authenticate against IMAP using the domain extracted from the webmail URL. You can get download the plugin [...]]]></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 &#8220;user&#8221; 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>
]]></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 [...]]]></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&#8217;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&#8217;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>

]]></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 &#8220;FIRMAR Y ENVIAR&#8221;, me sale un bonito mensaje que dice &#8220;ha genereado una firma no valida&#8221; 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>
]]></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 &#8220;<a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster.html" target="_new">MySQL Cluster</a>&#8220;</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 &#8220;<strong>File</strong>&#8221; y &#8220;<strong>Position</strong>&#8220;, que lo necesitaremos para ponerselo al esclavo, en caso de que salga en blanco &#8220;<strong>File</strong>&#8221; es <strong>&#8221;</strong> y &#8220;<strong>Position</strong>&#8221; 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>;
<span style="color: #993333; font-weight: bold;">START</span> slave;</pre></div></div>

]]></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 [...]]]></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>

]]></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, *~&#8230; encuentras [...]]]></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, *~&#8230; 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 &#8220;src=javascript&#8221; 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 &#8216; el error cambia a &#8220;Error Sql&#8221;, por lo tanto con un sencillo &#8220;&#8216; OR 1=1 &#8212; a&#8221; 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 &#8220;login/index&#8221; 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 &#8220;configdir&#8221;. Haciendo un ls ves que hay un fichero &#8220;instructions-next-level.pl&#8221;, haciendole un simple &#8220;cat&#8221; 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 &#8220;john the ripper&#8221; crackeas la contraseña y consigues acceso a la maquina. Una vez dentro de la maquina, buscando un poco te encuentras con un fichero &#8220;getsh&#8221; (el codigo fuente esta incluido en el fichero) con suid en &#8220;/opt/&#8230;/&#8221;. Analizando el fichero con un editor normal o un editor hexadecimal, encuentras el string &#8220;/opt/&#8230;/theshell&#8221;, y basta con copiar el fichero &#8220;mysh&#8221; a &#8220;theshell&#8221; y ejecutas el &#8220;getsh&#8221; y ya eres root.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2006/12/11/hackerquiz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

