<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>Oxegena Support</title>
	<link>http://support.oxegena.ch/blog</link>
	<description>Développement et hébergement web</description>
	<pubDate>Fri, 12 Nov 2010 14:24:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>mp3 streaming via Apache et mod_flv</title>
		<link>http://support.oxegena.ch/blog/mp3-streaming-via-apache-et-mod_flv/28</link>
		<comments>http://support.oxegena.ch/blog/mp3-streaming-via-apache-et-mod_flv/28#comments</comments>
		<pubDate>Thu, 11 Nov 2010 21:45:24 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Plesk]]></category>

		<category><![CDATA[mp3 stream apache mod_flv flv]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/mp3-streaming-via-apache-et-mod_flv/28</guid>
		<description><![CDATA[Le streaming de mp3 peut être réalisé en utilisant une application dédiée comme Icecast. Cependant, l&#8217;installation d&#8217;une telle application peut s&#8217;avérer contraignante sur un serveur web exploitant Apache.
Alors pourquoi ne pas utiliser directement Apache comme serveur de streaming?
Cette option est viable à deux conditions:

se contenter d&#8217;un pseudo-streaming
gestion du timeshifting, soit possibilité d&#8217;écouter la fin d&#8217;un [...]]]></description>
			<content:encoded><![CDATA[<p>Le streaming de mp3 peut être réalisé en utilisant une application dédiée comme <a href="http://icecast.org/" title="Icecast mp3 streaming server">Icecast</a>. Cependant, l&#8217;installation d&#8217;une telle application peut s&#8217;avérer contraignante sur un serveur web exploitant Apache.</p>
<p>Alors pourquoi ne pas utiliser directement Apache comme serveur de streaming?</p>
<p>Cette option est viable à deux conditions:</p>
<ul>
<li><em>se contenter d&#8217;un pseudo-streaming</em><br />
gestion du timeshifting, soit possibilité d&#8217;écouter la fin d&#8217;un mp3 sans en avoir téléchargé le conten, mais aucune gestion de la bande passante</li>
<li><em>utiliser des fichiers flv<br />
</em>les mp3s devront être intégrés à un fichier flv (Adboe Flash Video Codec, ce qui peut allourdir le fichier audio d&#8217;environ 10%</li>
</ul>
<p>Premièrement, il est nécessaire d&#8217;installer le module mod_flv pour Apache. La démarche d&#8217;installation est décrite dans un précédent article: <a href="http://support.oxegena.ch/blog/apache-video-streaming-flv-et-mp4-h264-via-modules-open-source/24">Apache video streaming: flv et mp4 (H264) via modules open-source</a>.</p>
<p>Une fois ce module fonctionnel, il est nécessaire d&#8217;installer les logiciels <a href="http://www.ffmpeg.org/">ffmpeg</a> (encodage de vidéos) et <a href="http://yamdi.sourceforge.net/">yamdi</a> (injection de metadata dans le fichiers flv). L&#8217;installation sous CentOS 5.2 avec Plesk se déroule selon les étapes suivantes :</p>
<ol>
<li>Configurer yum pour utiliser le <a href="http://dag.wieers.com/rpm/">repository DAG</a></li>
<li>Exécuter la commande :<br />
yum install ffmpeg</li>
<li>Télécharger les dernières sources de yamdi sur le <a href="http://yamdi.sourceforge.net/">site de yamdi (sourceforge)</a> :
<pre>wget http://......../yamdi-1.6.tar.gz</pre>
</li>
<li>Décompresser et compiler yamdi :
<pre>tar xzf yamdi-1.6.tar.gz

cd yamdi-1.6

gcc yamdi.c -o yamdi -O2 -Wall</pre>
</li>
</ol>
<p>Tous les outils nécessaire sont désormais installés.</p>
<p>L&#8217;étape suivante consiste à intégrer le fichier audio mp3 d&#8217;origine à un fichier flv ne présentant qu&#8217;une image noire comme contenu vidéo. ffmpeg est utilisé pour l&#8217;encodage et l&#8217;intégration du fichier source, et yamdi pour la création de keyframes afin de permettre le pseudo-streaming sur le fichier de sortie au format flv.</p>
<p>Afin de se simplifier la vie, il est recommandé de créer un script shell réalisant ce travail, comme décrit dans la marche à suivre suivante :</p>
<ol>
<li>Créer le script shell :
<pre>vi mp3toflv.sh</pre>
</li>
<li>Contenu du script (<a href="http://www.oxegena.ch/resources/support/mp3toflv/mp3toflv.sh.txt">en téléchargement ici</a>) :
<pre>#!/bin/sh

ffmpeg -loop_input -f image2 -i black_video.png -r 1 -vcodec flv -i $1 -acodec copy -qscale 2 -g 5 -cmp 3 -subcmp 3 -mbd 2 $2 -shortest

yamdi -i $2 -o $2-tmp

rm $2mv $2-tmp $2</pre>
</li>
<li>Placer l&#8217;image black_video.png (<a href="http://www.oxegena.ch/resources/support/mp3toflv/black_video.png">en téléchargement ici</a>) dans le même dossier que le script mp3toflv.sh.</li>
<li>Donner les droits d&#8217;exécution au script:
<pre>chmod 755 mp3toflv.sh</pre>
</li>
</ol>
<p>L&#8217;appel à ce script se fait de la manière suivante:</p>
<pre>./mp3toflv.sh /path/to/source.mp3 /path/to/output.flv</pre>
<p>Une fois le fichier flv obtenu par cette méthode, il suffit de le lire avec un lecteur de mp3 en flash.<br />
Par exemple, le lecteur <a href="http://www.longtailvideo.com/players/jw-flv-player/">JW Player</a> qui peut être utilisé pour ne reproduire que du son.</p>
<p>Il est nécessaire de préciser dans la playlist xspf pour JW Player le mode de streaming par le biais d&#8217;une balise meta:</p>
<pre>
...
&lt;track&gt;
<blockquote>

&#8230;
&lt;location&gt;http://www.host.com/directory/file.flv&lt;/location&gt;
&lt;meta rel=&#8221;provider&#8221;&gt;http&lt;/meta&gt;
&#8230;</blockquote>

&lt;/track&gt;
&#8230;</pre>
<p>Cette méthode peut être testée par le biais de la <a href="http://www.supalame.com/radio/">radio SupaLame</a>, qui utilise ce modèle pour offrir le streaming de sessions audios d&#8217;une durée supérieure à 4h stockées en un seul fichier.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Fmp3-streaming-via-apache-et-mod_flv%2F28&amp;linkname=mp3%20streaming%20via%20Apache%20et%20mod_flv"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/mp3-streaming-via-apache-et-mod_flv/28/feed</wfw:commentRss>
		</item>
		<item>
		<title>Traduction des cantons suisses en français dans Magento</title>
		<link>http://support.oxegena.ch/blog/traduction-des-cantons-suisses-en-francais-dans-magento/27</link>
		<comments>http://support.oxegena.ch/blog/traduction-des-cantons-suisses-en-francais-dans-magento/27#comments</comments>
		<pubDate>Tue, 17 Aug 2010 23:05:38 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[Magento]]></category>

		<category><![CDATA[magento traduction français canton suisse]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/traduction-des-cantons-suisses-en-francais-dans-magento/27</guid>
		<description><![CDATA[Par défaut, les cantons suisses sont présentés en allemand dans Magento, et ce même après l&#8217;installation des traductions FR. Il est nécessaire d&#8217;exécuter le code SQL suivant pour ajouter les traductions françaises:
INSERT INTO `directory_country_region_name` (`locale`, `region_id`, `name`) VALUES
('fr_FR', 104, 'Argovie'),
('fr_FR', 105, 'Appenzell Rhodes-Intérieures'),
('fr_FR', 106, 'Appenzell Rhodes-Extérieures'),
('fr_FR', 107, 'Berne'),
('fr_FR', 108, 'Bâle-Campagne'),
('fr_FR', 109, 'Bâle-Ville'),
('fr_FR', 110, 'Fribourg'),
('fr_FR', 111, [...]]]></description>
			<content:encoded><![CDATA[<p>Par défaut, les cantons suisses sont présentés en allemand dans Magento, et ce même après l&#8217;installation des traductions FR. Il est nécessaire d&#8217;exécuter le code SQL suivant pour ajouter les traductions françaises:<code></code></p>
<p><code>INSERT INTO `directory_country_region_name` (`locale`, `region_id`, `name`) VALUES<br />
('fr_FR', 104, 'Argovie'),<br />
('fr_FR', 105, 'Appenzell Rhodes-Intérieures'),<br />
('fr_FR', 106, 'Appenzell Rhodes-Extérieures'),<br />
('fr_FR', 107, 'Berne'),<br />
('fr_FR', 108, 'Bâle-Campagne'),<br />
('fr_FR', 109, 'Bâle-Ville'),<br />
('fr_FR', 110, 'Fribourg'),<br />
('fr_FR', 111, 'Genève'),<br />
('fr_FR', 112, 'Glaris'),<br />
('fr_FR', 113, 'Grisons'),<br />
('fr_FR', 114, 'Jura'),<br />
('fr_FR', 115, 'Lucerne'),<br />
('fr_FR', 116, 'Neuchâtel'),<br />
('fr_FR', 117, 'Nidwald'),<br />
('fr_FR', 118, 'Obwald'),<br />
('fr_FR', 119, 'Saint-Gall'),<br />
('fr_FR', 120, 'Schaffhouse'),<br />
('fr_FR', 121, 'Soleure'),<br />
('fr_FR', 122, 'Schwytz'),<br />
('fr_FR', 123, 'Thurgovie'),<br />
('fr_FR', 124, 'Tessin'),<br />
('fr_FR', 125, 'Uri'),<br />
('fr_FR', 126, 'Vaud'),<br />
('fr_FR', 127, 'Valais'),<br />
('fr_FR', 128, 'Zoug'),<br />
('fr_FR', 129, 'Zurich');</code></p>
<p>Source: <a href="http://www.inthebox.ch/2009/06/25/494-gestion-des-cantons-dans-magento/">http://www.inthebox.ch/2009/06/25/494-gestion-des-cantons-dans-magento/</a> (offline) (<a href="http://webcache.googleusercontent.com/search?q=cache:d6Az0K_p82wJ:www.inthebox.ch/2009/06/25/494-gestion-des-cantons-dans-magento/+magento+traduction+canton+suisse&amp;cd=2&amp;hl=fr&amp;ct=clnk&amp;gl=ch&amp;client=firefox-a">cache</a>)</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Ftraduction-des-cantons-suisses-en-francais-dans-magento%2F27&amp;linkname=Traduction%20des%20cantons%20suisses%20en%20fran%C3%A7ais%20dans%20Magento"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/traduction-des-cantons-suisses-en-francais-dans-magento/27/feed</wfw:commentRss>
		</item>
		<item>
		<title>Prado, SQLMap, TRepeater et TPager: requêtes SQL personnalisées avec pagination</title>
		<link>http://support.oxegena.ch/blog/prado-sqlmap-trepeater-et-tpager-requetes-sql-personnalisees-avec-pagination/26</link>
		<comments>http://support.oxegena.ch/blog/prado-sqlmap-trepeater-et-tpager-requetes-sql-personnalisees-avec-pagination/26#comments</comments>
		<pubDate>Thu, 22 Jul 2010 20:14:43 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Prado]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/prado-sqlmap-trepeater-et-tpager-requetes-sql-personnalisees-avec-pagination/26</guid>
		<description><![CDATA[En utilisant les classes métiers standards de Prado, je n&#8217;ai pas trouvé moyen d&#8217;exploiter correctement une relation de type &#8220;plusieurs à plusieurs&#8221; (many to many) avec la méthode &#8220;withXXXX($critere, $value)&#8221;. Mon problème était simple: la méthode &#8220;withXXXX()&#8221; utilise une sous-requête pour récupérer les éléments dépendants d&#8217;une relation à la place d&#8217;un &#8220;INNER JOIN&#8221;. Il m&#8217;est [...]]]></description>
			<content:encoded><![CDATA[<p>En utilisant les classes métiers standards de Prado, je n&#8217;ai pas trouvé moyen d&#8217;exploiter correctement une relation de type &#8220;plusieurs à plusieurs&#8221; (many to many) avec la méthode &#8220;withXXXX($critere, $value)&#8221;. Mon problème était simple: la méthode &#8220;withXXXX()&#8221; utilise une sous-requête pour récupérer les éléments dépendants d&#8217;une relation à la place d&#8217;un &#8220;INNER JOIN&#8221;. Il m&#8217;est apparu impossible de récupérer seulement les éléments ayants une relation existante.</p>
<p>Pour illustrer ce cas, prenons mes 2 entités:</p>
<ul>
<li>VideoRecord</li>
<li>CategorieRecord</li>
</ul>
<p>Une vidéo peut être associée à plusieurs catégories, et une catégorie peut être associées à plusieurs vidéos. (many to many)<br />
Si je désire récupérer toutes les vidéos appartenant à la catégorie avec l&#8217;id 2, je vais utiliser cette méthode:<br />
<code>VideoRecord::finder()-&gt;withCategories('id = ?', 2)-&gt;findAll()</code></p>
<p>Cette méthode va me retourner tous les objets vidéos, avec une valeur null sur la propriété category lorsque cette dernière ne correspond pas à l&#8217;id 2.</p>
<p>Afin de palier à cette problématique tout en optimisant mes requêtes SQL, j&#8217;ai découvert les SQLMap avec Prado, qui permettent de gérer des requêtes SQL entièrement personnalisées. L&#8217;unique difficulté réside dans la gestion de la pagination pour les requêtes stockées dans les SQLMaps en utilisant des contrôles de type TRepeater et TPager.</p>
<p>La marche à suivre ci-après résume la création des SQLMaps et l&#8217;adaptation d&#8217;un contrôle contenant un TRepeater et un TPager avec les entités décrites précédemment (VideoRecord et CategorieRecord).</p>
<ol>
<li>Dans le fichier protected/application.xml, ajouter entre &lt;modules&gt; et &lt;/modules&gt;:<br />
<code>&lt;module id="sqlmap" class="System.Data.SqlMap.TSqlMapConfig" EnableCache="false"<br />
ConfigFile="Application.database.sqlmap" ConnectionID="dbVod" /&gt;<br />
</code>(pensez à modifier la propriété ConnectionID en fonction de votre configuration)</li>
<li>Créer un fichier protected/database/sqlmap.xml avec le contenu suivant:<br />
<code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;<br />
&lt;sqlMapConfig&gt;<br />
&lt;sqlMap resource="maps/VideoRecord.xml" /&gt;<br />
&lt;/sqlMapConfig&gt;</code></li>
<li>Créer un fichier protected/database/maps/VideoRecord.xml avec le contenu suivant:<br />
<code>&lt;sqlMapConfig&gt;<br />
&lt;select id="SelectVideosByCategoryAndStatus" resultClass="VideoRecord"<br />
parameterClass="SelectVideosByCategoryAndStatus_Param_Item"&gt;<br />
select     v.*<br />
from     video as v<br />
inner join categorie_video as c on v.id = c.id_video<br />
where     c.id_categorie = #idCategorie#<br />
and        v.id_status = #idStatus#<br />
order by #orderBy# #order#<br />
&lt;/select&gt;<br />
&lt;select id="SelectVideosByCategoryAndStatus_Pager" resultClass="VideoRecord"<br />
parameterClass="SelectVideosByCategoryAndStatus_Param_Item"&gt;<br />
select     v.*<br />
from     video as v<br />
inner join categorie_video as c on v.id = c.id_video<br />
where     c.id_categorie = #idCategorie#<br />
and        v.id_status = #idStatus#<br />
order by #orderBy# #order#<br />
limit     #limit# offset #offset#<br />
&lt;/select&gt;<br />
&lt;select id="SelectVideosByCategoryAndStatus_Counter" resultClass="int"<br />
parameterClass="SelectVideosByCategoryAndStatus_Param_Item"&gt;<br />
select     count(v.id)<br />
from     video as v<br />
inner join categorie_video as c on v.id = c.id_video<br />
where     c.id_categorie = #idCategorie#<br />
and        v.id_status = #idStatus#<br />
&lt;/select&gt;<br />
&lt;/sqlMapConfig&gt;</code><br />
Notes: 3 requêtes différentes sont utilisées, 1 pour récupérer tous les résultats, 1 pour récupérer une &#8220;page&#8221; de résultats et 1 pour déterminer le nb. total de résultats.</li>
<li>Editer le fichier protected/database/VideoRecord.php avec le contenu suivant:<br />
(Note: la classe SelectVideosByCategoryAndStatus_Param_Item représente les paramètres passés à la requête SQL. ATTENTION: si cette dernière n&#8217;est pas reconnue, il est nécessaire de la déclarer directement dans le contrôle qui l&#8217;utilise (par exemple au début du fichier /pages/controls/CategoriesListVideo.php).)</p>
<pre style="margin-top: 0pt; display: inline"><span style="color: #000000"><span style="color: #0000bb">

&lt;?php
</span><span style="color: #007700">class </span><span style="color: #0000bb">VideoRecord </span><span style="color: #007700">extends </span><span style="color: #0000bb">TActiveRecord
</span><span style="color: #007700">{
</span><span style="color: #0000bb">	const </span><span style="color: #0000bb">TABLE</span><span style="color: #007700">=</span><span style="color: #dd0000">&#8216;video&#8217;</span><span style="color: #007700">;

</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$id</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$title</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$description</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$date_added</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$duration_sec</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$views</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$id_publisher</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$id_status</span><span style="color: #007700">;
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$status</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$publisher</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$files</span><span style="color: #007700">=array(); 
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$categories</span><span style="color: #007700">=array(); 
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$tags</span><span style="color: #007700">=array();
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$videos</span><span style="color: #007700">=array();
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	public static </span><span style="color: #0000bb">$RELATIONS</span><span style="color: #007700">=array
    (
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #dd0000">&#8217;status&#8217; </span><span style="color: #007700">=&gt; array(</span><span style="color: #0000bb">self</span><span style="color: #007700">::</span><span style="color: #0000bb">BELONGS_TO</span><span style="color: #007700">, </span><span style="color: #dd0000">&#8216;VideoStatusRecord&#8217;</span><span style="color: #007700">),
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #dd0000">&#8216;publisher&#8217; </span><span style="color: #007700">=&gt; array(</span><span style="color: #0000bb">self</span><span style="color: #007700">::</span><span style="color: #0000bb">BELONGS_TO</span><span style="color: #007700">, </span><span style="color: #dd0000">&#8216;UserRecord&#8217;</span><span style="color: #007700">),
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #dd0000">&#8216;files&#8217; </span><span style="color: #007700">=&gt; array(</span><span style="color: #0000bb">self</span><span style="color: #007700">::</span><span style="color: #0000bb">HAS_MANY</span><span style="color: #007700">, </span><span style="color: #dd0000">&#8216;VideoFileRecord&#8217;</span><span style="color: #007700">, </span><span style="color: #dd0000">&#8216;id_video&#8217;</span><span style="color: #007700">),
        </span><span style="color: #dd0000">&#8216;categories&#8217; </span><span style="color: #007700">=&gt; array(</span><span style="color: #0000bb">self</span><span style="color: #007700">::</span><span style="color: #0000bb">MANY_TO_MANY</span><span style="color: #007700">, </span><span style="color: #dd0000">&#8216;CategorieRecord&#8217;</span><span style="color: #007700">, </span><span style="color: #dd0000">&#8216;categorie_video&#8217;</span><span style="color: #007700">),
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #dd0000">&#8216;tags&#8217; </span><span style="color: #007700">=&gt; array(</span><span style="color: #0000bb">self</span><span style="color: #007700">::</span><span style="color: #0000bb">MANY_TO_MANY</span><span style="color: #007700">, </span><span style="color: #dd0000">&#8216;TagRecord&#8217;</span><span style="color: #007700">, </span><span style="color: #dd0000">&#8216;tag_video&#8217;</span><span style="color: #007700">)
    );
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	public static function </span><span style="color: #0000bb">finder</span><span style="color: #007700">(</span><span style="color: #0000bb">$className</span><span style="color: #007700">=</span><span style="color: #0000bb">__CLASS__</span><span style="color: #007700">)
</span><span style="color: #0000bb">	{
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	return </span><span style="color: #0000bb">parent</span><span style="color: #007700">::</span><span style="color: #0000bb">finder</span><span style="color: #007700">(</span><span style="color: #0000bb">$className</span><span style="color: #007700">);
</span><span style="color: #0000bb">	}
}

</span><span style="color: #ff8000">/* sqlMap classes, see ./maps/VideoRecord.xml */
</span><span style="color: #007700">class </span><span style="color: #0000bb">SelectVideosByCategoryAndStatus_Param_Item
</span><span style="color: #007700">{
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$idCategorie</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$idStatus</span><span style="color: #007700">;
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$orderBy </span><span style="color: #007700">= </span><span style="color: #dd0000">&#8216;views&#8217;</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$order </span><span style="color: #007700">= </span><span style="color: #dd0000">&#8216;asc&#8217;</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$offset </span><span style="color: #007700">= </span><span style="color: #0000bb">0</span><span style="color: #007700">;
</span><span style="color: #0000bb">	public </span><span style="color: #0000bb">$limit </span><span style="color: #007700">= </span><span style="color: #0000bb">0</span><span style="color: #007700">;
}
</span><span style="color: #0000bb">?&gt;</span></span></pre>
</li>
<li>Le modèle du contrôle dans le fichier /pages/controls/CategoriesListVideo.tpl contient:<br />
<code>&lt;ul class="videoList"&gt;<br />
&lt;com:TRepeater ID="rpVideos"<br />
ItemRenderer="Application.pages.videos.CategoriesListVideoRenderer"<br />
AllowPaging="true"<br />
AllowCustomPaging="true"<br />
/&gt;<br />
&lt;/ul&gt;<br />
&lt;com:TPager ControlToPaginate="rpVideos" OnPageIndexChanged="pageChanged" /&gt;</code></li>
<li>Le code behind du contrôle dans le fichier /pages/controls/CategoriesListVideo.php contient:<br />
(Note: c&#8217;est dans ce contrôle que la gestion de la pagination est implémentée.)</p>
<pre style="margin-top: 0pt; display: inline"><span style="color: #000000"><span style="color: #0000bb">
&lt;?php
</span><span style="color: #007700">class </span><span style="color: #0000bb">CategoriesListVideo </span><span style="color: #007700">extends </span><span style="color: #0000bb">TTemplateControl </span><span style="color: #007700">{
</span><span style="color: #0000bb">	protected </span><span style="color: #0000bb">$ID_Category </span><span style="color: #007700">= </span><span style="color: #0000bb">0</span><span style="color: #007700">;
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	protected </span><span style="color: #0000bb">$sqlmap</span><span style="color: #007700">;
</span><span style="color: #0000bb">	protected </span><span style="color: #0000bb">$sqlmap_param</span><span style="color: #007700">;
</span><span style="color: #0000bb">	protected </span><span style="color: #0000bb">$PageSize </span><span style="color: #007700">= </span><span style="color: #0000bb">30</span><span style="color: #007700">;
</span><span style="color: #0000bb">	protected </span><span style="color: #0000bb">$NbVideos </span><span style="color: #007700">= </span><span style="color: #0000bb">0</span><span style="color: #007700">;
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	public function </span><span style="color: #0000bb">onInit</span><span style="color: #007700">(</span><span style="color: #0000bb">$param</span><span style="color: #007700">)
    {
        </span><span style="color: #0000bb">parent</span><span style="color: #007700">::</span><span style="color: #0000bb">onInit</span><span style="color: #007700">(</span><span style="color: #0000bb">$param</span><span style="color: #007700">);
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">ID_Category </span><span style="color: #007700">= (int)</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">Request</span><span style="color: #007700">[</span><span style="color: #dd0000">&#8216;id&#8217;</span><span style="color: #007700">];
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap </span><span style="color: #007700">= </span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">Application</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">Modules</span><span style="color: #007700">[</span><span style="color: #dd0000">&#8217;sqlmap&#8217;</span><span style="color: #007700">]-&gt;</span><span style="color: #0000bb">Client</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap_param </span><span style="color: #007700">= new </span><span style="color: #0000bb">SelectVideosByCategoryAndStatus_Param_Item</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap_param</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">idCategorie </span><span style="color: #007700">= </span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">ID_Category</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap_param</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">idStatus </span><span style="color: #007700">= </span><span style="color: #0000bb">2</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">NbVideos </span><span style="color: #007700">= </span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">queryForObject</span><span style="color: #007700">(</span><span style="color: #dd0000">&#8220;SelectVideosByCategoryAndStatus_Counter&#8221;</span><span style="color: #007700">, </span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap_param</span><span style="color: #007700">);
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">PageSize</span><span style="color: #007700">=</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">PageSize</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">VirtualItemCount </span><span style="color: #007700">= </span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">NbVideos</span><span style="color: #007700">;
 </span><span style="color: #0000bb">	</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">populateData</span><span style="color: #007700">();
    }
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	public function </span><span style="color: #0000bb">pageChanged</span><span style="color: #007700">(</span><span style="color: #0000bb">$sender</span><span style="color: #007700">,</span><span style="color: #0000bb">$param</span><span style="color: #007700">)
</span><span style="color: #0000bb">	{
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">CurrentPageIndex</span><span style="color: #007700">=</span><span style="color: #0000bb">$param</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">NewPageIndex</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">populateData</span><span style="color: #007700">();
</span><span style="color: #0000bb">	}
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	protected function </span><span style="color: #0000bb">populateData</span><span style="color: #007700">()
</span><span style="color: #0000bb">	{
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$offset</span><span style="color: #007700">=</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">CurrentPageIndex</span><span style="color: #007700">*</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">PageSize</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$limit</span><span style="color: #007700">=</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">PageSize</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	if(</span><span style="color: #0000bb">$offset</span><span style="color: #007700">+</span><span style="color: #0000bb">$limit </span><span style="color: #007700">&gt; </span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">VirtualItemCount</span><span style="color: #007700">)
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$limit</span><span style="color: #007700">=</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">VirtualItemCount</span><span style="color: #007700">-</span><span style="color: #0000bb">$offset</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">DataSource</span><span style="color: #007700">=</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">getVideos</span><span style="color: #007700">(</span><span style="color: #0000bb">$offset</span><span style="color: #007700">,</span><span style="color: #0000bb">$limit</span><span style="color: #007700">);
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">rpVideos</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">DataBind</span><span style="color: #007700">();
</span><span style="color: #0000bb">	}
</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	protected function </span><span style="color: #0000bb">getVideos</span><span style="color: #007700">(</span><span style="color: #0000bb">$offset</span><span style="color: #007700">, </span><span style="color: #0000bb">$limit</span><span style="color: #007700">)
</span><span style="color: #0000bb">	{</span><span style="color: #0000bb">	</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap_param</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">limit</span><span style="color: #007700">=</span><span style="color: #0000bb">$limit</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap_param</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">offset</span><span style="color: #007700">=</span><span style="color: #0000bb">$offset</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	if ((</span><span style="color: #0000bb">$offset </span><span style="color: #007700">&gt; </span><span style="color: #0000bb">0</span><span style="color: #007700">) &amp;&amp; (</span><span style="color: #0000bb">$limit </span><span style="color: #007700">&gt; </span><span style="color: #0000bb">0</span><span style="color: #007700">))
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	{
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$query_name </span><span style="color: #007700">= </span><span style="color: #dd0000">&#8216;SelectVideosByCategoryAndStatus_Pager&#8217;</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	}
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	else
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	{
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	</span><span style="color: #0000bb">$query_name </span><span style="color: #007700">= </span><span style="color: #dd0000">&#8216;SelectVideosByCategoryAndStatus&#8217;</span><span style="color: #007700">;
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	}
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">
</span><span style="color: #0000bb">	</span><span style="color: #0000bb">	return </span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">queryForList</span><span style="color: #007700">(</span><span style="color: #0000bb">$query_name</span><span style="color: #007700">, </span><span style="color: #0000bb">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000bb">sqlmap_param</span><span style="color: #007700">);
</span><span style="color: #0000bb">	}
}
</span><span style="color: #0000bb">?&gt;
</span></span></pre>
</li>
</ol>
<p>Basé sur ce même modèle, il est possible d&#8217;adapter toutes requêtes SQL à un contrôle de type TRepeater.</p>
<p>Source (EN): <a href="http://www.pradosoft.com/forum/index.php?topic=12784">http://www.pradosoft.com/forum/index.php?topic=12784 </a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Fprado-sqlmap-trepeater-et-tpager-requetes-sql-personnalisees-avec-pagination%2F26&amp;linkname=Prado%2C%20SQLMap%2C%20TRepeater%20et%20TPager%3A%20requ%C3%AAtes%20SQL%20personnalis%C3%A9es%20avec%20pagination"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/prado-sqlmap-trepeater-et-tpager-requetes-sql-personnalisees-avec-pagination/26/feed</wfw:commentRss>
		</item>
		<item>
		<title>DomainKeys Identified Mail (DKIM) - Plesk, Qmail, SpamAssassin &#038; DNS</title>
		<link>http://support.oxegena.ch/blog/domainkeys-identified-mail-dkim-plesk-qmail-spamassassin-dns/25</link>
		<comments>http://support.oxegena.ch/blog/domainkeys-identified-mail-dkim-plesk-qmail-spamassassin-dns/25#comments</comments>
		<pubDate>Tue, 09 Mar 2010 22:04:35 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[Plesk]]></category>

		<category><![CDATA[Qmail]]></category>

		<category><![CDATA[anti-spam]]></category>

		<category><![CDATA[dkim]]></category>

		<category><![CDATA[domain]]></category>

		<category><![CDATA[key]]></category>

		<category><![CDATA[signature]]></category>

		<category><![CDATA[spam]]></category>

		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/domainkeys-identified-mail-dkim-plesk-qmail-spamassassin-dns/25</guid>
		<description><![CDATA[Note: cette installation s’est déroulée sous Plesk 9.2 (CentOS 5.2) / SpamAssassin 3.2.5
L&#8217;implémentation de la norme DKIM au sein de Plesk est réalisable directement via l&#8217;interface d&#8217;administration. Cependant, dans le but d&#8217;en optimiser le fonctionnement, plusieurs éléments nécessitent une configuration appropriée.
Signature des messages sortants

Activer DKIM sous Plesk
Dans la page d&#8217;accueil de l&#8217;administrateur du serveur, dans [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: </em>cette installation s’est déroulée sous Plesk 9.2 (CentOS 5.2) / SpamAssassin 3.2.5</p>
<p>L&#8217;implémentation de la norme <a href="http://fr.wikipedia.org/wiki/DomainKeys_Identified_Mail">DKIM</a> au sein de Plesk est réalisable directement via l&#8217;interface d&#8217;administration. Cependant, dans le but d&#8217;en optimiser le fonctionnement, plusieurs éléments nécessitent une configuration appropriée.</p>
<p><strong>Signature des messages sortants</strong></p>
<ol>
<li><em>Activer DKIM sous Plesk</em><br />
Dans la page d&#8217;accueil de l&#8217;administrateur du serveur, dans le panneau &#8220;Serveur&#8221;, cliquer sur l&#8217;icône intitulé &#8220;Paramètres du serveur de messagerie&#8221;. Ensuite, sous la section &#8220;Protection anti-spam DomainKeys&#8221;, cocher les cases &#8220;Autoriser la signature des e-mails sortants&#8221; et &#8220;Vérifier les e-mails entrants&#8221;. Sauvegarder ces modifications en cliquant sur le bouton &#8220;OK&#8221;.<br />
(v. <a href="http://download1.parallels.com/Plesk/PPP9/Doc/en-US/plesk-9.3-administrators-guide/59433.htm">manuel Parallels Plesk</a>)<br />
<strong>Attention: </strong>par le biais de cette méthode, la signature des messages sortants est activée pour TOUS les domaines! Etant donné que chacun d&#8217;eux nécessite une configuration DNS spécifique, il est recommandé de désactiver par la suite cette option pour tous les domaines (tjs. dans l&#8217;interface Plesk: section &#8220;Domaines&#8221;, cocher tous les domaines, et cliquer sur &#8220;modifier&#8221;,  puis sélectionner &#8220;Désactiver&#8221; au niveau de &#8220;Utiliser le système de protection anti-spam DomainKeys pour signer les e-mails sortants&#8221;), et de la ré-activer au cas par cas.</li>
<li><em>Activer DKIM sous un domaine précis<br />
</em>Sélectionner un domaine, puis aller sous &#8220;Comptes de messagerie&#8221; &gt; &#8220;Paramètres du messagerie&#8221;.<br />
Cocher la case &#8220;Utiliser le système de protection anti-spam DomainKeys pour signer les e-mails sortants&#8221; et cliquer sur le bouton &#8220;OK&#8221;.</li>
<li><em>Récupérer la clé publique pour l&#8217;enregistrement DNS<br />
</em>A niveau du domaine, se rendre dans &#8220;Paramètres DNS&#8221;. Cliquer sur &#8220;Activer le service DNS&#8221; (si inactif).<br />
Une ligne intitulée &#8220;default._domainkey.DOMAINE.TLD&#8221; de type TXT est désormais présente.<br />
Copier sa valeur (&#8221;p=MHwwD&#8230;RclQIDAQAB;&#8221;) dans un fichier texte.</li>
<li><em>Configurer le serveur DNS (indépendant de Plesk)</em><br />
Dans la zone du domaine concerné:<br />
- Ajouter une entrée TXT nommée &#8220;_domainkey&#8221; avec comme valeur &#8220;o=~&#8221; (ceci est moins restrictif que la règle par défaut de Plesk, à savoir qu&#8217;elle veut signifier que &#8220;presque&#8221; tous les messages sortants sont signés).<br />
- Ajouter une entrée TXT nommée &#8220;default._domainkey.DOMAINE.TLD&#8221; avec comme valeur l&#8217;élément copié précédemment au point 3 dans un fichier texte (&#8221;p=MHwwD&#8230;RclQIDAQAB;&#8221;).<br />
Enregistrer la zone.<br />
<strong>Attention: </strong>ce point n&#8217;est utile que si votre serveur DNS n&#8217;est pas alimenté par Plesk (serveur DNS maître indépendant)</li>
<li><em>Test: Envoyer un email de votre domaine à un compte Yahoo ou GMail</em><br />
Dans l&#8217;en-tête du message, une ligne &#8220;DomainKey-Signature:&#8221; est présente, ainsi qu&#8217;une ligne &#8220;DomainKey-Status: good&#8221;.<br />
Si ce n&#8217;est pas le cas, contrôlé que la propagation des zones DNS s&#8217;est déroulée correctement après les modification au pt. 4.</li>
</ol>
<p><strong>Traitement des messages entrants</strong></p>
<ol>
<li><em>Installer SpamAssassin via le <a href="http://www.atomicorp.com/channels/">repository d&#8217;ART</a></em><br />
Une fois le repository ART ajouté à Yum, exécuter la commande<br />
<code>yum install spamassassin</code><br />
ou<br />
<code>yum update spamassassin</code></li>
<li><em>Mettre à jour les règles de SpamAssassin</em><br />
Exécuter les commandes<br />
<code>sa-update</code><br />
<code>service spamassassin restart</code><br />
<code>service psa-spamassassin restart</code></li>
<li><em>Installer les modules Perl Mail-DomainKeys et Mail-DKIM via le <a href="http://dag.wieers.com/rpm/">repository DAG</a></em><br />
Une fois le repository DAG ajouté à Yum, exécuter les commandes<br />
<code>yum install perl-Mail-DomainKeys</code><br />
<code>yum install perl-Mail-DKIM</code></li>
<li><em>Editer les fichiers de configuration de SpamAssassin</em><br />
Fichier <code>/etc/mail/spamassassin/v312.pre</code>: décommenter (= enlever le # au début) la ligne:<br />
<code>loadplugin Mail::SpamAssassin::Plugin::DKIM</code><br />
Fichier <code>/etc/mail/spamassassin/local.cf</code>: ajouter la ligne:<br />
<code>score DKIM_VERIFIED -1.00</code></li>
<li><em>Rédémarrer SpamAssassin</em><br />
<code>service spamassassin restart</code><br />
<code>service psa-spamassassin restart</code></li>
<li><em>Tester: Envoyer un email vers votre domaine depuis un compte Yahoo ou GMail</em><br />
Au niveau de la ligne &#8220;X-Spam-Status&#8221;, les mots-clés &#8220;DKIM_SIGNED&#8221; et &#8220;DKIM_VERIFIED&#8221; sont présents.<br />
Le X-Spam-Level est inférieur si le mot clé &#8220;DKIM VERIFIED&#8221; est présent.</li>
</ol>
<p><em>Notes:</em></p>
<ul>
<li>Un problème survient dans le traitement des signatures DKIM par gmail lorsque qmail et la protection SPF sont actifs: <a href="http://kb.parallels.com/en/6039">http://kb.parallels.com/en/6039</a></li>
</ul>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Fdomainkeys-identified-mail-dkim-plesk-qmail-spamassassin-dns%2F25&amp;linkname=DomainKeys%20Identified%20Mail%20%28DKIM%29%20-%20Plesk%2C%20Qmail%2C%20SpamAssassin%20%26%23038%3B%20DNS"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/domainkeys-identified-mail-dkim-plesk-qmail-spamassassin-dns/25/feed</wfw:commentRss>
		</item>
		<item>
		<title>Apache video streaming: flv et mp4 (H264) via modules open-source</title>
		<link>http://support.oxegena.ch/blog/apache-video-streaming-flv-et-mp4-h264-via-modules-open-source/24</link>
		<comments>http://support.oxegena.ch/blog/apache-video-streaming-flv-et-mp4-h264-via-modules-open-source/24#comments</comments>
		<pubDate>Tue, 22 Dec 2009 20:20:08 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/apache-video-streaming-flv-et-mp4-h264-via-modules-open-source/24</guid>
		<description><![CDATA[Note: cette installation s&#8217;est déroulée avec Apache 2.2.3  (Plesk 9.2) sous CentOS 5.2

Pour réaliser du pseudo streaming via HTTP avec le serveur web Apache, il suffit d&#8217;installer deux modules open-source:

mod_flv: pour des fichiers videos flash (flv) qui comportent des keyframes
H264 Streaming Module: pour des fichiers MPEG4 (mp4)

L&#8217;installation&#8230;

Installer APXS pour Apache
yum install httpd-devel
Télécharger la source du [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: </em>cette installation s&#8217;est déroulée avec Apache 2.2.3 <em> </em>(Plesk 9.2)<em> </em>sous CentOS 5.2<em><br />
</em><br />
Pour réaliser du pseudo streaming via HTTP avec le serveur web Apache, il suffit d&#8217;installer deux modules open-source:</p>
<ul>
<li><strong><a href="http://people.apache.org/%7Epquerna/modules/mod_flvx.c" title="mod_flvx.c">mod_flv</a>:</strong> pour des fichiers videos flash (flv) qui comportent des keyframes</li>
<li><strong><a href="http://h264.code-shop.com/trac/wiki" title="H264 Streaming Module">H264 Streaming Module</a>:</strong> pour des fichiers MPEG4 (mp4)</li>
</ul>
<p>L&#8217;installation&#8230;</p>
<ol>
<li>Installer APXS pour Apache<br />
<code>yum install httpd-devel</code></li>
<li>Télécharger la source du module <strong>mod_flv</strong><br />
<code>wget http://people.apache.org/%7Epquerna/modules/mod_flvx.c</code></li>
<li>Compiler et installer mod_flv<code><br />
apxs -c -i ./mod_flvx.c</code></li>
<li>Créer/Editer un fichier de configuration mod_flv pour Apache<br />
<code>vi /etc/httpd/conf.d/mod_flvx.conf</code><br />
avec le contenu suivant:<br />
<code>LoadModule flvx_module modules/mod_flvx.so</code><br />
<code>AddHandler flv-stream .flv</code></li>
<li>Redémarrer Apache pour être certain que l&#8217;installation de mod_flv s&#8217;est bien déroulée<br />
<code>service httpd restart</code></li>
<li>Télécharger et décompresser le module <strong>H264 Streaming</strong><br />
<code>wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.5.tar.gz<br />
tar -xvzf apache_mod_h264_streaming-2.2.5.tar.gz</code></li>
<li>Compiler et installer le module H264 Streaming<br />
<code>cd ./mod_h264_streaming-2.2.5<br />
./configure<br />
make<br />
make install</code></li>
<li>Créer/Editer un fichier de configuration mod_flv pour Apache<br />
<code>vi /etc/httpd/conf.d/mod_h264_streaming.conf</code><br />
avec le contenu suivant:<br />
<code>LoadModule flvx_module modules/mod_flvx.so<br />
AddHandler flv-stream .flv</code></li>
<li>Redémarrer Apache<br />
<code>service httpd restart</code></li>
</ol>
<p>Des fichiers flv avec des keyframes&#8230;</p>
<ul>
<li>les clés peuvent être ajoutées sur un fichier flv existant en utilisant <a href="http://rubyforge.org/projects/flvtool2/" title="flvtool2">flvtool2</a> (<a href="http://dag.wieers.com/rpm/packages/flvtool2/" title="DAG repository: flvtool2">DAG repository</a>):<br />
<code>flvtool2 -U video.flv</code></li>
</ul>
<p>Tester le streaming HTTP&#8230;</p>
<ul>
<li>utiliser le lecteur video <a href="http://www.longtailvideo.com/players/" title="JW Player">Flash JW Player</a> avec la variable <a href="http://developer.longtailvideo.com/trac/wiki/Player5Formats" title="JW Player - formats">&#8220;provider&#8221; définie à &#8220;http&#8221;<br />
</a></li>
<li>un exemple <a href="http://www.oxegena.ch/stream/">ici</a></li>
</ul>
<p>Sources:</p>
<ul>
<li><a href="http://tperspective.blogspot.com/2009/02/apache-flv-streaming-done-right.html">Apache FLV streaming done right!</a></li>
<li><a href="http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Apache-Version2">Downloading and building the H264 Streaming Module for Apache (version 2)</a></li>
</ul>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Fapache-video-streaming-flv-et-mp4-h264-via-modules-open-source%2F24&amp;linkname=Apache%20video%20streaming%3A%20flv%20et%20mp4%20%28H264%29%20via%20modules%20open-source"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/apache-video-streaming-flv-et-mp4-h264-via-modules-open-source/24/feed</wfw:commentRss>
		</item>
		<item>
		<title>Définir le timeout d&#8217;un callback sous Prado (AJAX)</title>
		<link>http://support.oxegena.ch/blog/definir-le-timeout-dun-callback-ajax-prado/23</link>
		<comments>http://support.oxegena.ch/blog/definir-le-timeout-dun-callback-ajax-prado/23#comments</comments>
		<pubDate>Thu, 21 May 2009 21:02:58 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[Prado]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/definir-le-timeout-dun-callback-ajax/23</guid>
		<description><![CDATA[Par défaut, le timeout d&#8217;un callback sous Prado est de 30 secondes.
Il peut être définis indépendamment pour chaque contrôle de type TActiveButton (AJAX).
Pour se faire, il suffit d&#8217;éditer le fichier .page qui contient le bouton concerné.
Avant la modification, le contrôle du bouton est décrit ainsi:
&#60;com:TActiveButton text=”Bouton AJAX” oncallback=”CallbackAction”&#62;
&#60;/com:TActiveButton&#62;
Il suffit d&#8217;y ajouter la proriété activecontrol.callbackoptions:
&#60;com:TActiveButton text=”Bouton [...]]]></description>
			<content:encoded><![CDATA[<p>Par défaut, le timeout d&#8217;un callback sous Prado est de 30 secondes.<br />
Il peut être définis indépendamment pour chaque contrôle de type TActiveButton (AJAX).</p>
<p>Pour se faire, il suffit d&#8217;éditer le fichier .page qui contient le bouton concerné.</p>
<p>Avant la modification, le contrôle du bouton est décrit ainsi:</p>
<pre>&lt;com:TActiveButton text=”Bouton AJAX” oncallback=”CallbackAction”&gt;
&lt;/com:TActiveButton&gt;</pre>
<p>Il suffit d&#8217;y ajouter la proriété activecontrol.callbackoptions:</p>
<pre>&lt;com:TActiveButton text=”Bouton AJAX” oncallback=”CallbackAction” activecontrol.callbackoptions=”CallBackOptions”&gt;
&lt;/com:TActiveButton&gt;</pre>
<p>Et de décrire les options de CallBack dans la page (après la déclaration du bouton):</p>
<pre>&lt;com:TCallbackOptions id=”CallBackOptions”&gt;
	&lt;prop:clientside.requesttimeout&gt;60000&lt;/prop:clientside.requesttimeout&gt;
&lt;/com:TCallbackOptions&gt;</pre>
<p>Dans l&#8217;exemple ci-dessus, la valeur 60&#8242;000 est en milli-secondes et représente 60 secondes.</p>
<p><em>Source:  <a href="http://geeqsquad.com/blog/2007/03/19/setting-an-ajax-timeout-longer-than-30-seconds-in-prado/">Setting an AJAX timeout longer than 30 seconds in Prado</a></em></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Fdefinir-le-timeout-dun-callback-ajax-prado%2F23&amp;linkname=D%C3%A9finir%20le%20timeout%20d%26%238217%3Bun%20callback%20sous%20Prado%20%28AJAX%29"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/definir-le-timeout-dun-callback-ajax-prado/23/feed</wfw:commentRss>
		</item>
		<item>
		<title>Magento - Augmenter la compatibilité des mails générés (newsletter, confirmation de commande, etc&#8230;)</title>
		<link>http://support.oxegena.ch/blog/magento-augmenter-la-compatibilite-des-mails-generes-newsletter-confirmation-de-commande-etc/18</link>
		<comments>http://support.oxegena.ch/blog/magento-augmenter-la-compatibilite-des-mails-generes-newsletter-confirmation-de-commande-etc/18#comments</comments>
		<pubDate>Thu, 30 Apr 2009 20:37:43 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/magento-augmenter-la-compatibilite-des-mails-generes-newsletter-confirmation-de-commande-etc/18</guid>
		<description><![CDATA[Lorsque Magento envois des mails HTML, que ce soit pour la newsletter ou les différentes notifications, le format généré n&#8217;est pas compatible avec tous les navigateurs. Il arrive que le mail soit définis comme du SPAM (HTML_MIME_NO_HTML_TAG), ou soit carrément illisible dans le client mail (affichage du code HTML, plutôt que du message formaté). Cependant, [...]]]></description>
			<content:encoded><![CDATA[<p>Lorsque Magento envois des mails HTML, que ce soit pour la newsletter ou les différentes notifications, le format généré n&#8217;est pas compatible avec tous les navigateurs. Il arrive que le mail soit définis comme du SPAM (HTML_MIME_NO_HTML_TAG), ou soit carrément illisible dans le client mail (affichage du code HTML, plutôt que du message formaté). Cependant, il est possible de remédier simplement à ce problème en éditant deux fichiers php du CORE de Magento.</p>
<p>Les 2 fichiers Template.php à éditer se trouvent ci-après (relativement au dossier racine de l&#8217;installation de Magento):</p>
<ul>
<li>./app/code/core/Mage/Core/Model/Email/Template.php</li>
<li>./app/code/core/Mage/Newsletter/Model/Template.php</li>
</ul>
<p class="cadre preview clear">Pour le premier, soit <strong>./app/code/core/Mage/Core/Model/Email/Template.php</strong>, il faut éditer la fonction send() (ligne 345).<br />
Remplacer le code ci-après:</p>
<pre class="cadre preview clear">if($this-&gt;isPlain()) {
$mail-&gt;setBodyText($text);
} else {
$mail-&gt;setBodyHTML($text);
}</pre>
<p>par celui-ci:</p>
<pre> if($this-&gt;isPlain()) {
$mail-&gt;setBodyText($text);
} else {
$mail-&gt;setBodyText($text);
$mail-&gt;setBodyHTML($text);
} <xmp></xmp></pre>
<p>Pour le deuxième fichier, soit <strong>./app/code/core/Mage/Newsletter/Model/Template.php</strong>, il faut faire la même modification (ligne 222).</p>
<p>Remplacer le code ci-après:</p>
<pre>if($this-&gt;isPlain()) {
$mail-&gt;setBodyText($text);
} else {
$mail-&gt;setBodyHTML($text);
}</pre>
<p>par celui-ci:</p>
<pre>if($this-&gt;isPlain()) {
$mail-&gt;setBodyText($text);
} else {
$mail-&gt;setBodyText($text);
$mail-&gt;setBodyHTML($text);
}</pre>
<p><em>Note:</em> les N° lignes des fichiers Template.php mentionnés correspondent à la version 1.2.0.1 de Magento.</p>
<p>Sources et informations:</p>
<ul>
<li><a href="http://www.magentocommerce.com/boards/viewthread/36392/" hreflang="en">Magento Forum: spam-free bounce-free mailing from magento</a></li>
<li><a href="http://rackspeed.de/forum/magento-installation-and-updates/magento-emails-spamordner-landen-166" hreflang="de">RackSpeed Forum: Wenn Magento-Emails im Spamordner landen &#8230;</a></li>
</ul>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Fmagento-augmenter-la-compatibilite-des-mails-generes-newsletter-confirmation-de-commande-etc%2F18&amp;linkname=Magento%20-%20Augmenter%20la%20compatibilit%C3%A9%20des%20mails%20g%C3%A9n%C3%A9r%C3%A9s%20%28newsletter%2C%20confirmation%20de%20commande%2C%20etc%26%238230%3B%29"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/magento-augmenter-la-compatibilite-des-mails-generes-newsletter-confirmation-de-commande-etc/18/feed</wfw:commentRss>
		</item>
		<item>
		<title>Anti-virus ClamAV, Greylisting et Postfix (Plesk 9.0.1 sur CentOS5)</title>
		<link>http://support.oxegena.ch/blog/anti-virus-clamav-greylisting-et-postfix-plesk-901-sur-centos5/17</link>
		<comments>http://support.oxegena.ch/blog/anti-virus-clamav-greylisting-et-postfix-plesk-901-sur-centos5/17#comments</comments>
		<pubDate>Wed, 25 Feb 2009 20:36:08 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/anti-virus-clamav-greylisting-et-postfix-plesk-901-sur-centos5/17</guid>
		<description><![CDATA[Plesk 9 offre désormais la possibilité d&#8217;exploiter Postfix en remplacement de qmail. ClamAV, l&#8217;alternative gratuite à Dr. Web, est toujours exploitatble, et pour limiter le SPAM, Postgrey s&#8217;occupe du greylisting. La marche à suivre suivante permet d&#8217;installer ClamAV et Postgrey sur une installation Plesk 9 et Postfix. Elle est prévue pour CentOS 5.2, mais devrait [...]]]></description>
			<content:encoded><![CDATA[<p>Plesk 9 offre désormais la possibilité d&#8217;exploiter Postfix en remplacement de qmail. ClamAV, l&#8217;alternative gratuite à Dr. Web, est toujours exploitatble, et pour limiter le SPAM, Postgrey s&#8217;occupe du greylisting. La marche à suivre suivante permet d&#8217;installer ClamAV et Postgrey sur une installation Plesk 9 et Postfix. Elle est prévue pour CentOS 5.2, mais devrait sans autre fonctionner sur d&#8217;autres distributions.</p>
<p><strong>- Plesk: Remplacer qmail par Postfix</strong><br />
Afin d&#8217;installer Postfix, il suffit d&#8217;exécuter l&#8217;AutoInstaller en ligne de commande et de sélectionner Postfix.<br />
<code>/usr/local/psa/bin/autoinstaller</code></p>
<p><strong>- Configurer YUM pour utiliser les packages de <a href="http://www.atomicorp.com/channels/atomic/" hreflang="en">Atomic Rocket Turtle (repository)</a></strong><br />
<code>wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh</code></p>
<p><strong>- Configurer YUM pour utiliser les packages de <a href="http://dag.wieers.com/rpm/" hreflang="en">DAG (repository)</a></strong><br />
<code>rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm</code></p>
<p><strong>- Désinstaller DrWeb</strong><br />
<code>rpm -qa | grep "drweb" | xargs rpm -e</code></p>
<p><strong>- Installer ClamAV</strong><br />
<code>yum install clamav clamd</code></p>
<p><strong>- Installer ClamSMTP</strong><br />
Télécharger la dernière version sur <a href="http://www.inet.lt/clamsmtp/" hreflang="en">http://www.inet.lt/clamsmtp/</a>.<br />
Note: la path /usr/src/redhat/RPMS/i386 peut varier en fonction de votre distribution.<br />
<code>rpm -ivh http://www.inet.lt/clamsmtp/clamsmtp-1.10-1.src.rpm</code><br />
<code>cd /usr/src/redhat/RPMS/i386</code><br />
<code>rpmbuild -bb clamsmtp.spec</code><br />
<code>rpm -ivh clamsmtp-1.10-1.i386.rpm</code></p>
<p><strong>- Configurer Postfix</strong><br />
<code>postconf -e "content_filter = scan:[127.0.0.1]:5025"</code><br />
<code>vi /etc/postfix/master.cf</code><br />
Ajouter les lignes suivantes dans le fichier master.cf:</p>
<pre># AV scan filter (used by content_filter)
scan unix - - n - 16 smtp
        -o smtp_send_xforward_command=yes
        -o smtp_enforce_tls=no
# For injecting mail back into postfix from the filter
127.0.0.1:5026 inet n - n - 16 smtpd
        -o content_filter=
        -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
        -o smtpd_helo_restrictions=
        -o smtpd_client_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o mynetworks_style=host
        -o smtpd_authorized_xforward_hosts=127.0.0.0/8</pre>
<p><code>vi /etc/postfix/main.cf</code><br />
Modifier la ligne &#8220;smtpd_recipient_restrictions&#8221; comme ci-dessous:</p>
<pre>smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_policy_service inet:127.0.0.1:60000, reject_unauth_destination</pre>
<p>Modifier la ligne &#8220;smtpd_client_restrictions&#8221; comme ci-dessous (pour faire fonctionner le SMTP AUTH):</p>
<pre>smtpd_recipient_restrictions = permit_sasl_authenticated, reject_rbl_client bl.spamcop.net, reject_rbl_client cbl.abuseat.org, reject_rbl_client zen.spamhaus.org</pre>
<p>Note: le fichier /etc/postfix/main.cf doit être modifié après chaque changement apporté à la configuration du serveur de mail depuis Plesk. Concernant la ligne &#8220;smtpd_recipient_restrictions&#8221;, il faut simplement s&#8217;assurer que le &#8220;permit_sasl_authenticated&#8221; viens en première position</p>
<p><strong>- Configurer ClamSMTP</strong><br />
<code>vi /etc/clamsmtpd.conf</code><br />
Modifier les lignes suivantes:</p>
<pre>OutAddress: 5026
Listen: 0.0.0.0:5025
ClamAddress: /tmp/clamd.socket
Action: drop
User: clamav</pre>
<p>Note: la socket (ligne &#8220;ClamAdress:&#8221;) doit correspondre au contenu de /etc/clamd.conf</p>
<p><strong>- Installer PostGrey</strong><br />
<code>yum install postgrey</code></p>
<p><strong>- Configurer PostGrey</strong><br />
<code>vi /etc/rc.d/init.d/postgrey</code><br />
Modifier la ligne &#8220;OPTIONS=&#8221;&#8211;unix=$SOCKET&#8221; comme ci-après:</p>
<pre>OPTIONS="--pidfile=/var/run/postgrey.pid --unix=$SOCKET --inet=127.0.0.1:60000 --delay=29"</pre>
<p><strong>- Mettre à jour ClamAV</strong><br />
<code>/usr/bin/freshclam</code><br />
Créer une tâche planifiée (via interface Plesk, pour l&#8217;utilisateur root) exécutée chaque jour pour la commande:<br />
/usr/bin/freshclam &gt;/dev/null</p>
<p><strong>- Lancer ClamD, ClamSMTP et Postgrey</strong><br />
<code>/etc/rc.d/init.d/clamd start</code><br />
<code>/etc/rc.d/init.d/clamsmtpd start</code><br />
<code>/etc/rc.d/init.d/postgrey start</code></p>
<p><strong>- Redémarrer Postfix</strong><br />
<code>/etc/rc.d/init.d/postfix restart</code></p>
<p><strong>- Contrôler le fonctionnement</strong><br />
Tout se trouve dans le fichier maillog&#8230;</p>
<p><strong>- Surveiller les processus ClamD, ClamSMTPD et Postgrey</strong><br />
Si l&#8217;un des démons de ClamAV ou Postgrey venait à s&#8217;arrêter, les mails seraient bloqués dans la file d&#8217;attente de Postfix.<br />
Il est recommandé de les surveiller avec PSMON.<br />
<code>yum install psmon</code><br />
<code>vi /etc/psmon.conf</code><br />
Editer la configuration de psmon afin de commenter les 2 lignes &#8220;Disabled&#8221;. Et insérer les lignes suivantes:</p>
<pre>&lt;Process clamd&gt;
        spawncmd        /sbin/service clamd start
        pidfile         /var/run/clamav/clamd.pid
&lt;/Process&gt;

&lt;Process clamsmtpd&gt;
        spawncmd        /sbin/service clamsmtpd start
        pidfile         /var/run/clamav/clamsmtpd.pid
&lt;/Process&gt;

&lt;Process postgrey&gt;
        spawncmd        /sbin/service postgrey start
        pidfile         /var/run/clamav/postgrey.pid
&lt;/Process&gt;</pre>
<p><strong>Différentes sources:</strong><br />
<a href="http://gnusys.net/plesk9-integration-with-clamav/" hreflang="en">Plesk9 integration with Postfix and ClamAV</a><br />
<a href="http://forum.parallels.com/showthread.php?t=86143&amp;highlight=postfix" hreflang="en">Greylisting in Plesk 9.0</a><br />
<a href="http://www.freespamfilter.org/forum/viewtopic.php?f=21&amp;t=595" hreflang="en">Postgrey selective greylisting and policyd-weight on Fedora</a><br />
<a href="http://forum.parallels.com/showthread.php?t=85930&amp;highlight=postfix" hreflang="en">Plesk / Postfix / SPF / DNSRBL</a><br />
Pour le bug &#8220;postfix-queue exit status 255&#8243; (ça n&#8217;a pas fonctionné pour mon cas):<br />
<a href="http://kb.parallels.com/en/6074" hreflang="en">[HOTFIX] Postfix cannot send e-mails with attachments</a><br />
Pour obtenir un rapport journalier de l&#8217;exploitation de Postfix:<br />
<a href="https://calomel.org/pflogsumm.html" hreflang="en">Pflogsumm - The Postfix Log Entry Summarizer</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Fanti-virus-clamav-greylisting-et-postfix-plesk-901-sur-centos5%2F17&amp;linkname=Anti-virus%20ClamAV%2C%20Greylisting%20et%20Postfix%20%28Plesk%209.0.1%20sur%20CentOS5%29"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/anti-virus-clamav-greylisting-et-postfix-plesk-901-sur-centos5/17/feed</wfw:commentRss>
		</item>
		<item>
		<title>Openquery &#8220;OLE DB &#8216;SQLOLEDB&#8217; n&#8217;a pas réussi à démarrer de transaction distribuée&#8221;</title>
		<link>http://support.oxegena.ch/blog/openquery-ole-db-sqloledb-na-pas-reussi-a-demarrer-de-transaction-distribuee/16</link>
		<comments>http://support.oxegena.ch/blog/openquery-ole-db-sqloledb-na-pas-reussi-a-demarrer-de-transaction-distribuee/16#comments</comments>
		<pubDate>Wed, 19 Nov 2008 20:35:20 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[MS SQL]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/openquery-ole-db-sqloledb-na-pas-reussi-a-demarrer-de-transaction-distribuee/16</guid>
		<description><![CDATA[L&#8217;erreur &#8220;OLE DB &#8216;SQLOLEDB&#8217; n&#8217;a pas réussi à démarrer de transaction distribuée&#8221; ([OLE/DB Provider &#8216;SQLOLEDB&#8217; ITransactionJoin::JoinTransaction returned 0&#215;8004d00a]) retournée par un Openquery peut être résolue simplement.
Il suffit d&#8217;ajouter SET IMPLICIT_TRANSACTIONS OFF; avant l&#8217;exécution d&#8217;une requête ou d&#8217;une procédure stockée.
Avant (erreur):
select * from OPENQUERY(LOCALHOST, &#8216;exec mySP @Param = 123&#8242;)
Après (corrigé):
select * from OPENQUERY(LOCALHOST, &#8216;SET IMPLICIT_TRANSACTIONS OFF; [...]]]></description>
			<content:encoded><![CDATA[<p>L&#8217;erreur &#8220;OLE DB &#8216;SQLOLEDB&#8217; n&#8217;a pas réussi à démarrer de transaction distribuée&#8221; ([OLE/DB Provider &#8216;SQLOLEDB&#8217; ITransactionJoin::JoinTransaction returned 0&#215;8004d00a]) retournée par un Openquery peut être résolue simplement.</p>
<p>Il suffit d&#8217;ajouter <strong>SET IMPLICIT_TRANSACTIONS OFF;</strong> avant l&#8217;exécution d&#8217;une requête ou d&#8217;une procédure stockée.<br />
Avant (erreur):<br />
<em>select * from OPENQUERY(LOCALHOST, &#8216;exec mySP @Param = 123&#8242;)</em><br />
Après (corrigé):<br />
<em>select * from OPENQUERY(LOCALHOST, &#8216;SET IMPLICIT_TRANSACTIONS OFF; exec mySP @Param = 123&#8242;)</em></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Fopenquery-ole-db-sqloledb-na-pas-reussi-a-demarrer-de-transaction-distribuee%2F16&amp;linkname=Openquery%20%26%238220%3BOLE%20DB%20%26%238216%3BSQLOLEDB%26%238217%3B%20n%26%238217%3Ba%20pas%20r%C3%A9ussi%20%C3%A0%20d%C3%A9marrer%20de%20transaction%20distribu%C3%A9e%26%238221%3B"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/openquery-ole-db-sqloledb-na-pas-reussi-a-demarrer-de-transaction-distribuee/16/feed</wfw:commentRss>
		</item>
		<item>
		<title>Créer un script PHP exécutable en ligne de commande</title>
		<link>http://support.oxegena.ch/blog/creer-un-script-php-executable-en-ligne-de-commande/15</link>
		<comments>http://support.oxegena.ch/blog/creer-un-script-php-executable-en-ligne-de-commande/15#comments</comments>
		<pubDate>Thu, 18 Sep 2008 11:32:31 +0000</pubDate>
		<dc:creator>albans</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://support.oxegena.ch/blog/creer-un-script-php-executable-en-ligne-de-commande/15</guid>
		<description><![CDATA[Le langage PHP peut être utilisé pour scripter des fichiers exécutables en ligne de commande, au même titre que PERL (ou autres&#8230;). Ce mode de fonctionnement est pratique pour outrepasser les limites imposées par l&#8217;environnement d&#8217;Apache (sécurité, temps d&#8217;exécution, etc.).
Avant d&#8217;écrire du code, il est nécessaire de définir l&#8217;emplacement de l&#8217;interpréteur PHP (à noter que [...]]]></description>
			<content:encoded><![CDATA[<p>Le langage PHP peut être utilisé pour scripter des fichiers exécutables en ligne de commande, au même titre que PERL (ou autres&#8230;). Ce mode de fonctionnement est pratique pour outrepasser les limites imposées par l&#8217;environnement d&#8217;Apache (sécurité, temps d&#8217;exécution, etc.).</p>
<p>Avant d&#8217;écrire du code, il est nécessaire de définir l&#8217;emplacement de l&#8217;interpréteur PHP (à noter que PHP est déjà installé sur votre machine). Pour se faire, il suffit d&#8217;exécuter la commande suivante (sous Linux): <code>whereis php</code>. Dans la majorité des cas, le résultat devrait contenir soit <code>/usr/bin/php</code>, soit <code>/usr/local/bin/php</code>.  La première ligne du script devra tjs. reprendre l&#8217;emplacement de php, comme ci-après:<br />
<code>#!/usr/bin/php</code><br />
Ensuite, vous pouvez écrire en PHP habituel, sans omettre les <code>&lt;?php ?&gt;</code> en début et fin de script.<br />
Ci-après, un exemple de script qui affiche &#8220;Hello World&#8221; au prompt:<br />
<code> #!/usr/bin/php<br />
&lt;?php<br />
echo "Hello World\n";<br />
?&gt; </code><br />
Pour tester ce script (nommé ici test.php), il suffit de le rendre exécutable et de l&#8217;appeler comme une commande:<br />
<code> chmod 755 test.php<br />
./test.php<br />
</code><br />
<strong>Comment récupérer des arguments passer en ligne de commande?</strong></p>
<p>Etant donné que le script PHP est désormais exécuté hors de l&#8217;environnement Apache, les arguments en ligne de commande sont la seule méthode qui permet de lui passer des paramètres (les variables POST/QueryString n&#8217;existent plus, tout comme les constantes d&#8217;environnement <code>$SERVER</code>). La variable (tableau) <code>$argv</code> permet de récupérer ces valeurs.<br />
Ci-après, un exemple de script qui affiche &#8220;Hello World&#8221; suivi des arguments passés en ligne de commande:<br />
<code> #!/usr/bin/php<br />
&lt;?php<br />
echo "Hello World $argv[0] $argv[1] $argv[2]\n";<br />
?&gt; </code><br />
Le script est appelé ainsi (2 paramètres dans notre cas, l&#8217;index 0 retourne le nom du script): <code> ./test.php Param1 Param2<br />
</code> Résultat: <code>Hello World ./test.php Param1 Param2</code><br />
A noter que <code>$argv</code> n&#8217;est pas limité à 2 paramètres, voir <a href="http://www.php.net/manual/fr/reserved.variables.argv.php" hreflang="fr">la doc de PHP à ce sujet</a>.</p>
<p><strong>Comment appeler un autre script (ou commande)?</strong></p>
<p>Deux fonctions PHP existent pour exécuter un autre script ou commande:</p>
<ul>
<li><a href="http://www.php.net/manual/fr/function.passthru.php" hreflang="fr">passthru()</a>  : exécute et affiche le résultat brut</li>
<li><a href="http://www.php.net/manual/fr/function.exec.php" hreflang="fr">exec()</a>: exécute sans afficher le résultat</li>
</ul>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?&amp;linkurl=http%3A%2F%2Fsupport.oxegena.ch%2Fblog%2Fcreer-un-script-php-executable-en-ligne-de-commande%2F15&amp;linkname=Cr%C3%A9er%20un%20script%20PHP%20ex%C3%A9cutable%20en%20ligne%20de%20commande"><img src="http://support.oxegena.ch/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://support.oxegena.ch/blog/creer-un-script-php-executable-en-ligne-de-commande/15/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

