httpd

Apache hypertext transfer protocol server

httpd [-X] [-R libexecdir] [ -d serverroot] [-f config] [ -C directive] [-c directive] [-D parameter]

httpd [-h] [-l] [-L] [-v] [-V] [-S] [-t] [-T]

sudo apachectl start|stop|restart

httpd may be invoked by the Internet daemon inetd(8) each time a connection to the HTTP service is made.

See the Apache manual .

-k start
  restart
  graceful
  stop
  graceful-stop
-e lvlError Log level
-E startupErrsFileerror messages during startup
-d serverroot Default /usr/local/apache2.
-f startCmdsFile Execute startCmdsFile on startup.
Default /usr/local/apache2/conf/httpd.conf.
-C directive Process before config
-c directive Process after config
-D parameter Sets a configuration parameter which can be used with <IfDefine>..</IfDefine> sections in the configuration files to conditionally skip or process commands.
-l list of modules compiled into the server.
-L list directives provided by statuc modules
-Mmap of loaded Static and Shared Modules.
-S Show virtualhost settings as parsed config
-t Run syntax tests for config
-T Skip document root check at startup/restart.
-X single-process debugging
-R libexecdir Overides ServerRoot only Apache built with SHARED_CORE
-v output version and exit.
-V output version and build parameters exit.
Server version: Apache/2.2.22 (Unix)
Server built:   Aug 24 2012 17:16:58
Server's Module Magic Number: 20051115:30
Server loaded:  APR 1.4.5, APR-Util 1.3.12
Compiled using: APR 1.4.5, APR-Util 1.3.12
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/private/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

      
-h
 Usage: ./httpd [-D name] [-d directory] [-f file]
               [-C "directive"] [-c "directive"]
               [-k start|restart|graceful|graceful-stop|stop]
               [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]
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)
  -S                 : a synonym for -t -D DUMP_VHOSTS
  -t -D DUMP_MODULES : show all loaded modules 
  -M                 : a synonym for -t -D DUMP_MODULES
  -t                 : run syntax check for config files
  -T                 : start without DocumentRoot(s) check

       

FILES

       /etc/httpd/httpd.conf
       /etc/httpd/srm.conf
       /etc/httpd/access.conf
       /etc/httpd/mime.types
       /etc/httpd/magic
       /var/log/httpd/error_log
       /var/log/httpd/access_log
       /var/run/httpd.pid

htpasswd generate passwords

.htaccess contains pointer to the password file.

.htpasswd is a frequent name.

See also

inetd

Allowed in *.conf in .htaccess
when AllowOverride
<Files Container for directives affecting files matching specified patterns anywhere isn't None
<IfVersion (mod_version.c) a comparison operator, a version (and a delimiter) anywhere
[no per-dir config]
isn't None
<Limit Container for authentication directives when accessed using specified HTTP methods anywhere isn't None
<LimitExcept Container for authentication directives to be applied when any HTTP method other than those specified is used to access the resource anywhere isn't None
<IfModule Container for directives based on existance of specified modules anywhere isn't None
<IfDefine Container for directives based on existance of command line defines anywhere isn't None
<FilesMatch Container for directives affecting files matching specified patterns anywhere isn't None
AuthType An HTTP authorization type (e.g., "Basic") only inside Directory, Files or Location includes AuthConfig
AuthName authentication realm
(e.g. "Members Only")
only inside Directory, Files or Location includes AuthConfig
Require Selects which authenticated users or groups may access a protected space only inside Directory, Files or Location includes AuthConfig

Satisfy access policy if both allow and require used ('all' or 'any') only inside Directory, Files or Location includes AuthConfig
AddDefaultCharset The name of the default charset to add to any Content-Type without one or 'Off' to disable anywhere includes FileInfo
AcceptPathInfo Set to on or off for PATH_INFO to be accepted by handlers, or default for the per-handler preference anywhere includes FileInfo
ErrorDocument Change responses for HTTP errors anywhere includes FileInfo
Options
of attributes for a given directory
None Turns off all extra features.
All Enables every feature except MultiViews.
Indexes Shows a folder listing if no index file (like index.html) is found.
FollowSymLinks follow symbolic links.
ExecCGI Allows running CGI scripts.
Includes Enables server-side includes.
a plus sign (+) to add an attribute to the inherited settings.
a minus sign (-) to remove an attribute from the inherited settings.
Mixing + and - in the same line requires care, as
an option without + or - resets the list entirely.
anywhere includes Options
ContentDigest whether or not to send a Content-MD5 header with each request anywhere includes Options
DefaultType default MIME type for untypable files anywhere includes FileInfo
ForceType a mime type that overrides other configured type anywhere includes FileInfo
FileETag Specify components used to construct a file's ETag anywhere includes FileInfo
EnableMMAP Controls whether memory-mapping may be used to read files anywhere includes FileInfo
EnableSendfile Controls whether sendfile may be used to transmit files anywhere includes FileInfo
ServerSignature En-/disable server signature (on|off|email) anywhere isn't None
RLimitCPU Soft/hard limits for max CPU usage in seconds anywhere isn't None
SetHandler handler override anywhere includes FileInfo
SetOutputFilter filter (or ; delimited list of filters) to be run on the request content anywhere includes FileInfo
SetInputFilter filter (or ; delimited list of filters) to be run on the request body anywhere includes FileInfo
AddOutputFilterByType output filter name followed by one or more content-types anywhere includes FileInfo
LimitRequestBody Limit (in bytes) on maximum size of request message body
anywhere isn't None
Protocol Protocol for httpd to use.
Port replaced with Listen in Apache 2.0 only outside Directory, Files or Location
AcceptFilter Accept Filter to use for a protocol
ServerAlias alternately used to access the server
ServerPath server pathname
User Effective user id
Group Effective group id
DocumentRoot Root directory of the document tree
Timeout seconds
AllowOverride the groups of directives can be configured by per-directory config files only inside Directory, Files or Location
Include additional config file anywhere
HostnameLookups one | off reverse DNS lookups, or double to enable double-reverse DNS lookups anywhere
ServerAdmin email address of the server administrator.
ServerName hostname and port of the server.
ServerRoot Common directory of server-related files (logs, confs, etc.).
LogLevel for error logging
CustomLog name and custom log format string or format name, and an optional "env=" clause (see docs)
TransferLog access log
CookieLog filename
BufferedLogs Enable Buffered Logging (experimental)
ErrorLog filename of the error log.
LogFormat a log format string (see docs) and an optional format name
UseCanonicalName How to work out the ServerName : Port when constructing URLs anywhere
UseCanonicalPhysicalPort Whether to use the physical Port when constructing URLs. anywhere
NameVirtualHost numeric IP address:port or
name of a host
PidFile file for logging the server process ID
ServerTokens Determine tokens displayed in the Server: header - Min(imal), OS or Full
LimitRequestLine maximum size
LimitRequestFields max number of header fields in a request message(0 = unlimited)
LimitRequestFieldsize maximum size of request header field
LimitXMLRequestBody maximum size of an XML-based request body (bytes)
MaxRanges Maximum number of Ranges in a request before returning the entire resource (0 unlimited) anywhere
MaxRequestsPerChild serves before dying.
MaxMemFree 1k blocks a childs allocator may hold.
<Directory Container for directives affecting resources located in the specified directories
<DirectoryMatch Container for directives affecting resources located in the specified directories
<LocationMatch Container for directives affecting resources accessed through the specified URL paths
<Location Container for directives affecting resources accessed through the specified URL paths
<VirtualHost Container to map directives to a particular virtual host, takes one or more host addresses
AllowEncodedSlashes Allow URLs containing '/' encoded as '%2F'
RLimitMEM Soft/hard limits for max memory usage per process
RLimitNPROC soft/hard limits for max number of processes per uid
LimitInternalRecursion maximum recursion depth of internal redirects and subrequests
AccessFileName per-directory config files (default: )
ScoreBoardFile used to maintain runtime process management information
LockFile used when needed to lock the accept() call
AcceptMutex Valid accept mutexes for this platform and MPM are: default, flock, fcntl, sysvsem, posixsem, pthread.
ThreadStackSize bytes of stack used by threads handling client connections
TraceEnable 'on' (default), 'off' or 'extended' to trace request body content
Suexec Enable or disable
ChrootDir The directory to chroot(2) into
ListenBacklog Maximum length of the queue of pending connections, as used by listen(2)
Listen A port number or a numeric IP address and a port number, and an optional protocol
SendBufferSize Send buffer size in bytes
ReceiveBufferSize Receive buffer size in bytes
StartServers Number of child processes launched at server startup
MinSpareThreads Minimum number of idle threads, to handle request spikes
MaxSpareThreads Maximum number of idle threads
MaxClients Maximum number of threads alive at the same time
ThreadsPerChild Number of threads each child creates
ServerLimit Maximum number of child processes
ThreadLimit Maximum number of worker threads per child process Upper limit for ThreadsPerChild
KeepAliveTimeout seconds
MaxKeepAliveRequests per connection.
KeepAlive persistent connections should be On or Off
LoadModule module and shared object file to load it from
LoadFile shared object file or library to load at runtime
GracefulShutdownTimeout seconds to wait for child processes during shutdown
CoreDumpDirectory change to before dumping core

starting apache under Mac OS X
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

See

lighttpd.