How to reboot apache

How to reboot apache

The most popular and multifunction HTTP server is Apache for today. It is very stable and capable to function continuously within long years. However for update of configuration settings, for example, at change of the list of virtual hosts, it is necessary to reboot Apache.

It is required to you

  • - rights of root on the target machine;
  • - perhaps, program SSH client.

Instruction

1. Become authorized on the local machine or be connected to a remote server on which Apache is started, and also execute authorization. If you have physical access to the machine on which the server requiring resets functions and to it are connected the monitor with the keyboard, process of authorization will not be problems.

If to the target machine there is only a remote access on SSH, apply client programs to connection implementation. Under Windows it is possible to use freely extended graphic client of PuTTY available for loading on the website putty.nl. In Linux-like systems switch in the text console or start the terminal emulator, and then execute a view command:
ssh of an imya_polzovatelya@adres_server<br< a=""> />
After connection enter the password.</br<>

2. Begin the superuser's session. Execute the su command. Enter the password root.

3. Define what of the Apache servers is started on the target machine. Execute a command:
service httpd status

The message of a type of httpd is running will demonstrate that version 1.x Apache functions. Message of service: httpd: Unrecognized service indicates that this service is not installed. The inscription httpd is stopped says that the server is installed, but does not work.

The same way check whether Apache of versions 2.x is started. Execute a command:
service httpd2 status

Upon check the existence or absence of httpd and httpd2 services will be revealed. At the same time they (including at the same time) can be both are started, and stopped. If on the target machine Apache functions, pass to the following step.

4. Reboot Apache. For reset of the server by its stop and the subsequent start, execute a view command:
restart imya_sluzhba service
Specify as a name of service httpd or httpd2 depending on the results received on the previous step. For implementation of "soft" reset with update of a configuration instead of the restart parameter use graceful. For example:
service httpd2 graceful
This method is more preferable.

5. Complete the work. Close the superuser's session, having executed the exit command. Be disconnected from the server by means of the exit or logout commands.

Author: «MirrorInfo» Dream Team


Print