2Xmoinscher.com

 
WinLAMP
Documentation
Le Libre
  •  
  •  
  •  
  •  
  •  
  •  
  •  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  

 

L'installation de WinLAMP:

L'installation de WinLAMP > Lancer Apache en tant que Service > Lancer Apache à partir d'une Console d'Application > Tester l'Installation

Lancer Apache en tant que Service:

Apache peut être lancé en tant que service sous Windows NT. Il existe un projet encore hautement expérimental pour initier un comportement similaire sous Windows 9x.

Vous pouvez installer Apache en tant que service automatiquement durant le processus d'installation. Si vous choisissez l'option d'installation pour tous les utilisateurs, l'installation génèrera pour vous, un service Apache. Si vous spécifiez l'installer pour vous même seulement, vous pouvez enregistrer manuellement Apache en tant que service après l'installation. Vous devez être un membre du groupe des Administrateurs pour que le processus d'installation réussisse.

Apache est livré avec un utilitaire appelé l' "Apache Service Monitor". Avec celui-ci il est possible d'observer et de gérer l'état de tous les services Apache installés sur chaque machine de votre réseau. Pour pouvoir gérer un service Apache avec le moniteur, vous devez au préalable installer le service (soit automatiquement via l'installation ou manuellement).

Vous pouvez installer Apache en tant que service Windows NT as follows from the command prompt at the Apache bin subdirectory:

  apache -k install

Si vous avez besoin de spécifier le nom du service que vous voulez installer, utilisez la commande suivante. You have to do this if you have several different service installations of Apache sur votre ordinateur.

  apache -k install -n "MyServiceName"

Si vous avez besoin de nommer spécifiquement des fichiers de configuration pour différents services, vous devez utilisez celle-ci:

  apache -k install -n "MyServiceName" -f "c:\files\my.conf"

If you use the first command without any special parameters except -k install, the service will be called Apache2 and the configuration will be assumed to be conf\httpd.conf.

Supprimer un service Apache est simple. Utilisez juste:

  apache -k uninstall

Le service désigné Apache peut être désinstallé comme spécifié en utilisant:

  apache -k uninstall -n "MyServiceName"

Normal starting, restarting and shutting down of an Apache service is usually done via the Apache Service Monitor, by using commands like NET START APACHE2 and NET STOP APACHE2 or via normal Windows service management. Avant de démarrer Apache en tant que service by any means, vous devriez tester le fichier de configuration du service en utilisant:

  apache -n "MyServiceName" -t

You can control an Apache service by its command line switches, too. To start an installed Apache service you'll use this:

  apache -k start

To stop an Apache service via the command line switches, use this:

  apache -k stop

or

  apache -k shutdown

You can also restart a running service and force it to reread its configuration file by using:

  apache -k restart

By default, all Apache services are registered to run as the system user (the LocalSystem account). The LocalSystem account has no privileges to your network via any Windows-secured mechanism, including the file system, named pipes, DCOM, or secure RPC. It has, however, wide privileges locally.

    Never grant any network privileges to the LocalSystem account! If      you need Apache to be able to access network resources, create a      separate account for Apache as noted below

You may want to create a separate account for running Apache service(s). Especially, if you have to access network resources via Apache, this is strongly recommended.

    1.  Create a normal domain user account, and be sure to memorize its          password.

    2.  Grant the newly-created user a privilege of Log on as service and Act          part of the operating system. On Windows NT 4.0 these privileges          are granted via User Manager for Domains, but on Windows 2000 and          XP you probably want to use Group Policy for propagating these          settings. You can also manually set these via the Local Security bsp          Policy MMC snap-in.

    3.  Confirm that the created account is a member of the Users group.

    4.  Grant the account read and execute (RX) rights to all document and          script folders (htdocs and cgi-bin for example).

    5.  Grant the account change (RWXD) rights to the Apache logs          directory.

    6.  Grant the account read and execute (RX) rights to the          Apache.exe binary executable.

It is usually a good practice to grant the user the Apache service runs as read and execute (RX) access to the whole Apache2 directory, except the logs subdirectory, where the user has to have at least change (RWXD) rights.

If you allow the account to log in as a user and as a service, then you can log on with that account and test that the account has the privileges to execute the scripts, read the web pages, and that you can start Apache in a console window. If this works, and you have followed the steps above, Apache should execute as a service with no problems.

Error code 2186 is a good indication that you need to review the "Log On As" configuration for the service, since Apache cannot access a required network resource. Also, pay close attention to the privileges of the user Apache is configured to run as.

When starting Apache as a service you may encounter an error message from the Windows Service Control Manager. For example, if you try to start Apache by using the Services applet in the Windows Control Panel, you may get the following message:

  Could not start the Apache2 service on \\COMPUTER
  Error 1067; The process terminated unexpectedly.

You will get this generic error if there is any problem with starting the Apache service. In order to see what is really causing the problem you should follow the instructions for Running Apache for Windows from the Command Prompt.

There is some support for Apache on Windows 9x to behave in a similar manner as a service on Windows NT. It is highly experimental. It is not of production-class reliability, and its future is not guaranteed. It can be mostly regarded as a risky thing to play with - proceed with caution!

There are some differences between the two kinds of services you should be aware of:

  • Apache will attempt to start and if successful it will run in the background. If you run the command

       apache -n "MyServiceName" -k start

  • via a shortcut on your desktop, for example, then if the service starts successfully, a console window will flash up but it immediately disappears. If Apache detects any errors on startup such as incorrect entries in the httpd.conf configuration file, the console window will remain visible. This will display an error message which will be useful in tracking down the cause of the problem. 
  • Windows 9x does not support NET START or NET STOP commands. You must control the Apache service on the command prompt via the -k switches.
  • Apache and Windows 9x offer no support for running Apache as a specific user with network privileges. In fact, Windows 9x offers no security on the local machine, either. This is the simple reason because of which the Apache Software Foundation never endorses use of a Windows 9x -based system as a public Apache server. The primitive support for Windows 9x exists only to assist the user in developing web content and learning the Apache server, and perhaps as an intranet server on a secured, private network.
 

Once you have confirmed that Apache runs correctly as a console application you can install, control and uninstall the pseudo-service with the same commands as on Windows NT. You can also use the Apache Service Monitor to manage Windows 9x pseudo-services.