httpd is the server binarythat is, this is the actual executable file that is run when you start up your Apache server. You'll find this file in the bin directory of your Apache directory tree. The size of this file will vary depending on what you have built into your server, but it will be around 1MB in size, and will be the largest file in that directory.1
apachectl is just a wrapper that feeds arguments directly to the httpd binary for common options. There are a number of other things that you can do by passing arguments directly to httpd.
Starting and Stopping with httpd
To start the Web server, without any special options, simply invoke httpd directly:
To stop the Web server, you'll need to know the PID (process ID) of the Apache parent process. You can acquire this PID from the file httpd.pid, which is located in the directory with your log filesusually /usr/local/apache/logs.
cat /usr/local/apache/logs/httpd.pid | xargs kill
By passing additional arguments to httpd, you can have it behave in ways slightly different from what you have configured in the server configuration files.
For a complete listing of the available command-line options, invoke httpd with the -h option:
# /usr/local/apache/bin/httpd -h Usage: /usr/local/apache/bin/httpd [-D name] [-d directory] [-f file] [-C "directive"] [-c "directive"] [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T] Options: -D name : define a name for use in <IfDefine name> 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 -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 (with docroot check) -T : run syntax check for config files (without docroot check)
We'll come back to a number of these options as we talk more about the surrounding information necessary to understand what they do, but of particular interest at this time are the following options:
httpd -v: Shows you what version of the server you are running. This is a good way to convince yourself, after a new install, that you are in fact running the new version, and not some old version that happened to be laying around in your path somewhere.
httpd -V: Tells you what compile settings were in effect when you built Apache.
httpd -l: Lists the compiled-in modules. This will give you some assurance that what you did in the configuration phase actually paid off, and you got the modules that you wanted.