Vous êtes sur la page 1sur 51

Installation dun serveur web (IIS 7.

0) sur Windows Server 2008 Introduction


Nous allons voir au cours de ce billet comment installer simplement un serveur web sur Windows Server 2008. Nous verons ensemble linstallation du serveur web de Microsoft : IIS qui est intgr Windows Server 2008. Sur un Windows Server le serveur web IIS est un rle ajouter notre systme. Une fois ajout notre Windows Server peut faire office de Serveur Web.

Installation
Linstallation concernera IIS 7.0 sur un Windows Server Standard 2008. Pour commencer il est fondamental dtre connect en tant quadministrateur local pour pouvoir ajouter le rle IIS. Pour ajouter le role serveur web IIS: Menu dmarrer -> Tout les programmes -> Outils dadministration -> Gestionnaire de Serveur. Si on est pas connect en tant quadministrateur local, un message de scurit va apparaitre ds louverture du gestionnaire de serveur.

Une fois arriv sur cette fentre vous aller voir un rsum de la configuration de votre Windows Server 2008. Dans le rsum des roles cliquer sur Ajouter des roles . Une fois cela fait nous arrivons sur la fentre dassistant dajouts de roles. Avant de commencer ajouter des rles Windows Server nous propose une aide qui nous rappel les pr-requis importants avant dajouter un role: un mot de passe administrateur scuris, une connectivit rseau configur et les mises jour serveur faites.

Une fois laide lue cliquer sur suivant. Maintenant nous devons choisir les rles. Vous avez un panel de roles sous Windows Server, nous choisirons Serveur Web IIS. Windows Server vous demandera dajouter certaines fonctionnalits pour permettre linstallation de IIS 7.0. Acceptez et continuer. NB: Vous pouvez voir que Windows a intgr un descriptif chaque role, utile pour ceux qui ne sont pas familiaris avec Windows Server 2008 et avec la notion de role.

Une fois accept, comme souvent dans Windows Server 2008, vous aurez un petit assistant qui vous rsumera la fonction du Serveur Web IIS et ses fonctionnalits. Tout cela est de la lecture et si vous ne savez pas o vous mettez les pieds il peut savrer fort utile de lire la documentation. Une fois lu, Windows listera toutes les fonctionnalits que vous pouvez intgrer votre serveur web. vous, selon votre utilisation de choisir uniquement les fonctionnalits qui vous seront utiles ou requises.

Faites suivant, et laissez Windows faire linstallation de votre serveur IIS. Une fois fini vous avez install un Serveur Web sur votre Windows Server 2008. Ce rle est alors actif, pour le configurer et le grer il vous suffit daller Menu dmarrer -> Tout les programmes -> Outils dadministration -> Gestionnaire des Services Internet IIS. Sur cette interface, vous retrouverez la liste des sites prsents sur votre serveur, il vous permet dajouter un site et de grer les sites (authentification, certificats, pages derreur). Cette interface est trs userfriendly comme la plus part des interfaces sous Windows server 2008, nhsitez pas chercher les moindres petit dtails de ce gestionnaire trs complet.

Linstallation est faites et vous avez dj un site dexemple sur votre serveur, pour le visualiser clique sur Default Web Site et dans le menu de droite faite aperu, ci-dessous un exemple:

Enfin dans linstallation de IIS 7.0 nous allons ajouter un site dexemple quil sappelera Blog. Pour cela jai gliss un site fait en html et css dans le dossier C://inetpub//wwwroot. Mon site e st dans un dossier appel Blog. Donc pour lajouter vous faite clique droit sur Sites ==> Ajouter un site. Puis, renseignez les champs: nom du site, lien physique du site, port Une fois ajouter si vous navez pas chang de port (80 par dfaut) vous de vez arrter le site par dfaut car il fonctionne dj sur ce port. Une fois fait dans le menu du site faite visualiser le site et vous verrez votre site !

Conclusion
Nous avons vu comment installer simplement un serveur Web IIS 7.0 sur un Windows Server 2008. Linstallation est simple et les fentres intuitives. Mais au niveau de la configuration cela peut tre bien plus compliqu que de glisser un site dans un dossier, surtout si vous voulez crer un site via un CMS tel que WordPress ou autre, ou utiliser une plateforme spcifique. Quel type de site type de site web hbergez-vous ou voudriez-vous hberger ? Quels sont les serveurs web que vous souhaitez installer ?

Pour dmarrer ou arrter un serveur Web


Vous pouvez effectuer cette procdure l'aide de l'interface utilisateur ou d'une ligne de commande. Pour plus d'informations sur l'ouverture du Gestionnaire des services Internet (IIS), consultez Ouvrir le Gestionnaire des services Internet (IIS 7).

Utilisation de l'interface utilisateur


1. 2. Ouvrez le Gestionnaire des services Internet (IIS) et accdez au nud du serveur Web dans l'arborescence. Dans le volet Actions, cliquez sur Dmarrer pour dmarrer le serveur Web ou sur Arrter pour l'arrter. Ouvrez une fentre de ligne de commande o vous disposez de droits levs. l'invite de commandes, tapez net stop WAS et appuyez sur ENTRE ; tapez Y et appuyez sur ENTRE pour arrter galement W3SVC. Pour redmarrer le serveur Web, tapez net start W3SVC et appuyez sur ENTRE pour dmarrer WAS et W3SVC.

Utilisation d'une ligne de commande


1. 2. 3.

How to install PHPMyAdmin on Windows Server 2008


richardreddy Jun 15 2012 10:15 AM

MySQL, PHP, PHPMyAdmin Comments

At present if you install Wordpress as part of the Web Platform Installer it does not install PHPMyAdmin for you. Luckily this install is very easy to do. Head over to http://www.phpmyadmin.net and download the latest installer to your server. Once downloaded unzip the contents of the file and rename the folder to 'phpmyadmin'. Copy this folder to your website containing Wordpress or php. Open the file config.sample.inc.php into wordpad (notepad puts it all on one line) and enter in a new Blowfish_secret. It can be anything random like a password. Next uncomment: // $cfg['Servers'][$i]['controluser'] = 'pma'; // $cfg['Servers'][$i]['controlpass'] = 'pmapass'; and replace with the root database username and password or create a new mySQL user called pma and use those details here. Now uncomment the Storage database and tables - just remove the leading // from each line. Save and close the config file. Rename it to: 'config.inc.php'. Copy the phpmyadmin folder and paste it into your website root level. Go to the Examples folder and open the create_tables.sql file using notepad. Copy all the content in here. Open your website in a browser and point to yourdomain.com/phpmyadmin Login using your root database and password. Ignore all the error messages for the moment. Go to SQL and paste in the sql text you copied. Now click on Go. Log out of phpmyadmin and log in using the database username and password you used when setting up your Wordpress/MySQL database for this project. Everything should now be working as expected for you.

Install PHPMyAdmin on IIS7 and Server 2008


By Dave Lawlor

After installing our copy of MySQL on IIS7 and Server 2008, you might be wondering what to do next. Well if you dont feel like learning the command line sequences for MySQL you might be interested in using a web based GUI based tool which will make managing the databases a lot easier. This tool is called PHPMyAdmin and can be found at www.phpmyadmin.net. What will you be able to do with PHPMyAdmin in the database? Here is a list of some of the features:

browse and drop databases, tables, views, fields and indexes create, copy, drop, rename and alter databases, tables, fields and indexes maintenance server, databases and tables, with proposals on server configuration execute, edit and bookmark any SQL-statement, even batch-queries load text files into tables administer multiple servers create and read dumps of tables search globally in a database or a subset of it

And that is just the short list of features of this very powerful application. It recently was named Best of Open Source Platforms and Middleware by Infoworld. Note: PHPMyAdmin requires both PHP and MySql to be installed on the server. If you need to please refer back to my articles on installing them:

Installing PHP Installing MySql

Download and Install PHPMyAdmin


Ok so now that we know why we should install it, lets get to the actual installation part. But before we begin, lets go download the software at:www.phpmyadmin.net/home_page/downloads.php. The current version as I write this article is 2.11.9, so I am going to go ahead and download that to get started. Which version you use will depend on your environment; I am going to use the english.zip for this demo. Lets get started! 1. Extract the files from the archive to a site that is available on the web server (remember the application is web based). For this demo I am going to use C:\inetpub\wwwroot\phpmyadmin

2. Now start IIS Manager and expand the default website; right click onphpmyadmin and left click on Convert to Application.

3. You can leave the default settings in place for the Add Application window and click OK.

4. Create a folder to save your PHP sessions; for our example I am going to useC:\temp\phpsessions and give full rights to the following users:

IUSR IIS_IUSRS Network Service 5. Now go into your php directory and find php.ini we have to make a few changes: Find session.save_path and set it to the same as you used in step 4 which in our case is C:\temp\phpsessions and save the file.

6. Please note that this application requires the following extensions for PHP:

MySQL GD MBSTRING If you do not have these on your server already, please install them. If you are using my article to install PHP then in step 6 just add the above extensions to your installation, or if you already installed it rerun the installer msi file and modify your installation to include these extensions. To check if they are installed do a search for extension=php_mysql in thephp.ini and you should see it uncommented. Do the same for the other extensions:

extension=php_gd2.dll extension=php_mbstring.dll

7. Go into IIS Manager, go to the default site (that is if you have been following my demo, if you have been modifying your site location or path then use that) and click on Default Document.

8. In the right pane click Add

9. In the dialog box type index.php and click Ok.

10. Go to the directory that you unzipped PHPMyAdmin to and look for a file named config.sample.inc.php and open it in Wordpad. (You can use notepad but it tends to jumble everything up) 11. Now find the line $cfg[blowfish_secret] = ; you have to fill in this line with anything that you want but it needs to be a value.

Only up to 46 characters and it can be alphanumeric. In this case I am going to use trainsignal1111TST

12. Go down to you see the section User for advanced features and uncomment (Remove the // from the front of the line) the two lines under that and change the pmapass to a different password, for this demo I am going to usetrainsignal.

13. next, go down to the next section Advanced phpMyadmin features and uncomment all the lines under it (remove the // from the front of the line).

14. Now save this file as config.inc.php 15. Point your browser to http://localhost/phpmyadmin/ (if you have been following this example; if you have used a different site/directory then point to that) and you should see a login page. Type in the userid and password for your local MySql server, then click Go.

16. Now you are in and able to manage your MySql instance! As a quick test lets create a database by scrolling to the Database link and clicking on it

17. Type in the name of your new database, for this example I am going to useTrainsignaltraining and then click Create.

18. You will now see a page that confirms that database Trainsignaltraininghas been created.

Thats all there is to it, now you can quickly and easily manage you MySql databases on IIS7 through PHPMyAdmin.

IIS 7: Install FastCGI PHP on Server 2008


By Dave Lawlor

One of the major advantages that the Apache web server enjoyed over IIS for years has been the native support for PHP. Most Windows Hosting you get will, if youre lucky, install PHP for you but not support it at best. This left some of the best open source programs out there too much of a hassle for most users. With the release of the FastCGI module you can now reliably host PHP programs on IIS. Lets go ahead and walk through installing the Fast CGI Module and PHP.

How to Install FastCGI on Server 2008


A few prerequisites for installing FastCGI would seem obvious but lets go ahead and mention them anyway. The first of course is an installation of Server 2008 (though this works on Vista if you are so inclined) and having IIS 7 installed already. You can also enable FastCGI while installing IIS, but for this demo I already have a virtual server with IIS 7 installed so lets go with that. If you need help installing the web server you can read my article on Installing IIS 7. Now lets start: 1. Open Server Manager. 2. In the left pane expand Roles and click Web Server (IIS), then in the center pane scroll down and click Add Role Services.

3. Next on the Select Role Services screen select CGI, under Application Development, then click Next.

4. Confirm Installation Selections by reviewing the options you picked and then click Install.

5. You should see Installation Succeeded on the Installation Results screen; go ahead and click Close.

6. You will now see the CGI role service under the IIS panel.

Now that wasnt too bad was it? You will notice that you installed CGI instead ofFastCGI, but by selecting CGI it enables both. Now lets move on to installing PHP!

How to Install PHP on IIS 7


When dealing with PHP there are many different versions that are in use and depending on the application you are going to be using you may need a specific version. There are also repackaged versions like those from Zend that are prepackaged and optimized extensions that work together. If you want to use the official release you can get it from:http://www.php.net/downloads.php For this demo I am going to use PHP 5.2.6 Non-thread-safe installer underWindows Binaries. It is recommended to use the non-thread safe build with IIS 7 since FastCGI will ensure single threaded execution environment. Once you download it to your server lets get started. 1. Left click on the PHP Installer Binary.

2. You will now see the PHP Setup Wizard window, go ahead and click Next.

3. On the End-User License Agreement, go ahead and place a check in the box accepting the terms in the License Agreement and then click Next.

4. Now select a destination folder, for our example I am going to use C:\PHP5\, type or navigate to where you want to install it and click Next.

5. Now select IIS FastCGI as the web server and click Next.

6. The Choose Items to Install screen is next. I am going to stick with the default, as adding extensions that you dont need increases your vulnerability profile.

If you have need of an additional Extension just open up the drop down and choose it, then click Next.

7. Here comes the big moment! Click Install and watch the magic happen.

8. You should see the Setup Completion screen now. Go ahead and clickFinish.

9. Ok, now we will have to make a few modifications to the way PHP handles itself so we are going to modify the php.ini file. First navigate to the place you installed PHP and open php.ini in notepad.

10. First lets modify fastcgi.impersonate and set it to 1. Remember you are going to have to uncomment these first and then change the value, and alsoCTRL+F is your friend!

11. Now find cgi.fix_pathinfo and set it to 1 also, remember to uncomment by removing ;

12. Next up is cgi.force_redirect and we are going to set this to 0, and uncomment.

13. Then lets set open_basedir to the root level of our website content directory, which I will use the default C:\inetpub

14. Now save your changes to php.ini

Thats it! Lets go ahead and test the install, by going to a command prompt and doing the following: 1. Open a command prompt. 2. Navigate to the directory you installed PHP to. 3. Type in: PHP info and you should see a lot of scrolling and information. This means PHP is good to go. Below is the start of the command and output, then the second picture is the last thing that will be shown.

You have now properly installed and tested PHP on the server. Now we have to configure IIS 7 to use PHP through FastCGI.

How to Configure IIS7 to use PHP


IIS7 can be configured to handle PHP mappings at server or site levels, but for this example we are going to set the configuration at the server level. This just basically tells the server how to handle files with .php type extensions. 1. Open IIS Manager and select the server in the left pane and then click on Handler Mappings in the center pane.

2. In the right Action pane select Add Module Mapping

3. Fill out the following information and click OK: Request Path: *.php Module: FastCgiModule Executable: {path to your PHP install}\php-cgi.exe Name: Whatever you want

4. You will get a popup asking if you want to create a FastCGI application, go ahead and click Yes.

5. You will now see your enabled handler in the list.

You have now successfully setup your IIS7 web server to handle PHP files via FastCgi. But dont take my word for it, lets go ahead and run a test. 1. Navigate to the default site directory at C:\inetpub\wwwroot 2. Create a file called info.php and place the following in the file: <?php phpinfo(); ?> 3. Open your browser and point it at http://localhost/info.php and you should see a PHP information page similar to this:

This shows a successful handling of PHP files by IIS7. You have now configured your server to run PHP via FastCGI on IIS7. My next article in this series will talk about installing some of the more popular databases and applications that can use PHP. If you have any requests feel free to leave a comment.

Install MySQL on IIS7 Server 2008


By Dave Lawlor

Now that you have installed PHP on your server, most of the popular PHP applications like WordPress & Joomla will require a database on the backend to support them. While there are other options, MySQL is usually the database of choice to use for these applications. It is one of the most widely supported databases so you can usually find help if you run into a snag. In this article we will install MySQL 5 on a Windows Server 2008 running IIS7.

How to Install MySQL on IIS7


As of this writing the current production version of MySQL is 5.0 Community, so that is what we are going to use for this example. We are also going to use the installer package, which can be downloaded at the following location:

MySQL Windows 32-Bit http://dev.mysql.com/downloads/mysql/5.0.html#win32 MySQL Windows 64-Bit http://dev.mysql.com/downloads/mysql/5.0.html#winx64

In this case we are going to use the 32-bit "Essential" binary which is recommended for most users, so I am going to go ahead and have that downloaded onto our test machine and then we will get going. 1. Find where you downloaded the file and click on the .msi file.

2. At the setup wizard click Next.

3. I am going to choose the Typical install and then click Next.

4. Review your chosen options then click Install.

5. Next you will see an advertisement to upgrade to MySQL Enterprise version. For some that is a good option as you get quite a bit of benefit from having the service relationship in place compared to the community addition. You can read the ad or click for more information, but if you want to continue installing the software click Next

6. Now you will see an advertisement for their monitoring service to keep a professional eye on your database. If you have a need for such service I encourage you to click the More button, but otherwise click Next.

7. You should now arrive at the Wizard Completed window. Leave the boxConfigure the MySQL Server now checked and click on Finish.

8. Now we will see the MySQL Server Instance Configuration Wizard, which will walk you through configuring your MySQL installation. Go ahead and click Next.

9. In the next screen we will see two different options Detailed & Standard, I am going to go ahead and select the Detailed and click Next.

10. The MySQL Instance Configuration screen is next, you have three options:

Developer Machine Many other apps will be running on this machine and MySQL should use a minimal amount of memory.

Server Machine Server apps will be running, this is the setting to use for web servers, MySQL will use a medium amount of memory. Dedicated MySQL Server Machine The big papa of installation choices, MySQL will be the only application on this server and will utilize all available memory.

We are going to go ahead and choose Server Machine for this demo, then click Next.

11. Now we have to select the database usage. There is a lot that can be said for this but I am going to give you a quick summary: The choices here boil down to what you are going to be using the database for and what feature set you need. The main difference between the MyISAM andInnoDB is speed and reliability. If you need transactional support you should know it and you would know to select Transactional Database to use InnoDB and use that. In our demo we are going to use the Multifunctional Database to give us the greatest flexibility. After selecting that click Next.

12. On the next windows you choose the place to put the InnoDB datafile. If you have a raid or array storage you may want to move it there for performance/reliability reasons, but for this demo we will use the default and click Next.

13. The next decision to make is how many connections to set the server up for.

Since this is going to be on a web server I am going to set it up to use 500 active connections at one time by selecting Online Transaction Processing (OLTP), but note that you can also setup a custom number by using the Manual Setting. If I was working on a development box I would have probably selected Decision Support as that assumes 20 connections and would be ideal for just test purposes. After you make your decision click Next.

14. This next screen is very important because it sets how other applications will connect to your MySQL instance. The default port is 3306 and it is recommended that you leave this as is because it is the assigned port and most 3rd party applications you use will try to connect on that port. Now if you are coding your own application and can customize the port the application will use, then you could change the port. You can also add a firewall exception by checking the box next to the port number. This is tricky depending on how your environment is going to be setup. I am going to add the exception for this demo but you may want to be more restrictive and only open the exception to the servers that would be connecting to the MySQL apps. Enable Strict Mode is another added feature to MySQL 5 and it is recommended to leave it on. This basically does some data checks and forces applications to use correct formats. Note: This may break some legacy apps that used older MySQL versions, but it is more preferable to patch those apps and keep this mode enabled.

After making your selections click Next.

15. Now we will set the default character set that the database will use. Again this will really be dependent on what your environment is, but for this demo we are going to use Best Support for Multilingualism as that supports most languages. If you know you are going to be using a specific set than you can also set that by using the Manual option. After you are done go ahead and click Next.

16. The next screen will setup MySQL to run as a service so if there are any reboots the database will come back up automatically. You can also set the Service name which is useful if you have more than 1 instance of MySQL running. You can also select Include Bin Directory in Windows Path to add the server/client variables into the PATH variable. This is useful if you will be working from the command line for any reason. For this demo we are going to select it and then click Next.

17. Now lets set a root password for the MySQL server instance. Type it in twice to confirm it, but leave Enable root access from remote machines unchecked unless you know you will need that. Also leave Create An Anonymous Account unchecked as that could cause security issues.

18. Finally we arrive at the final configuration window. All that is left is to click onExecute to setup the MySQL instance. Go ahead and click you know you want to!

19. You will see a brief summary at the end of the install that will let you know everything completed successfully and ask you to click Finish. Now that you have a powerful database like MySQL installed on you server it gives you quite a few options for some great open source apps when combined with PHP and other programming languages. My next article will be how to use some graphical applications to manage your MySQL databases.

Vous aimerez peut-être aussi