ServerRoot Path to the executable files of the Apache HTTP server. Listen Sets the port and IP address that Apache listens on. By default, all browsers attempt to open an HTTP connection to the Apache server via port 80. If you set a different port number, such as 9031, you must specify the port after the page address using a colon, for example: http://localhost:9031. Additionally, this directive can specify a single IP address that Apache will handle (e.g., Listen 192.168.0.10:80) if the computer has two or more IP addresses. DocumentRoot This directive in httpd.conf defines the directory where the HTML and other files of a single site are located. If it is necessary to support two or more sites with a single Apache server, you should use the <VirtualHost></VirtualHost> container directive. When using virtual hosts, do not forget to configure access rights for the directory specified in the "DocumentRoot" line, as pages from this directory will be displayed to users who entered a domain not listed in VirtualHost. <Directory>
...
</Directory>
configures the behavior of the specified directory. Instead of a directory name, you can use regular expressions. Options The Options directive determines which server features are available in a specific directory.
- All - all options are allowed, except MultiViews (set by default).
- None - all options are disabled.
- ExecCGI - execution of CGI scripts is allowed.
- FollowSymLinks - the server will follow symbolic links in this directory.
- Includes - SSI (Server-Side Includes) is allowed.
- IncludesNOEXEC - SSI is allowed, but #exec and #include commands in CGI scripts are blocked.
- Indexes - if the requested URL corresponds to a directory, and there is nothing in this directory matching DirectoryIndex (e.g., Index.htm), the server will return a list of all files and directories in the directory.
- MultiViews - content-negotiated MultiViews are allowed.
- SymLinksIfOwnerMatch - the server will follow only those symbolic links for which the target file or directory has the same user ID as the link.
<Directory "c:/www/otherdir">
Options Includes
</Directory>
In this example, the c:/www directory and all its subdirectories, except c:/www/otherdir, are assigned "Indexes" and "FollowSymLinks". However, the c:/www/otherdir subdirectory and all its subdirectories are assigned only the "Includes" option.
<Directory "c:/www/otherdir">
Options +Includes -Indexes
</Directory>
In this case, the c:/www/otherdir directory will have the "FollowSymLinks" option (added for the parent directory) and "Includes" (added using the "+" sign). The "Indexes" option is removed from the c:/www/otherdir directory using the "-" sign. AllowOverrideThe AllowOverride option tells Apache which directives in the .htaccess file are allowed (the filename ".htaccess" or any other is defined by the AccessFileName directive).
- All - all directives are available (used by default).
- None - .htaccess is not processed.
- AuthConfig - allows the use of authorization directives (AuthDBMGroupFile, AuthDBMUserFile, AuthGroupFile, AuthName, AuthType, AuthUserFile, require, etc.).
- FileInfo - allows the use of directives controlling document types (AddEncoding, AddLanguage, AddType, DefaultType, ErrorDocument, LanguagePriority, etc.).
- Indexes - allows the use of directory indexing control directives (AddDescription, AddIcon, AddIconByEncoding, AddIconByType, DefaultIcon, DirectoryIndex, FancyIndexing, HeaderName, IndexIgnore, IndexOptions, ReadmeName, etc.).
- Limit - allows the use of basic access control directives (allow, deny, and order).
- Options[=Option,...] - allows the use of directives controlling specific directory features (Options and XBitHack).
Order The Order directive controls the default access state and the order in which access is granted or denied. Order can take 3 values:
- Allow,Deny - access is denied by default, except for hosts specified in the line after Allow from.
- Deny,Allow - access is granted by default, except for hosts specified in the line after Deny from.
- Mutual-failure - access is granted only to hosts that are present in Allow and absent in Deny.
Additional information about the Allow, Deny, and Order directives can be found in the official Apache 2.2 documentation (eng). <VirtualHost>
...
</VirtualHost>
<VirtualHost *:80>
ServerName second.loc
ServerAlias www.second.loc
DocumentRoot "c:/www/second.loc/public"
ErrorLog "c:/www/second.loc/public"
</VirtualHost>
