<?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>Geekfault &#187; php</title>
	<atom:link href="http://geekfault.org/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://geekfault.org</link>
	<description>If it doesn&#039;t segfault, you&#039;re doing it wrong.</description>
	<lastBuildDate>Tue, 08 May 2012 17:13:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Serveur Lighttpd avec PHP sur iPhone</title>
		<link>http://geekfault.org/2009/05/27/lighttpd-php-iphone/</link>
		<comments>http://geekfault.org/2009/05/27/lighttpd-php-iphone/#comments</comments>
		<pubDate>Wed, 27 May 2009 21:34:22 +0000</pubDate>
		<dc:creator>Tito</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[mobilité]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://geekfault.org/?p=734</guid>
		<description><![CDATA[Toujours avoir un petit serveur HTTP dans sa poche, c&#8217;est possible! C&#8217;est même très pratique pour toujours avoir des fichiers sous la main accessibles simplement en HTTP et d&#8217;autres utilisations illicites Nous allons voir comment installer un serveur Lighttpd (alternative à Apache), avec PHP sur un iPhone 2.2.1 jailbreaké. Installation Grâce à Cydia ou Icy, [...]
<h3>Si vous avez aimé ce post...</h3><ol>
<li><a href='http://geekfault.org/2009/05/27/internet-via-iphone/' rel='bookmark' title='Internet sur votre laptop via un iPhone'>Internet sur votre laptop via un iPhone</a></li>
<li><a href='http://geekfault.org/2009/06/29/iphone-os-30/' rel='bookmark' title='iPhone OS 3.0'>iPhone OS 3.0</a></li>
<li><a href='http://geekfault.org/2009/06/08/iphone-3gs/' rel='bookmark' title='Le &#8220;nouvel&#8221; iPhone 3GS'>Le &#8220;nouvel&#8221; iPhone 3GS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geekfault.org/wp-content/uploads/2009/05/iphone-lighttpd.jpg" title="Un script PHP exécuté directement sur l&#039;iPhone avec un serveur Lighttpd" rel="lightbox.734"><img style=' float: left; padding: 4px; margin: 0 7px 2px 0;' align="left"   src="http://geekfault.org/wp-content/uploads/2009/05/iphone-lighttpd-200x300.jpg" alt="Un script PHP exécuté directement sur l&#039;iPhone avec un serveur Lighttpd" title="Un script PHP exécuté directement sur l&#039;iPhone avec un serveur Lighttpd" width="200" height="300" class="alignleft size-medium wp-image-736" /></a>Toujours avoir un petit serveur HTTP dans sa poche, c&#8217;est possible! C&#8217;est même très pratique pour toujours avoir des fichiers sous la main accessibles simplement en HTTP et d&#8217;autres utilisations illicites <img src='http://geekfault.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Nous allons voir comment installer un serveur <strong>Lighttpd</strong> (alternative à Apache), avec <strong>PHP</strong> sur un iPhone 2.2.1 jailbreaké.<br />
<!--more--></p>
<h3>Installation</h3>
<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;' align="right"   src="http://geekfault.org/wp-content/uploads/2009/05/lighttpd.png" alt="Logo de Lighttpd" title="Logo de Lighttpd" width="170" height="168" class="alignright size-full wp-image-746" />Grâce à Cydia ou Icy, installez les packages suivants:</p>
<ul>
<li><strong>OpenSSH</strong> un des indispensables du hacker iPhone, il lance un serveur SSH sur celui-ci (l&#8217;iPhone, pas le hacker xD)</li>
<li><strong>Lighttpd</strong> est le serveur HTTP à proprement parler. Très léger et sous license libre (BSD), c&#8217;est une très bonne alternative à Apache</li>
<li><strong>PHP: Hypertext Preprocessor</strong> que nous lierons à Lighttpd dans la configuration</li>
</ul>
<h3>Configuration</h3>
<p>Redémarrez et connectez-vous en ssh à votre iPhone, le mot de passe par défaut est <strong>alpine</strong>.<br />
<code>ssh root@iPhone.local</code></p>
<p>D&#8217;abord créons tous les répertoires utiles:<br />
<code>mkdir /etc/lighttpd/ /etc/lighttpd/logs/ /etc/lighttpd/htdocs/</code></p>
<p>Configurons Lighttpd :<br />
<code>nano /etc/lighttpd/lighttpd.conf</code><br />
<code>server.document-root = "/etc/lighttpd/htdocs"<br />
server.port = 80</p>
<p>server.tag ="lighttpd"<br />
server.errorlog = "/etc/lighttpd/logs/error.log"<br />
accesslog.filename = "/etc/lighttpd/logs/access.log"</p>
<p>server.modules = ("mod_access","mod_accesslog","mod_fastcgi","mod_rewrite","mod_auth","mod_fastcgi")</p>
<p>index-file.names = ( "index.html", "index.php" )</p>
<p>#Configuration PHP<br />
fastcgi.server = (".php" =><br />
        ("localhost" =><br />
                ("bin-path" => "/usr/bin/php-cgi",<br />
                "socket" => "/tmp/php.socket")<br />
        )<br />
)</code><br />
Lighttpd est bien sûr un serveur tout à fait standard largement utilisé sur le web : vous pouvez <a href="http://redmine.lighttpd.net/projects/lighttpd/wiki/TutorialConfiguration">adapter sa configuration</a> selon vos moindres désirs.</p>
<h3>Lancer le serveur</h3>
<p>Il ne reste plus qu&#8217;à lancer le serveur en une petite ligne de commande. Je n&#8217;ai pas trouvé d&#8217;interface graphique qui permette de le faire simplement.<br />
<code>lighttpd -f /etc/lighttpd/lighttpd.conf</code></p>
<p>Créons un petit fichier PHP pour voir si tout marche bien:<br />
<code>nano /etc/lighttpd/htdocs/index.php</code><br />
<code>< ?php $who = 'Geekfault';<br />
echo 'Hello, '.$who.'.'; ?></code></p>
<p>La configuration Lighttpd décrite ici permet de se connecter à votre iPhone avec <strong>tous les hostnames qui lui sont affectés</strong>: iPhone.local, localhost, adresse IP, &#8230;</p>
<h3>MySQL ?</h3>
<p>Il n&#8217;est malheureusement pas possible pour l&#8217;instant de faire tourner un serveur MySQL sur l&#8217;iPhone et, pire, le PHP proposé est <strong>compilé sans le mod_mysql</strong>, ce qui empêche même les connexion MySQL à un serveur distant.</p>
<p>Il faudra se contenter de <strong><a href="http://be.php.net/manual/fr/book.sqlite.php">SQLite</a></strong>. Dommage.</p>
<p><a href="http://www.esrun.co.uk/blog/lighttpd-php-on-the-iphone/">Source</a></p>
<p><h3>Si vous avez aimé ce post...</h3><ol>
<li><a href='http://geekfault.org/2009/05/27/internet-via-iphone/' rel='bookmark' title='Internet sur votre laptop via un iPhone'>Internet sur votre laptop via un iPhone</a></li>
<li><a href='http://geekfault.org/2009/06/29/iphone-os-30/' rel='bookmark' title='iPhone OS 3.0'>iPhone OS 3.0</a></li>
<li><a href='http://geekfault.org/2009/06/08/iphone-3gs/' rel='bookmark' title='Le &#8220;nouvel&#8221; iPhone 3GS'>Le &#8220;nouvel&#8221; iPhone 3GS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://geekfault.org/2009/05/27/lighttpd-php-iphone/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

