apache2.service apache2 restart
The server daemon, apache2, recognizes several command-line options you
can use to set some defaults, such as specifying where apache2 reads its
configuration directives. The Apache apache2 executable also understands
other options that enable you to selectively use parts of its configuration file,
specify a different location for the actual server and supporting files, use a
different configuration file (perhaps for testing), and save startup errors to a
specific log. The -v option causes Apache to print its development version
and quit. The -V option shows all the settings that were in effect when the
server was compiled.
The -h option prints the following usage information for the server:
Click here to view code image
matthew@seymour:~$ apache2 -h
Usage: apache2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|stop]
[-v] [-V] [-h] [-l] [-L] [-t]
Options:
-D name : define a name for use in
directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost
settings)
-t : run syntax check for config files
Other options include listing Apache’s static modules, or special, built-in
independent parts of the server, along with options that can be used with the
modules. These options, called configuration directives, are commands that
control how a static module works. Note that Apache also includes a large
number of dynamic modules, or software portions of the server that can be
optionally loaded and used while the server is running.
The -t option is used to check your configuration files. It’s a good idea to
run this check before restarting your server, especially if you’ve made