<?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>Anthony Dahanne's blog &#187; apache2</title>
	<atom:link href="http://blog.dahanne.net/category/apache2/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dahanne.net</link>
	<description>Open Source Software, Java, Ruby, Agility</description>
	<lastBuildDate>Tue, 20 Jul 2010 13:11:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Installer PHP 5.3.1 sur Ubuntu Karmic koala 9.10</title>
		<link>http://blog.dahanne.net/2009/11/21/installer-php-5-3-1-sur-ubuntu-karmic-koala-9-10/</link>
		<comments>http://blog.dahanne.net/2009/11/21/installer-php-5-3-1-sur-ubuntu-karmic-koala-9-10/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 15:37:38 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[apache2]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/?p=274</guid>
		<description><![CDATA[J'ai récemment voulu installer sur mon serveur web le  [...]]]></description>
			<content:encoded><![CDATA[<p>J&#8217;ai récemment voulu installer sur mon serveur web le <a href="http://trac.openwebreader.org/">(tout nouveau) agrégateur de flux RSS (avec API distante REST) OpenWebReader</a>.<br />
L&#8217;auteur, pour avoir un développement plus aisé et moderne, a choisi la dernière version de PHP, 5.3<br />
Sauf que sur Ubuntu 9.10, la version de PHP packagée est la 5.2.6<br />
En général, dans ces cas, on a plutôt le réflexe de mettre à jour ses dépôts, dans /etc/apt/sources.list et de rajouter le dépôt qui va bien, qui rajoute en l&#8217;occurrence php 5.3.<br />
C&#8217;est bien ce que j&#8217;avais commencé à faire, <a href="http://www.dotdeb.org/2009/07/03/php-5-3-0-final-preview-packages-available-for-debian-lenny/">en suivant ce billet</a>.<br />
Mais malheureusement, plein de dépendances ont sauté : phpmyadmin, apache2-mod-php5, etc&#8230; du coup, machine arrière vers PHP 5.2.6 <img src='http://blog.dahanne.net/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /><br />
Retour aux sources, j&#8217;ai téléchargé sur php.net la version 5.3.1 de PHP</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>us3.php.net<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>php-5.3.1.tar.gz<span style="color: #000000; font-weight: bold;">/</span>from<span style="color: #000000; font-weight: bold;">/</span>this<span style="color: #000000; font-weight: bold;">/</span>mirror</pre></div></div>

<p>, je l&#8217;ai détarré dans mon home directory :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz php-5.3.1.tar.gz</pre></div></div>

<p>et avant de le compiler, je suis allé chercher tout plein de librairies :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2 apache2-mpm-prefork apache2-prefork-dev apache2-utils apache2.2-common mysql-client mysql-client-<span style="color: #000000;">5.1</span> mysql-common mysql-server mysql-server-<span style="color: #000000;">5.1</span> mysql-server-core-<span style="color: #000000;">5.1</span> libtidy-dev curl libcurl4-openssl-dev libcurl3 libcurl3-gnutls zlib1g zlib1g-dev libxslt1-dev libzip-dev libzip1 libxml2 libsnmp-base libsnmp15 libxml2-dev libsnmp-dev libjpeg62 libjpeg62-dev libpng12-<span style="color: #000000;">0</span> libpng12-dev zlib1g zlib1g-dev libfreetype6 libfreetype6-dev libbz2-dev libxpm4-dev libmcrypt-dev libmcrypt4 libicu-dev</pre></div></div>

<p>et là, dans mon répertoire de php 5.3.1 , j&#8217;ai pu compiler :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span>  php-5.3.1
$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-apxs2</span>=<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>apxs2 <span style="color: #660033;">--with-mysql</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-mysqli</span>=<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>mysql_config <span style="color: #660033;">--with-tidy</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-curl</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #660033;">--with-curlwrappers</span> <span style="color: #660033;">--with-openssl-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-zlib-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--with-pdo-pgsql</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-pdo-mysql</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-xsl</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-ldap</span> <span style="color: #660033;">--with-xmlrpc</span> <span style="color: #660033;">--with-iconv-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-snmp</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-exif</span> <span style="color: #660033;">--enable-calendar</span> <span style="color: #660033;">--with-bz2</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-mcrypt</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-gd</span> <span style="color: #660033;">--with-jpeg-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-png-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-zlib-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-freetype-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--enable-zip</span> <span style="color: #660033;">--with-pear</span> <span style="color: #660033;">--enable-intl</span> <span style="color: #660033;">--with-gettext</span>=<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><span style="color: #c20cb9; font-weight: bold;">gettext</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>Si vous avez un problème lors du configure c&#8217;est qu&#8217;il vous manque une librairie&#8230;<br />
Ensuite, maintenant que l&#8217;on a une version de Php 5.3.1 compilé, il faut la référencer à Apache2, et pour ne rien casser aux dépendances, on trafique juste une petit peu /etc/apache2/mods-available/php5.load :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LoadModule php5_module <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>anthony<span style="color: #000000; font-weight: bold;">/</span>php-5.3.1<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>libphp5.so</pre></div></div>

<p>et là, le tour est joué, il suffit de redémarrer Apache2 pour que Php 5.3.1 soit chargé.<br />
En fait, je me suis beaucoup inspiré de<a href="http://www.brandonsavage.net/installing-php-5-3-on-ubuntu/"> ce billet</a>, sauf qu&#8217;à la fin, je vous conseille de ne pas faire le make install, car votre système risque de ne plus être en cohérence avec les dépots</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2009/11/21/installer-php-5-3-1-sur-ubuntu-karmic-koala-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation de CGI Proxy, solution de proxy http</title>
		<link>http://blog.dahanne.net/2007/03/09/installation-de-cgi-proxy-solution-de-proxy-http/</link>
		<comments>http://blog.dahanne.net/2007/03/09/installation-de-cgi-proxy-solution-de-proxy-http/#comments</comments>
		<pubDate>Thu, 08 Mar 2007 23:11:14 +0000</pubDate>
		<dc:creator>anthony.dahanne</dc:creator>
				<category><![CDATA[apache2]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.dahanne.net/2007/03/09/installation-de-cgi-proxy-solution-de-proxy-http/</guid>
		<description><![CDATA[Ce tutorial vous expliquera comment mettre en oeuvre de [...]]]></description>
			<content:encoded><![CDATA[<p>Ce tutorial vous expliquera comment mettre en oeuvre derrière Apache 2 le script CGI Proxy qui peut vous servir aussi bien à surfer anonyme (désactivation de scripts pendant la navigation), à accéder aux serveurs web de machine situées dans un réseau local, à contrer la censure &#8230;</p>
<h3>Installer simplement CGI Proxy (sans SSL)</h3>
<p>Tout d&#8217;abord, vous devez avoir les logiciels suivants installés sur votre machine:<br />
-un serveur sous Linux(çà devrait marcher sur tous les OS&#8230;)<br />
-Apache2 (un autre serveur web devrait faire l&#8217;affaire mais je n&#8217;ai pas testé&#8230;)<br />
-Perl<br />
Des commandes comme :<br />
<code>#apt-get install perl apache2</code><br />
devrait plus ou moins régler les choses sur Debian et les Debian-like&#8230;<br />
Pour la suite de l&#8217;article, je suppose que vous utilisez une distribution Debian Sarge.</p>
<p>Dirigez vous vers /etc/apache2/sites-available<br />
<code>#cd /etc/apache2/sites-available</code></p>
<p>Créez un nouveau site web, disons que vous avez le nom de domaine test.fr, créez ainsi le sous domaine cgiproxy.test.fr  :<br />
<code>#vim cgiproxy.test.fr</code></p>
<p>et insérez les lignes suivantes : </p>
<div class="code">
&lt;VirtualHost *&gt;<br />
    ServerAdmin admin@test.fr<br />
    DocumentRoot /var/www/cgiproxy.test.fr<br />
    ServerName cgiproxy.test.fr<br />
    ErrorLog /var/log/apache2/cgiproxy.test.fr.error.log<br />
    CustomLog /var/log/apache2/cgiproxy.test.fr.access.log common<br />
    AddHandler cgi-script .cgi<br />
&lt;Directory /var/www/cgiproxy.test.fr&gt;<br />
            AllowOverride FileInfo AuthConfig Limit<br />
            Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec<br />
            Order allow,deny<br />
            Allow from all<br />
            Options +ExecCGI<br />
&lt;/Directory&gt;<br />
&lt;/VirtualHost&gt;
</div>
<p>Pour que ce nouveau site soit fonctionne, n&#8217;oubliez de faire un lien symbolique de cette configuration dans /etc/apache2/sites-enabled :<br />
<code>#cd /etc/apache2/sites-enabled<br />
#ln -s /etc/apache2/sites-available/cgiproxy.test.fr</code></p>
<p>et de bien sûr créer le répertoire désigné dans votre configuration:<br />
<code>#mkdir /var/www/cgiproxy.test.fr</code></p>
<p>On redémarre Apache2 pour que la configuration soit prise en compte :<br />
<code>#/etc/init.d/apache2 restart</code></p>
<p><i>Petite note pour ceux qui n&#8217;ont pas de nom de domaine ou ne sachant pas comment créer un site sous Apache 2 :</i><br />
Vous avez sans doute dans /etc/apache2/sites-available un site (fichier de configuration) qui s&#8217;appelle 000-default, qui pointe vers des fichiers dans /var/www : vous pouvez aussi bien l&#8217;utiliser en adaptant cet article (chemins et sites)</p>
<p>Rendez vous dans /var/www/cgiproxy.test.fr et téléchargez le script CGI CGI Proxy :<br />
<code>#wget http://www.jmarshall.com/tools/cgiproxy/releases/cgiproxy.2.1beta15.tar.gz</code></p>
<p><i>Pour avoir la dernière version, veuillez consulter le site officiel <a href="http://www.jmarshall.com/tools/cgiproxy/">CGI Proxy</a></i></p>
<p>On décompresse l&#8217;archive ainsi récupérée :<br />
<code>#tar xvzf  cgiproxy.2.1beta15.tar.gz</code></p>
<p>Et si tout s&#8217;est bien passé, en dirigeant son navigateur vers http://cgiproxy.test.fr/nph-proxy.cgi on doit avoir le formulaire de saisie d&#8217;URL de CGI Proxy !<br />
Si toutefois cela ne fonctionne pas, n&#8217;hésitez pas à laisser un commentaire à cet article, mais commencez par vérifier :<br />
-que vos chemins sont bons<br />
-que vous n&#8217;avez pas renommé nph-proxy.cgi en quelquechose.cgi (il faut impérativement que le nom du fichier commence par nph-)<br />
-que le script est exécutable :<br />
<code>#chmod +x nph-proxy.cgi</code></p>
<h3>Installer CGI Proxy en mod ssl :</h3>
<p>Un peu plus difficile cette fois-ci, cette partie de l&#8217;article s&#8217;adresse aux personnes ayant déjà mis en place des sites Apache2 en mod_ssl.(un jour j&#8217;écrirai un article pour l&#8217;expliquer !).<br />
Pour faire simple, et rapide, inspirez vous de mon fichier de configuration :</p>
<div class="code">
&lt;VirtualHost *:443&gt;<br />
    ServerAdmin admin@cgiproxy.test.fr<br />
    DocumentRoot /var/www/cgiproxy.test.fr<br />
    ServerName cgiproxy.test.fr<br />
    ErrorLog /var/log/apache2/cgiproxy.test.fr.error.log<br />
    CustomLog /var/log/apache2/cgiproxy.test.fr.access.log common<br />
    AddHandler cgi-script .cgi<br />
 SSLEngine On<br />
 SSLCertificateFile /etc/apache2/ssl/apache.pem<br />
 SSLProxyEngine On<br />
&lt;Directory /var/www/cgiproxy.test.fr&gt;<br />
            AllowOverride FileInfo AuthConfig Limit<br />
            Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec<br />
            DirectoryIndex nph-protected.cgi<br />
            AuthUserFile /var/www/cgiproxy.test.fr/.htpasswd<br />
            AuthName &laquo;&nbsp;Welcome to Protected Site&nbsp;&raquo;<br />
            AuthType Basic<br />
            Require valid-user<br />
                 Options +ExecCGI<br />
&lt;/Directory&gt;<br />
&lt;/VirtualHost&gt;
</div>
<p>Un peu d&#8217;explication !<br />
<code>&lt;VirtualHost *:443&gt;</code><br />
vous permet de déclarer un serveur virtuel écoutant sur le port 443 (https par défaut)<br />
<code>AddHandler cgi-script .cgi</code><br />
permet à Apache 2 de lancer le moteur d&#8217;interpréteur de CGI lorsque les fichiers demandés terminent par .cgi<br />
<code>DirectoryIndex nph-protected.cgi</code><br />
indique à apache que le fichier index par défaut est : nph-protected.cgi (situé dans /var/www/cgiproxy.test.fr) lorsque qu&#8217;aucun nom de fichier est spécifié.<br />
<code> AuthUserFile</code><br />
permet de mettre en place une sécuristation HTTP Basic (login/mot de passe demandé pour accéder à la ressource)</p>
<h3>Liens</h3>
<p><a href="http://http://httpd.apache.org/docs/2.0/">Le site de documentation d&#8217;Apache2</a><br />
<a href="http://www.jmarshall.com/tools/cgiproxy/">Le site officiel de CGI Proxy</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahanne.net/2007/03/09/installation-de-cgi-proxy-solution-de-proxy-http/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
