issue63:tutowebdev
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue63:tutowebdev [2012/08/11 18:26] – créée fredphil91 | issue63:tutowebdev [2012/09/12 16:16] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ** | ||
The “LAMP Stack” is traditionally Linux, Apache, MySQL, and PHP. This is the most necessary portion of any server to any web developer, whether you’re specializing in PHP or even mobile development. You just simply cannot develop a web site or web app without a web server. Of course, there are other flavors of web servers that use other technology, but this is the standard and will be our starting point. | The “LAMP Stack” is traditionally Linux, Apache, MySQL, and PHP. This is the most necessary portion of any server to any web developer, whether you’re specializing in PHP or even mobile development. You just simply cannot develop a web site or web app without a web server. Of course, there are other flavors of web servers that use other technology, but this is the standard and will be our starting point. | ||
+ | ** | ||
+ | Un serveur « LAMP » repose traditionnellement sur Linux, Apache, MySQL et PHP. Ce sont les éléments indispensables pour tout serveur destiné à un développeur web, que vous vous spécialisiez en PHP ou même en développement mobile. Vous ne pouvez tout simplement pas développer un site ou une application web sans un serveur web. Bien entendu, il y a d' | ||
+ | |||
+ | ** | ||
For the sake of this new column, I have set up a new Virtual Server to go through with you as we go. My server is running Ubuntu Server 64bit 10.10. This month we will get Apache2 installed and configured. I am also assuming you know how to edit files using terminal and vi, this is what we will be using the whole time. Let’s jump right into that. | For the sake of this new column, I have set up a new Virtual Server to go through with you as we go. My server is running Ubuntu Server 64bit 10.10. This month we will get Apache2 installed and configured. I am also assuming you know how to edit files using terminal and vi, this is what we will be using the whole time. Let’s jump right into that. | ||
+ | ** | ||
+ | |||
+ | Dans le cadre de cette nouvelle série d' | ||
+ | ** | ||
If you are not root (and you shouldn’t be for security reasons), you need to run apt-get commands using sudo, and all my examples will assume you are logged in as a user. Run the following code to install apache2: | If you are not root (and you shouldn’t be for security reasons), you need to run apt-get commands using sudo, and all my examples will assume you are logged in as a user. Run the following code to install apache2: | ||
sudo apt-get install apache2 | sudo apt-get install apache2 | ||
+ | ** | ||
+ | Si vous n' | ||
+ | |||
+ | sudo apt-get install apache2 | ||
+ | |||
+ | ** | ||
By default, now it works. It is listening to all IP’s available to it, anything coming to that box on port 80 will now go to the default web site. Pretty easy stuff so far. All of your files will be located in the following directory: | By default, now it works. It is listening to all IP’s available to it, anything coming to that box on port 80 will now go to the default web site. Pretty easy stuff so far. All of your files will be located in the following directory: | ||
/srv/www/ | /srv/www/ | ||
+ | ** | ||
+ | Par défaut, maintenant cela fonctionne. Il écoute toutes les adresses IP visibles pour lui, tout ce qui arrive vers cette machine virtuelle sur le port 80 affichera le site web par défaut. Jusqu' | ||
+ | |||
+ | /srv/www/ | ||
+ | |||
+ | ** | ||
I have a feeling that we will want a few different sites to play around with, so I am going to show you how I set things up. Instead of using the default path and apache config setup, we will use virtual hosts. From here on out, I will use example.com. You will want to replace that with your own domain name. | I have a feeling that we will want a few different sites to play around with, so I am going to show you how I set things up. Instead of using the default path and apache config setup, we will use virtual hosts. From here on out, I will use example.com. You will want to replace that with your own domain name. | ||
+ | ** | ||
+ | |||
+ | J'ai le pressentiment que quelques sites distincts seront utiles pour nos essais et je vais donc vous montrer comment j'ai configuré tout cela. Au lieu d' | ||
+ | ** | ||
Make a new virtual host config file into / | Make a new virtual host config file into / | ||
sudo vi / | sudo vi / | ||
+ | ** | ||
+ | Créez un nouveau fichier de configuration de l' | ||
+ | |||
+ | sudo vi / | ||
+ | |||
+ | |||
+ | ** | ||
Now let’s get some config in there. Go ahead and use the simple sample configuration shown above. | Now let’s get some config in there. Go ahead and use the simple sample configuration shown above. | ||
+ | ** | ||
+ | Maintenant, un peu de configuration. Poursuivez en utilisant l' | ||
+ | |||
+ | ** | ||
Remember to change example.com to your doman name. This stuff is kind of boring so I am just going to run through it really quickly. ServerAdmin is for the email address of who (or a group that) maintains the site. ServerName should be the base name of the site. Please note, if your site is a sub-domain then you will need to put x.example.com in the ServerName. The ServerAlias is the full web address that will be going to your site. DocumentRoot is where all of your public files will be held. I took the liberty of giving you error log reporting to make finding and fixing problems easier in the future. Before any of that will work, we need to create those directories for real. That, of course, is as easy as making directories: | Remember to change example.com to your doman name. This stuff is kind of boring so I am just going to run through it really quickly. ServerAdmin is for the email address of who (or a group that) maintains the site. ServerName should be the base name of the site. Please note, if your site is a sub-domain then you will need to put x.example.com in the ServerName. The ServerAlias is the full web address that will be going to your site. DocumentRoot is where all of your public files will be held. I took the liberty of giving you error log reporting to make finding and fixing problems easier in the future. Before any of that will work, we need to create those directories for real. That, of course, is as easy as making directories: | ||
Ligne 24: | Ligne 60: | ||
mkdir / | mkdir / | ||
+ | ** | ||
+ | N' | ||
+ | |||
+ | mkdir -p / | ||
+ | |||
+ | mkdir / | ||
+ | |||
+ | ** | ||
Sweet, now we got some stuff going on. Now let’s activate that bad boy: | Sweet, now we got some stuff going on. Now let’s activate that bad boy: | ||
Ligne 30: | Ligne 74: | ||
sudo / | sudo / | ||
+ | ** | ||
+ | Parfait, cela commence à fonctionner. Maintenant, activons la chose : | ||
+ | |||
+ | sudo a2ensite example.com | ||
+ | |||
+ | sudo / | ||
+ | |||
+ | ** | ||
The a2ensite is actually a really cool command. It says apache2, enable site x. There is also a2dissite for disabling. This will use the site config files we made in the sites-available directory and copy them into the sites-enabled directory. Although we could do it ourselves, it is just good practice to let apache handle its own files when it is able. The other statement there is telling apache to reload its configuration files. | The a2ensite is actually a really cool command. It says apache2, enable site x. There is also a2dissite for disabling. This will use the site config files we made in the sites-available directory and copy them into the sites-enabled directory. Although we could do it ourselves, it is just good practice to let apache handle its own files when it is able. The other statement there is telling apache to reload its configuration files. | ||
+ | ** | ||
+ | La commande a2ensite est en fait une commande très sympa. Elle dit à apache2 d' | ||
+ | ** | ||
Well, that is it for this month. | Well, that is it for this month. | ||
Next time we will be installing PHP and MySQL to complete the LAMP stack. | Next time we will be installing PHP and MySQL to complete the LAMP stack. | ||
+ | ** | ||
+ | |||
+ | Voilà, c'est terminé pour ce mois-ci ! | ||
+ | |||
+ | La prochaine fois, nous installerons PHP et MySQL pour terminer notre serveur LAMP. | ||
issue63/tutowebdev.1344702416.txt.gz · Dernière modification : 2012/08/11 18:26 de fredphil91