What is the command apachectl in Linux

  

apachectl is the front-end program of the Apache HTTP server. It is designed to help administrators control the functionality of the Apache httpd daemon.

The apachectl script has two modes of operation. First, as a simple httpd front-end program, set all the necessary environment variables, then start httpd and pass all the command-line arguments. Second, as a SysV initialization script, accept a simple word argument, such as: start, restart, stop, and translate them to the appropriate signal to send to httpd.

If your Apache installation is in a non-standard path, you will need to modify the apachectl script to make the path to the httpd program correctly. In addition, you can specify any necessary httpd command line arguments. See the comments in the script for details.

The apachectl script returns 0 if it succeeds; if it fails, it returns a value of >0. See the comments in the script for more details.

Syntax

Apacctl can accept all parameters valid for the httpd program when playing the role.

apachectl [ httpd-argument ]

In SysV initialization mode, apachectl only accepts a simple word command as follows:

apachectl command
Options
The following only describes the options for the SysV initialization type. For other parameters, see the httpd man page.

start
Start the Apache httpd daemon. If it has already started, an error is generated. It is equivalent to apachectl -k start .
stop
Stop the Apache httpd daemon. It is equivalent to apachectl -k stop .
restart
Restart the Apache httpd daemon. Start the daemon if it is not already running. This command automatically checks the configuration file with configtest before restarting the daemon to ensure that Apache does not die. It is equivalent to apachectl -k restart .
fullstatus
Shows the full status report provided by mod_status. To use this feature, you need to enable the mod_status module on the server, and there is a text-based browser on the system, such as lynx. Modify the STATUSURL variable in the script to modify the URL of the access status report.
status
Shows a brief status report. It is similar to the fullstatus option, but omits the list of requests being processed.
graceful
Gracefully restart the Apache httpd daemon. If the daemon has not yet started, start it. It differs from the standard restart in that it does not interrupt the currently open connection and does not immediately close the log. This means that if you use it in a log scrolling script, you must add a real delay before processing the log to ensure that the old log file is closed before it is processed. This command automatically checks the configuration file with configtest before restarting the daemon to ensure that Apache does not die. It is equivalent to apachectl -k graceful.
graceful-stop
Gracefully stop the Apache httpd daemon. It differs from the standard stop in that it does not interrupt the currently open connection and does not immediately close the log. It is equivalent to apachectl -k graceful-stop .
configtest
Perform a configuration file syntax check. It parses the configuration file and reports Syntax Ok or specific syntax error details. It is equivalent to apachectl -t .

The following options were only used in earlier versions and are now deprecated.

startssl
Start httpd in a way that supports SSL. You should edit the configuration file and include the instructions related to SSL support, then start the server with apachectl start.


Copyright © Windows knowledge All Rights Reserved