<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wiki.electroniciens.cnrs.fr/index.php?action=history&amp;feed=atom&amp;title=L%27environnement_de_travail_www</id>
	<title>L&#039;environnement de travail www - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.electroniciens.cnrs.fr/index.php?action=history&amp;feed=atom&amp;title=L%27environnement_de_travail_www"/>
	<link rel="alternate" type="text/html" href="https://wiki.electroniciens.cnrs.fr/index.php?title=L%27environnement_de_travail_www&amp;action=history"/>
	<updated>2026-04-09T06:46:32Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.electroniciens.cnrs.fr/index.php?title=L%27environnement_de_travail_www&amp;diff=4078&amp;oldid=prev</id>
		<title>William.benharbone le 20 septembre 2019 à 21:59</title>
		<link rel="alternate" type="text/html" href="https://wiki.electroniciens.cnrs.fr/index.php?title=L%27environnement_de_travail_www&amp;diff=4078&amp;oldid=prev"/>
		<updated>2019-09-20T21:59:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Les_Groupes_ARM_:_Raspberry_Pi#Installation_du_serveur_web_pour_communiquer_depuis_l.E2.80.99ext.C3.A9rieur|Revenir au sommaire du RasberryPi]]&lt;br /&gt;
&lt;br /&gt;
== créer son dossier www ==&lt;br /&gt;
Dans son /home/pi : à quoi cela sert-il ?&lt;br /&gt;
- Pouvoir créer/éditer les fichiers php propres à notre utilisateur (&amp;quot;pi&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Pour se faire, nous allons donc développer nos codes dans un sous dossier personnalisé (nommé www)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 cd            # retour a la racine de notre home&lt;br /&gt;
 mkdir www     # création du répertoire www&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
nous voulons qu&amp;#039;il soit accessible depuis le web, nous faisons donc un lien symbolique vers ce dossier&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 sudo ln -s /home/pi/www /var/www/pi &lt;br /&gt;
 # ln (lien) -s (symbolique)  /home/pi/www (dossier source) /var/www/pi (lien)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ce qui signifie que nous pourrons y accéder via l&amp;#039;adresse &amp;#039;&amp;#039;&amp;#039;http://xxx.xxx.xxx.xxx/pi&amp;#039;&amp;#039;&amp;#039; (ou xxx.xxx.xxx.xxx est l&amp;#039;adresse de la carte)&lt;br /&gt;
&lt;br /&gt;
nous allons éditer notre premier fichier php en nous plaçant dans le dossier WEB&lt;br /&gt;
si on part de notre home :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 cd www              # nous entrons dans le dossier www&lt;br /&gt;
# ou&lt;br /&gt;
 cd ~/www            # ~ = /home/pi&lt;br /&gt;
# ou&lt;br /&gt;
 cd /home/pi/www     # la syntaxe complete&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Attaquons le code de test ==&lt;br /&gt;
=== Hello World ! ===&lt;br /&gt;
&lt;br /&gt;
comme éditeur de texte , nous pouvons utiliser &amp;quot;nano&amp;quot; (simple et léger) ou &amp;quot;geany&amp;quot; qui à l&amp;#039;avantage de pouvoir être graphique, déporté et apporte une &amp;quot;coloration syntaxique&amp;quot;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 sudo apt-get update       # toujours la mise a jour des paquets avant l&amp;#039;installation&lt;br /&gt;
 sudo apt-get upgrade      # une petite mise a jour&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install geany      # l&amp;#039;installation de geany&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
plaçons y notre premier bout de code :&lt;br /&gt;
&lt;br /&gt;
créons donc un fichier php&lt;br /&gt;
&lt;br /&gt;
Nous allons créer un fichier nommé &amp;#039;&amp;#039;&amp;#039;index.php&amp;#039;&amp;#039;&amp;#039; ( c&amp;#039;est le premier fichier que le serveur apache cherche a distribuer lors d&amp;#039;une requête internet sans spécification de fichier) C&amp;#039;est le point d&amp;#039;entré de notre site.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 geany index.php&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
en voici le contenu :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
 &amp;lt;html lang=&amp;quot;fr&amp;quot; dir=&amp;quot;ltr&amp;quot; class=&amp;quot;client-nojs&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;head&amp;gt;&lt;br /&gt;
 &amp;lt;title&amp;gt;Affichage de l&amp;#039;heure sur une page web (lecture I2C et envoi HTML) - d&amp;#039;après le Wiki_du_Réseau_des_Electroniciens_du_CNRS&amp;lt;/title&amp;gt;&lt;br /&gt;
 &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/meta&amp;gt;&lt;br /&gt;
 &amp;lt;body&amp;gt;&lt;br /&gt;
 &amp;lt;?&lt;br /&gt;
  //ici commence le code php&lt;br /&gt;
    echo &amp;quot;hello world!&amp;quot;;&lt;br /&gt;
  //ici se termine le code php&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
 &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A tester depuis un navigateur http://xxx.xxx.xxx.xxx/pi&lt;/div&gt;</summary>
		<author><name>William.benharbone</name></author>
	</entry>
</feed>