If configured with YaST (see Section 22.2.2, “Configuring Apache with YaST”), Apache is started at boot time in runlevels 3 and 5 and stopped in runlevels 0, 1, 2, and 6. You can change this behavior using YaST's runlevel editor or the command line tool chkconfig.
To start, stop, or manipulate Apache on a running system, use the init script /usr/sbin/rcapache2 (refer to Section 8.2.2, “Init Scripts” for a general information about init scripts.). The rcapache2 command takes the following parameters:
status
Checks whether Apache is started.
start
Starts Apache if it is not already running.
startssl
Starts Apache with SSL support if it is not already running. For more information about SSL support, refer to Section 22.6, “Setting Up a Secure Web Server with SSL”.
stop
Stops Apache by terminating the parent process.
restart
Stops and then restarts Apache. Starts the Web server if it was not running before.
try-restart
Stops then restarts Apache only if it has been running before.
reload
or graceful
Stops the Web server by advising all forked Apache processes to first finish their requests before shutting down. As each process dies, it is replaced by a newly started one, resulting in complete “restart” of Apache.
![]() | Tip |
---|---|
rcapache2 |
configtest
or extreme-configtest
Checks the syntax of the configuration files without affecting a running
Web server. Because this check is forced every time the server is
started, reloaded, or restarted, it is usually not necessary to run the
test explicitly (if a configuration error is found, the Web server is
not started, reloaded, or restarted). The
extreme-configtest
options starts the webserver as user
nobody
and actually loads the
configuration, so more errors can be detected. Note that although the
configuration is loaded, it is not possible to test the SSL setup,
because the SSL certificates cannot be read by nobody
.
probe
Probes for the necessity of a reload (checks whether the configuration has changed) and suggests the required arguments for the rcapache2 command.
server-status and full-server-status
Dumps a short or full status screen, respectively. Requires
either lynx or w3m installed as well as the module mod_status
enabled. In addition to that, status
must be added to
APACHE_SERVER_FLAGS
in
the file /etc/sysconfig/apache2
.
![]() | Additional Flags |
---|---|
If you specify additional flags to the rcapache2, these are passed through to the Web server. |