Installing and configuring Apache Server. Apache Configuration Overview in Ubuntu Configuration Apache

Set the minimally necessary attributes to work, for this open file to edit. /etc/httpd/conf/httpd.conf.

Apache can work with one of the three available multiprocessor modules (MPM):

  1. preform- one process to request, the most commonly used module;
  2. worker.- several processes with several threads in each;
  3. event- A new experimental version of the standard worker multiprocessor module.

To view information about modules, follow:

# httpd -v | Grep "Server MPM"

An example of a configuration for Apache 2.4


ServerLimit 256.
StartServers 20.
MinspareServers 20.
MaxspareServers 20.
MaxRequestworkers 256.
MaxConnectionsPerchild 4000.

MaxRequestWorkers Set the server equal to ServerLimit.

Configuration Example for Apache 2

In the section [Multiprocessor module]\u003e, for example, Set the following values:

StartServers 5.
MinspareServers 10.
MaxSpareServers 10.
MaxClients 30.
ServerLimit 30.

StartServers - the number of processes started, counting how (All Memory - Memory for Server, MySQL, Memcache, etc.) / Process Size. For example, 64GB - 32GB / 0.256GB \u003d maximum of 125 processes.

MinspareServers- Minimum number of idle processes.

MaxspareServers.- Maximum number of idle processes.

Maxclients- limit of processes.

ServerLimit.- Sets the same maxclient values.

Incidentally, it is necessary to approach the calculation of MaxClients, because When setting a small value, the number of web server failures may increase on the customer's request. Installing too much value can lead to a swap and a significant increase in the response time of the WEB server.

When using single-level and two-level configuration of the VTB server, the limits are installed differently. Giving the formed pages to the easier VTB server (for example, Nginx), the limits can be reduced. Specific values \u200b\u200bare calculated individually for each web server.

Keepalive.

When requesting a page with a web server, the browser sends many requests for loading CSS-styles, images, etc. Using KeepALIVE allows you to request a page and files related to it for one connection.

  1. Turn on Keepalive, for this line Keepalive Off We replace on Keepalive ON.
  2. MaxkeepaliveRequests. Set to 100.
  3. KeepaliveTimeout. Most often is installed in the range of 2 - 10. We recommend setting 5 seconds.

The Web server is a very complex software product that works on different platforms and in different operating systems. For correct operation in the installed system it must be configured.

By default, Apache settings are located in the file " httpd.conf."in the catalog" conf.".

You should pay special attention to the path to files in the Apache and PHR configuration files. You often have to specify paths to different directories and files. On UNIX and Windows operating systems, various directories are applied. The UNIX uses a direct oblique line (/) in Windows - reverse (/). In some APACHE and PNP directives, both types of catalog separators work. But since Apache and PHR were initially developed under UNIX, then, using their "native" format, you can avoid a number of problems. Therefore, the paths in configuration files " httpd.conf."And" php.ini."It is recommended to write through the slash in UNIX format -" / ".

For instance:
Scriptalias "/ PHP_DIR /" "C: / PHP /" File Directives httpd.conf.:

Port. - Specifies the TCP port, which is used apache to establish a connection. The default port 80 is specified. You can also specify the port in the Directive ServerName..
PORT 80 The only reason for establishing a non-standard port is the lack of rights to use the standard port. When using a non-standard port, for example, 8080, the port number should be specified in the address " http: // LocalHost: 8080 /".

Serveradmin. - Contains the specified email address of the Web server administrator. It is this address that will be displayed when server operation errors.
Serveradmin. [Email Protected] ServerName. - Contains the specified computer name for the server.
ServerName Localhost: 80 Serverroot. - Indicates a directory containing Apache Web Server.
ServerRoot "C: / Web_Server / Apache" Documentroot - Specifies the directory in which the Web site files are located.
Documentroot "C: / Web_Server / Apache / Htdocs" Container

The scope of directives within this container applies to all files and subdirectories inside the directive specified in the Directive Documentroot.

Options FallowSymlinks Includes Indexes
AllowOverride All.
Directive AllowOverride Installed in value All.allows you to override the value of the main configuration file " httpd.conf."in files" .htaccess.".

Directive Options FollowSymLinks. Allows Apache to follow a symbolic link.

Directive Options includes. Allows the execution of SSI (Server Side Includes, on the server side) in the website of the Web site page.

Directive Options indexes. Indicates that you need to return the contents of the directory if there is no index file.

DirectoryIndex - Contains the specified list of index files that should be displayed when accessing the directory without specifying the name of the file.
DirectoryIndex index.html index.htm index.php directive Scriptalias. Used to create a catalog pseudonym " / CGI-BIN /", in which CGI programs and scripts are located.
Scriptalias / CGI-BIN / "C: / WEB_SERVER / ApACHE / CGI-BIN /" Next, you need to configure the rights and directory restrictions cgi-bin..

ALLOWOVERRIDE NONE.
Options ExecCGI.
Order Allow, Deny
ALLOW FROM ALL
This action is necessary to ensure that the directory options will not be changed, as this can create security problems.

Directive ALLOWOVERRIDE NONE. suggests that the options of this directory cannot be redefined by files " .htaccess.".

Directive Options ExecCGI. Allows the execution of CGI-scenarios.

Directive order Allow., deny and ALLOW FROM ALL Allow access to the catalog.

AddHandler - causes Apache to consider files with extensions " eXE"And" bat."like CGI - scripts.
Addhandler CGI-Script .bat .exe DefaultType. Sets the header of the files whose type cannot be determined by expansion. In this case, all unknown files are perceived as ordinary text files. In order for all unknown file extensions to process, like HTML, change the directive as follows:
DefaultType Text / HTML AdddefaultCharset. - Sets the default encoding if the encoding is not specified in the HTML document header.
AdddefaultCharset Windows-1251

Apache is a whole family of various projects, the first of which was a Web server. The Web server is represented by the HTTPD daemon, so the Apache design of the Web server is called httpd.

The HTTPD Web Server Configuration Files in GNU / Linux in different distillation is located in different directories: / etc / httpd / conf /, or / etc / apache2, or other. The main configuration file is called httpd.conf, and the individual configuration files are often allocated for any settings for any settings connected to httpd.conf using the Include directive.

In general, the HTTPD settings can be divided into three main categories:

r Global Settings Section;

r settings for the main server;

r settings for virtual nodes.

In addition to these sections, you can select the settings for processing specified files, MIME expansion and processing specifications of national languages.

The global server settings include those that affect the APACHE server in general. Next, the main global settings are given:

r ServerRoot is the base directory of the installation, relative to which the Apache configuration files are placed in the GNU file system, as well as some files required in its operation;


r PIDFILE - File in which the Apache server is started with PID

main server process;

r LoadModule - command Download Apache extension module compiled in the form of a shared library;

r Timeout - the number of seconds before sending the connection loss signal;

r keepalive - permission or prohibition of support for long-lived compounds available under the HTTP / 1.1 protocol, allowing you to leave the unimpressible state after sending the required information by the server;

r keepaliveTimeout - the number of seconds of waiting for the next query, after which the long-lived connection will be broken;

r maxkeepaliverequests - the maximum possible number of requests permitted for long-lived compounds;

r StartServers is the number of HTTPD subsidiaries that start when you start the Apache server;

r MinspareServers is the minimum amount of HTTPD processes of the subsidies (when connections appear, so much httpd is launched so that the number of pending subsidiaries is no less than this value);

r MaxSpareServers is the maximum number of HTTPD processing connections (extra processes);

r MaxClients is a limit on the maximum number of HTTPD subsidiaries, which determines the possible number of compounds;

r maxRequestSperchild is the maximum number of queries that is solved by one-person HTTPD process, when it is reached, it is guaranteed to eliminate possible memory leaks.

ServerRoot "/ etc / httpd" PIDFILE RUN / httpd.pid timeout 120

Keepalive Off MaxkeepaliveRequests 100


KeepaliveTimeout 15.

StartServers
MinspareServers
MaxspareServers.
ServerLimit.
Maxclients

MaxRequestSperchild 4000.

LISTEN 80.

LoadModule auth_basic_module modules / mod_auth_basic.so LoadModule auth_digest_module modules / mod_auth_digest.so LoadModule authn_file_module modules / mod_authn_file.so LoadModule authn_alias_module modules / mod_authn_alias.so LoadModule authn_anon_module modules / mod_authn_anon.so

User Apache Group Apache

It should be noted that modules can not only be connected using the LoadModule directive, but also installed directly into the Apache code at the compilation and assembly stage. To determine which modules were installed in the code at the compilation stage, execute the HTTPD -L command (follow-up 28.2).

$ / usr / sbin / httpd -l compiled in modules:

cORE.C PREFORK.C HTTP_CORE.C MOD_SO.C

Pay attention to the preform.c module is one of several different MODULES modules (MULTI-PROCESSING MODULES) available for Apache V2. These modules are focused on different operating systems or at different models of multitasking processing. For example, the preform.c module is oriented to the traditional Unix model for the generation of child processes, and worker.c - to work with flows.


Among the settings of the main server are the most important:

r Listen - causes Apache to listen only to the specified port;

r user is a user, on behalf of which httpd processes will be run;

r Group - a group on behalf of which subsidiaries will be launched

r Documentroot is a directory of the placement of the web site files;

r userdir - the name of the catalog to accommodate personal web pages of users;

r DirectoryIndex - a list of file names that will be viewed while trying to access the directory root document;

r AccessFileName - the name of the file containing the directive control of the device to the catalog;

r TypeSconfig - locates the MIME configuration file location;

r DefaultType - Specifies the MIME-type default document;

r MimemagicFile - locates the magic number file to determine the MIME type of the document;

r HostNameLookups - Specifies the type of information on requests for clients or by the IP address or by name of the node;

r errorlog - log file in which any errors will be recorded

(Messages) who encountered in the process of Apache;

r Loglevel is the level of journaling information;

r LogFormat is a directive that defines the format of information output to the journal;

r CustomLog - indicates the location of the log file;

r Serversignature - allows you to display in the pages generated by the Apache server, version information, virtual node, etc.;

r Alias \u200b\u200b- sets aliases to access the sewing directories (the length of the pseudonym string is less than the length of the access path line);

r scriptalias - does the same as Alias, but for catalogs with CGI-

scenarios;

r indexoptions - determines the type of indexing directories;

r Addicon - Specifies the icon file to display in specific situations, for example, when displaying a page with a directory content of different types of files, different icons are compared;

r AddiconByencoding - Specifies icons for specific MIME encodings;


r AddiconBYTYPE - Specifies icons for certain MIME types of documents;

r Defaulticon - default icon;

r AddDescription - adds a comment string to specific types of documents (for example, .gz - Gzipped Document);

r ReadMename - Specifies the name of the readme file added to the end of the file list in the directory (Directory Index);

r HeaderName - Specifies the name of the HEADER file being added to the beginning of the file list in the directory (Directory Index);

r indexignore - file names that will be ignored when indexing;

r Addencoding - allows browsers to handle information on the fly (for example, display the contents of compressed gzip files);

r AddLanguage - Displays the specified file name extensions to a specific document language (for example, AddLanguage RU .RU);

r AddCharset - sets the display of a specific file name extension to a specific encoding;

r LanguagePriority is the order of languages;

r AddType - Specifies the display of file name extensions to MIME type;

r AddHandler - Sets the type of processing to expand file names;

r ErrorDocument - allows you to configure error messages;

r Browsermatch - Specifies the features of information output for browsers.

In the configuration file httpd.conf, conventional species are often found. . With their help, you set such Apache settings that are possible if this module is present (Example 28.3).

Alias \u200b\u200b/ Doc / USR / Share / Doc

In this example, the DOC alias is installed for the / usr / share / doc directory. However, such a pseudonym will be installed only in the case of the MOD_ALIAS.C module. Having such an alias (if there is appropriate permit), it will be possible to handle the web browser to the contents of the / usr / Share / Doc content, using the URL http: // localhost / doc.


Another type of conditional directive is . These directives contain the Apache settings blocks that work only under the condition for determining some additional parameter. This parameter can be specified using the -D option of the HTTPD executable file.

Often Apache comes with very extensive documentation in HTML format. For example, in Fedora distributions, the Apache Documentation is traditionally available after the APACHE is started on the URL http: // localhost / manual.

For Apache configuration there are 4 main approaches:

  1. Compilation / installation: Assembly from sources allows you to select the necessary modules, install the desired flags, pathways, etc.
  2. Command line parameters: allow you to configure Apache at startup.
  3. Global configuration files: The main file is default called httpd.conf.
  4. Local configuration files: Use.htaccess.

Configuration directives in the httpd.conf file can be divided into 3 categories:

  1. Directives that control the overall work process.
  2. Virtual host directives.
  3. Virtual host settings.

The directives of the first group include , , , , , .

They are used in binding to a specific file structure or to the URL. In the first case it , in the second - . Apache can serve at the same time several websites with various names, implementing virtual hosting, which is done on the basis of directive . In order for changes in the main config, the server must be restarted.

Local configuration is implemented based on.htaccess. The name of this file can be changed in the AccessFileName section. Changes in the file.htaccess come into force immediately, without restarting, its action applies to the directory in which it lies with all nested subdirectories. Excessive use .HTaccess can affect server performance.

The contents of the main config of httpd.conf can be divided into 5 sections:

  1. Global directives.
  2. - Applicable to wipe servers.
  3. , - Applicable catalogs.
  4. , - Applicable files.
  5. , - Apply to the URL.

The directive may have several parameters, the type of parameters may vary.

Each directive is processed by a specific module.

For example, Directive

The next directive will be processed by the MOD_ENV module, the environment variable will be installed:



The contents of the local file.htaccess can also be divided into 5 sections:

  1. Authconfig - Authorization control.
  2. Limits - Access Control.
  3. Options are specific catalog settings.
  4. FileInfo - Installing Attributes for Documents.
  5. Indexes - indexing directories.

In Ubuntu Apache, it is located at / etc / apache2 and, in addition to configuration files, contains the "SITES-AVAILABLE" and "SITES-ENABED" directory. The first directory contains a list of sites that are available on the server, and in the second - those serviced by the server. This makes it possible to quickly add and delete sites that will be served by the server, without having to physically delete them from Documentroot. In addition to this, other settings files can be added using Include instructions, and grouping characters can be used to enable multiple settings files. Any instruction can be added to any of these settings files. The server also reads files containing MIME documents; The file name is set by the TypeSconfig instructions, usually through /etc/apache2/mods-available/mime.conf, which can also include additions and overrides, and the default is /etc/mime.Types.

httpd.conf - Apache Server Configuration

Apache is configured by placing directives into normal configuration text files. The main configuration file of the Apache server - httpd.conf..
With the help of the Include Directive, other configuration files can be added. Any directive can be installed in any of these configuration files.
Apache 2.4 is configured by files in the subdirectory (default) - Conf. (C: \\ Program Files \\ Apache2.4 \\ conf \\ Apache2.4 \\ CONF \\). These are the same files as for configuring on OS UNIX, but there are several directives specially designed for Windows.

The main configuration file of the APACHE server HTTP 2.4 is usually called - httpd.conf..

It contains directives and parameters that control the work of the Web server, virtual servers, as well as all APACHE 2.4 software modules. . Apache is a modular server. This means that only the most basic functionality is included in the main server. Expansion of functions available using dynamically downloadable modules. Configuration files contain one directive in the string. The inclined feature of the left "\\" can be used as the last character in the string, to indicate that the directive continues to the next string. There should be no other characters or spaces between the inclined line to the left and the end of the line. Directives in configuration files are insensitive to the register, but the arguments of directives are often sensitive. Rows that start with the "#" symbol are considered comments, and ignored. Comments cannot be included in the row after the configuration directive. Empty lines and spaces, before the directive are ignored.

Directive - The configuration command that controls one or more aspects of the APACHE server behavior.
Directives posted in the basic configuration files include the entire server. .

To check the configuration files on syntax errors, the command is used. httpd.exe -t..

When installing Apache 2.4, it was introduced:

In Network Domain (network domain) - server-Apache2.ru.
in Server Name - www.server-apache24.ru.
In Administrator "S Email ADRESS (admin postal address) - [Email Protected]

Hence, server-Apache2.ru. - It will be the name of the main site of the Apache server.

APACHE Server Main Website is configured in the file - httpd.conf..

Amendments to the Apache Server Configuration File - httpd.conf

To appeal to the main site of the Apache server on the domain name - server-Apache2.ru., create a catalog on disk - C: \\ Server-Apache24.ru

Server-Apache2.ru.

  • C: \\ Server-Apache24.ru
    • logs.
      • access.log.
      • error.log.
    • www.
      • index.html

Catalog Server-Apache24.ru.

At the root of the disk C: You need to create a catalog server-Apache2.ru.
In him Before There must be folders:
logs. With "empty" files access.log. and error.log.
and
www. with file. index.html

See in the httpd.conf file strings -
209 Serveradmin. [Email Protected]
218 ServerName www.server-apache2.ru:80
243 Documentroot "C: /Server-apache24.ru/www"
245

httpd.conf. - Configuring the APACHE 2.4 server

httpd.conf..
Action of the Main Configuration File Directives applies to the entire server.

All entries, with the exception of red-selected, must be commented. Rows starting with symbol "#" - These are comments.

# # This is the main Apache HTTP server configuration file. IT Contains The # Configuration Directives That Give The Server Its Instructions. # See for detailed information. # IN PARTICULAR, SEE # # For a Discussion of Each Configuration Directive. # # Do Not Simply Read The Instructions in Here Without Understanding # What They Do. They "Re Here Only As Hints Or Reminders. If You Are Unsure # Consult The Online Docs. You have Been Warned. # # Configuration and Logfile Names: If the Filenames You Specify for Many # Of the Server" S CONTROL FILES BEGIN WITH " / "(OR" Drive: / "for Win32), The # Server Will Use That Explicit Path. If The Filenames Do * Not * Begin # With "/", The Value of Serverroot Is Prepended - SO "Logs / Access_log" # With Serverroot Set to "/ usr / local / apache2" Will Be Interpreted by the # Server AS " / usr / local / apache2 / logs / access_log ", whereas" / logs / access_log "# Will Be Interpreted AS" / LOGS / access_log ". # # Note: Where Filenames Are Slaffied, You Must Use Forward Slashes # Instead of Backslashes (E.G., "C: / Apache" Instead of "C: \\ Apache"). # If a drive letter is omitted, the drive on which httpd.exe is located # will be used by default. It is Recommended That You Always Supply # an Explicit Drive Letter in Absolute Paths to Avoid Confusion. # # Serverroot: The Top of the Directory Tree Under Which The Server "S # Configuration, Error and Log Files Are Kept. # # Do Not Add a Slash at the End of the Directory Path. If You Point # Serverroot at a non -Local Disk, Be Sure to Specify A Local Disk On The # Mutex Directive, If File-Based Mutexes Are Used. If You Wish to Share The # Same Serverroot for Multiple Httpd Daemons, You Will Need to Change at # Least Pidfile. # ServerRoot "C: / Program Files / Apache2.4" # # Mutex Mechanism and Mutex File Directory # For Individual Mutexes File Directory # For Global Defaults # # Uncomment and Change The Directory If Mutexes Are File-based And The Default # Mutex File Directory IS Not On a Local Disk or Is Not Appropriate for some # # Other Reason. # # Mutex Default: Logs # # Listen: Allows You to Bind Apache to Specific IP Addresses and / or # Ports, Instead of the Default. See Also The # Directive. # # Change This To Listen On Specific IP Addres SES AS SHOWN BELOW TO # Prevent Apache from Glomming Onto All Bound IP Addresses. # #Listen 12.34.56.78:80 Listen 80 # # Dynamic Shared Object (DSO) Support # # To Be Able to Use The Functionality of a Module Which Was Built As A DSO You # Have to Place CRESPONDING `Loadmodule" Lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l") do not need # to be loaded here # # Example:. # LoadModule foo_module modules / mod_foo.so # LoadModule access_compat_module modules / mod_access_compat.so LoadModule actions_module modules / mod_actions.so LoadModule alias_module modules / mod_alias.so LoadModule allowmethods_module modules / mod_allowmethods.so LoadModule asis_module modules / mod_asis.so LoadModule auth_basic_module modules / mod_auth_basic.so #LoadModule auth_digest_module modules / mod_auth_digest.so #LoadModule authn_anon_module modules / mod_authn_anon.so LoadModule authn_core_module modules / mod_authn_core. so #LoadModule authn_dbd_module modules / mod_authn_dbd.so #LoadModule authn_dbm_module modules / mod_authn_dbm.so LoadModule authn_file_module modules / mod_authn_file.so #LoadModule authn_socache_module modules / mod_authn_socache.so #LoadModule authnz_ldap_module modules / mod_authnz_ldap.so LoadModule authz_core_module modules / mod_authz_core.so #LoadModule authz_dbd_module Mo. dules / mod_authz_dbd.so #LoadModule authz_dbm_module modules / mod_authz_dbm.so LoadModule authz_groupfile_module modules / mod_authz_groupfile.so LoadModule authz_host_module modules / mod_authz_host.so #LoadModule authz_owner_module modules / mod_authz_owner.so LoadModule authz_user_module modules / mod_authz_user.so LoadModule autoindex_module modules / mod_autoindex.so # LoadModule buffer_module modules / mod_buffer.so #LoadModule cache_module modules / mod_cache.so #LoadModule cache_disk_module modules / mod_cache_disk.so #LoadModule cern_meta_module modules / mod_cern_meta.so LoadModule cgi_module modules / mod_cgi.so #LoadModule charset_lite_module modules / mod_charset_lite.so #LoadModule data_module modules /mod_data.so #LoadModule dav_module modules / mod_dav.so #LoadModule dav_fs_module modules / mod_dav_fs.so #LoadModule dav_lock_module modules / mod_dav_lock.so #LoadModule dbd_module modules / mod_dbd.so #LoadModule deflate_module modules / mod_deflate.so LoadModule dir_module modules / mod_dir. So #LoadModule D. umpio_module modules / mod_dumpio.so LoadModule env_module modules / mod_env.so #LoadModule expires_module modules / mod_expires.so #LoadModule ext_filter_module modules / mod_ext_filter.so #LoadModule file_cache_module modules / mod_file_cache.so #LoadModule filter_module modules / mod_filter.so #LoadModule headers_module modules / mod_headers.so #LoadModule heartbeat_module modules / mod_heartbeat.so #LoadModule heartmonitor_module modules / mod_heartmonitor.so #LoadModule ident_module modules / mod_ident.so LoadModule imagemap_module modules / mod_imagemap.so LoadModule include_module modules / mod_include.so #LoadModule info_module modules / mod_info.so LoadModule isapi_module modules / mod_isapi.so #LoadModule lbmethod_bybusyness_module modules / mod_lbmethod_bybusyness.so #LoadModule lbmethod_byrequests_module modules / mod_lbmethod_byrequests.so #LoadModule lbmethod_bytraffic_module modules / mod_lbmethod_bytraffic.so #LoadModule lbmethod_heartbeat_module modules / mod_lbmethod_heartbeat.so #LoadModule ldap_module modules / mod_ldap.so #LoadModule logio_module modules / mod_logio.so LoadModule log_config_module modules / mod_log_config.so #LoadModule log_debug_module modules / mod_log_debug.so #LoadModule log_forensic_module modules / mod_log_forensic.so #LoadModule lua_module modules / mod_lua.so LoadModule mime_module modules / mod_mime. so #LoadModule mime_magic_module modules / mod_mime_magic.so LoadModule negotiation_module modules / mod_negotiation.so #LoadModule proxy_module modules / mod_proxy.so #LoadModule proxy_ajp_module modules / mod_proxy_ajp.so #LoadModule proxy_balancer_module modules / mod_proxy_balancer.so #LoadModule proxy_connect_module modules / mod_proxy_connect.so #LoadModule proxy_express_module modules / mod_proxy_express.so #LoadModule proxy_fcgi_module modules / mod_proxy_fcgi.so #LoadModule proxy_ftp_module modules / mod_proxy_ftp.so #LoadModule proxy_html_module modules / mod_proxy_html.so #LoadModule proxy_http_module modules / mod_proxy_http.so #LoadModule proxy_scgi_module modules / mod_proxy_scgi.so #LoadModule ratelimit_module modules / mod_ratelimit.so #LoadModule reflector_module modules / mod_reflector.so #LoadModule remoteip_module modules / mod_remoteip.so #LoadModule request_module modules / mod_request.so #LoadModule reqtimeout_module modules / mod_reqtimeout.so #LoadModule rewrite_module modules / mod_rewrite.so #LoadModule sed_module modules / mod_sed.so #LoadModule session_module modules / mod_session.so #LoadModule session_cookie_module modules / mod_session_cookie.so #LoadModule session_crypto_module modules / mod_session_crypto.so #LoadModule session_dbd_module modules / mod_session_dbd.so LoadModule setenvif_module modules / mod_setenvif.so #LoadModule slotmem_plain_module modules / mod_slotmem_plain.so #LoadModule slotmem_shm_module modules / mod_slotmem_shm.so #LoadModule socache_dbm_module modules / mod_socache_dbm.so #LoadModule socache_memcache_module modules / mod_socache_memcache.so #LoadModule socache_shmcb_module modules / mod_socache_shmcb.so #LoadModule speling_module [Email Protected] # Serveradmin. [Email Protected] # # ServerName Gives The Name and Port That The Server Use to Identify Itself. # THIS CAN OFTEN BE DETERMINED AUTOMATICALLY, But We Recommend You Specify # it Explicitly to Prevent Problems During Startup. # # If Your Host Doesn "T Have A Registered DNS Name, ENTERNAME WWW.SERVER-APACHE24UN :80 # # Deny Access to the Entirety of Your Server" s Filesystem. You Must # Explicitly Permit Access to Web Content Directories in Other # Blocks Below. # ALLOWERRIDE NOTE REQUIE AL DENIED # PARTICULAR FEATURES TO BE ENABLED - SO IF SOMETHING "S NOT WORKING AS # You Might Expect, make sure that you have specifically enabled it # below. # # # Documentroot: The Directory Out of Which You Will Serve Your # Documents. By Default, All Requests Are Taken From This Directory, But # Symbolic Links and Aliases May Be Used to Point to Other locations. # # Documentroot "C: / Program Files / Apache2.4 / Htdocs "was Documentroot" C: /Server-apache24./www "# # # Possible Values \u200b\u200bfor the Options Directive Are" None "," All ", # Or Any Combination : # Indexes Includes FallowSymLinks Symlinksifownermatch ExecCGI MultiViews # # Note That "MultiViews" Must Be Named * Explicitly * --- "Options All" # DOESN "T GIVE IT TO You. # # The Options Directive IS Both Complicated and Important. Please see # //httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # # Options Indexes FollowSymLinks Was Options Indexes Includes Followermlinks Symlinksifownermatch Execcgi MultiViews # # # ALLOWOVERRIDE CONTROLS WHAT DIRECTS MAY BE PLACED IN.HTAccess Files. # IT CAN BE "ALL", "NONE", OR ANY COMBINATION OF THE KEYWORDS: # ALLOWOINRIDE FILEINFO AUTHCONFIG LIMIT # # ALLOWOVERRIDE NONE was ALLOWOVERRIDE ALL # # CONTROLS WHO CAN GET STUFF FROM This Server. # Require All Granted Addhandler Server-Parsd .shtml .shtm .html .htm # # DirectoryIndex: Sets The File That Apache Will Serve If A Directory # is Requested. # DirectoryIndex Index.html # # The Following Lines Prevent .htaccess and .htpasswd Files from Being # Viewed by Web Clients. # Require All Denied # # Errorlog: The Location of the Error Log File. # If You Do Not Specify An Errorlog Directive Within A # CONTAINER, ERROR MESSAZ RELATING TO THAT VIRTUAL HOST WILL BE # LOGGED HERE. If you * Do * Define An Error Logfile for a # CONTAINER, THAT HOST "S Errors Will Be Logged There and Not Here. # # ErrorLog "Logs / error.log" was errorlog c: /server-apache24.ru/logs/error.log # # Loglevel: Control The Number of Messages Logged to the Error_log. # Possible Values \u200b\u200bInclude: Debug, Info, Notice, Warn, Error, Crit, # Alert, Emerg. # Loglevel Warn # # The Following Directives Define Some Format Nicknames for Use with # A CUSTOMLOG DIRECTIVE (See Below). # LogFormat "% h% l% u% t \\"% r \\ "%\u003e S% B \\"% (Referer) i \\ "\\"% (User-Agent) i \\ "" Combined LogFormat "% h% l % u% t \\ "% r \\"%\u003e s% b "Common # You need to enable mod_logio.c to use% i and% o logformat"% h% l% u% t \\ "% r \\"%\u003e S% B \\ "% (Referer) i \\" \\ "% (User-Agent) I \\"% i% o "Combinedio # # The Location and Format of the Access Logfile (Common Logfile Format). # If You Do Not Define Any Access Logfiles Within A # CONTAINER, THEY WILL BE LOGGED HERE. ContrariWise, If You * Do * # Define Per- Access Logfiles, Transactions Will Be # Logged Therein and * Not * In This File. # # CustomLog "logs / access.log" Common was customlog c: /server-apache24.ru/logs/Access.log Common # # if you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) You CAN USE THE FOLLOWING DIRECTIVE. # #CustomLog "Logs / access.log" Combined # # Redirect: Allows You to Tell Clients About Documents That Used to # Exist in Your Server "s Namespace, But Do not Anymore. The Client # Will Make a New Request for the Document AT Its New Location. # examples: # Redirect Permanent / Foo //www.server-apache24.ru/bar # # Alias: Maps Web Paths Into Filesystem Paths and IS Used to # Access Content It Does Not Live Under the Documentroot. # EXAMPLE: # Alias \u200b\u200b/ Path # #Full / FileSystem / Path # # If You include the server Will # Require It to be present in the url. You Will Also Likely # Need to Provide a Section to Allow Access to # the filesystem path # # ScriptAlias:. This controls which directories contain server scripts # ScriptAliases are essentially the same as Aliases, except that # documents in the target directory are treated as applications and # run by the server when requested rather than as. Documents Sent to the # Client. The Same Rules About Trailing "/" Apply to Scriptalias # DirectiveS As to Alias. # # Scriptalias / CGI-BIN / "C: / Program Files / Apache2.4 / CGI-BIN /" was scriptalias / cgi-bin / "c: /server-apache24.ru/cgi-bin/" # # Scriptsock: On Threaded Servers, Designate The Path to the UNIX # Socket Used to Communicate with the CGI Daemon of MOD_CGID. # #Scriptsock CGISOCK # # "C: / Program Files / Apache Software Foundation / Apache2.4 / CGI-BIN" SHOLD BE CHAGED TO WHATER YOUR Scriptalized # CGI Directory Exists, If You Have That Configured. # # ALLOWOVERRIDE NONE OPTIONS NONE REQUIRE ALL GRANTED # # TYPESCONFIG POINTS TO THE FILE CONTAINING THE LIST OF MAPPINGS FROM # FILENAME EXTENSION TO MIME-TYPE. # Typesconfig conf / mime.types # # AddType Allows You to Add to Or Override The Mime Configuration # file specified in TypeSconfig for Specific File Types. # #Adgz # # Addencoding Allows You to Have Certain Browsers Uncompress # Information on the Fly. Note: Not All Browsers Support This. # #Addencoding X-Compress .z #Addencoding X-Gzip .gz .tgz # # If the Addencoding Directives Above Are Commented-Out, Then You # Probably Schald Define Those Extensions to Indicate Media Types: # AddType Application / X-Compress. Z AddType Application / X-Gzip .gz .tgz AddType Application / X-Httpd-PHP .php # # Addhandler Allows You to Map Certain File Extensions to "Handlers": # Actions Unrelated to FileType. These Can Be Either Built Into The Server # # # # to use CGI Scripts Outside of Scriptaliased Directories: # (You Will Also Need To Add "ExecCGI" to the "options" directive.) # #ADDHANDLER CGI-Script .cgi Addhandler CGI-Script .cgi .pl # for Type Maps (Negotiated Resources): #Addhandler Type-Map Var # # Filters Allow You to Process Content Before IT IS Sent to the Client. # # To Parse .shtml Files for Server-Side Includes (SSI): # (You Will Also Need To Add "Includes" to the "Options" directive.) # AddType text / html .shtml addoutputfilter includes .shtml # # The Mod_mime_magic Module Allows The Server to Use Various Hints From The # Contents of the File Itself to Determine Its Type. The MimemagicFile # Directive Tells The Module Where the Hint Definitions Are Located. # #MimemagicFile Conf / Magic # # Customizable Error Responses Come in Three Flavors: # 1) Plain Text 2) Local Redirects 3) External Redirects # # Some Examples: #errordocument 500 "The Server Made A Boo Boo." - .html errordocument 500 c: /server-apache24.ru/www/500error.html # # Maxranges: Maximum Number of Ranges in a Request Before # Returning the Entire Resource, Or One of the Special # Values \u200b\u200b"Default", "None" OR "unlimited." # Default Setting Is To Accept 200 Ranges. #MaxRanges Unlimited # # Enablemmap and EnablesendFile: On Systems That Support It, # Memory-Mapping Or The Sendfile Syscall May Be Used to Deliver # Files. This Usually Improves Server Performance, But Must # Be Turned Off When Service From Networked-Mounted # Filesystems Or If Support for these Functions Is Otherwise # Broken on Your System. # Defaults: enablemmap on, enablesendfile off # #enablemmap off #enablesendfile on # supplemental configuration # # The Configuration Files in The Conf / Extra / Directory Can Be # Included to add Extra Features Or to Modify The Default Configuration of # The Default Configuration of # The Server You may Simply Copy Their Contents Here and Change AS # Necessary #INClude Conf / Extra / httpd-mpm.conf # Multi-Language Error Messages Include conf / extra / httpd-multilang-errodoc.conf # Fancy Directory Listings include conf / extra / httpd-autoindex .conf # Language Settings include Conf / Extra / httpd-languages.conf # user home directories include conf / extra / httpd-userdir.conf # real-time info on requests and configuration #include conf / extra / httpd-info.conf # Virtual Hosts Include Conf / Extra / httpd-vhosts.conf # Local Access to the Apache Http Server Manual #include conf / extra / httpd-manual.conf # Distributed Authoring and Versioning (WebDAV) #include conf / extra / httpd-dav. conf # Various default settings Include conf / extra / httpd-default.conf # Configure mod_proxy_html to understand HTML4 / XHTML1 Include conf / extra / proxy-html.conf # Secure (SSL / TLS) connections #Include conf / extra / httpd-ssl .conf # # Note: The Following Must Must Be Present to Support # Starting Without SSL on Platforms with No / Dev / Random Equivalent # But A Statically compiled-in mod_ssl. # SSLRANDOMSEED STARTUP BUILTIN SSLRANDOMSEED CONNECT BUILTIN # # Uncomment Out The Below to Deal with User Agents That Deliberately # Violand Open Standards by Misusing DNT (DNT * Must * Be a Specific # End-User Choice) # # #BrowSermatch "MSIE 10.0;" Bad_DNT # # #requestheader Unset DNT ENV \u003d Bad_DNT #


Change .
Team - httpd.exe -k RestartAllows you to complete any operation executed by the Apache server and forces Apache to re-read the configuration file.


Search and solve errors when installing Apache server

Apache comes with a utility called Apache Service Monitor. With it, you can see and manage the status of all installed Apache services on any computer on the network.

Restarting Apache 2.4.

As change In the main configuration files take effect only when you start or restart Apache server,
You need to restart the server.

Apachemonitor.

ApacheMonitor icon can be seen by clicking on the button - display hidden icons

Double-click the left mouse button on the icon. Apache Service Monitor.

You can click on the Apache server by clicking on the button. Restart.
In the Apache Service Monitor program window.
Or - Stop. and then - Start..

If you have made changes only to the httpd.conf file,

that introducing browser to the address string - Localhost. or - 127.0.0.1 ,
You will see a page - Error 403 (Error 403).

Access Forbidden!

You don "T Have Permission to Access The Requested Directory. There Is Ener No Index Document or the Directory IS Read-Protected.
If You Think This Is A Server Error, Please Contact The Webmaster.

Error 403.

127.0.0.1
Apache / 2.4.4 (Win64)

Access is denied!

You do not have permission to access the requested directory. There is no index document or directory is protected from reading.
If you think this is a server error, refer to the webmaster.

Error 403.

Enter the administrator rights to the command line - Administrator - Command String
and enter:
"C: \\ Program Files \\ Apache2.4 \\ Bin \\ Apache2.4 \\ Bin \\ httpd.exe" 2\u003e C: \\ ERRAPACHE.TXT

Microsoft Windows (C) Microsoft Corporation, 2016. All rights reserved. C: \\ Windows \\ System32\u003e "C: \\ Program Files \\ Apache2.4 \\ Bin \\ Apache2.4 \\ Bin \\ httpd.exe" 2\u003e C: \\ ERRAPACHE.TXT C: \\ Windows \\ System32\u003e

On disk C: / File will be created eRRAPACHE.TXT.


AH00112: WARNING: Documentroot Does Not Exist AH00112: Warning: Documentroot Does Not Exist (OS 10048) is usually allowed only to use the socket address (protocol / network address / port). : AH00072: Make_Sock: COULD NOT BIND TODRESS [::]: 80 (OS 10048) is usually allowed only to use the socket address (protocol / network address / port). : AH00072: Make_Sock: COULD NOT BIND TO Address 0.0.0.0:80 AH00451: No Listening Sockets Available, Shutting Down AH00015: Unable to Open Logs

AH00112: Warning (Warning):
C: / Program Files / Apache2.4 / docs / dummy-host.server-apache2.ru
C: / Program Files / Apache2.4 / docs / dummy-host2.server-apache2.server-apache2.ru
They do not exist (does not exist).

But the main thing - is OS error 10048:

failed to tie to the address [::]: 80 (COULD NOT BIND TODRESS [::]: 80)
could not bind to address 0.0.0.0:80 (could not bind to address 0.0.0.0:80)

Enter the command line and enter:
netstat -aon

Administrator: Command Line

Microsoft Windows (C) Microsoft Corporation, 2016. All rights reserved. C: \\ Windows \\ System32\u003e netstat -aon Active Connections Name Local Address External Address PID TCP 0.0.0.0.0.0.0.0.0.0.0.0 :: Listening 1612 TCP [:::]: 80 [::]: 0 listening 1612 TCP 127.0.0.1:49693 127.0.0.1:49694 Established 5612 TCP 127.0.0.1:49694 127.0.0.1:49693 Established 5612 TCP 127.0.0.1:51341 0.0.0.0: Listening 3920 TCP 127.0.0.1:52006 0.0.0.0: Listening 3708 TCP 192.168.0.100:139 0.0.0.0 Listening 4 tcp 192.168.0.100:51330 34.226.135.28:443 Established 1232 TCP 192.168.0.100:51345 52.196.85.70:443 Established 1232 TCP 192.168.0.100:52796 88.212.253.127:21 Established 1128 TCP 192.168.0.100:53160 151.101.112.134 : 443 Close_Wait 3712 TCP 192.168.0.100:53161 151.101.112.134:4432.12.12.12.134:443 0.12.10.0.100:53162 151.101.128.134:44:443 0.12.101.12.134:443.168.0.100:53176 151.101.112.134:44:443 0.1101.112.134:44333.0.100:53179 151.101 .128.233 443 CLOSE_WAIT 3712 TCP 192.168.0.100:53192 151.101.112.64:443 CLOSE_WAIT 3712 TCP 192.168.0.100:53223 23.61.217.175:443 CLOSE_WAIT 3712 TCP 192.168.0.100:53230 185.29.133.52:443 Close_wait 3712 TCP 192.168.0.100:53246 2.18.74.149:443 Close_Wait 3712 TCP 192.168.0.100:53271 52.205.235.141:443 Established 5236 C: \\ Windows \\ System32\u003e

The process identifier, more known as the PID identifier is a unique number. Each process running on the system has a unique identifier.
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1612
TCP [:::]: 80 [::]: 0 listening 1612

Open Task Manager

Only APACHE2.4 has a PID identifier - 1612

In catalog C: / Program Files / Apache2.4 / Conf / Extra / Software Foundation / Apache2.4 / Conf / Extra /
Open the file in the notepad - httpd-vhosts.conf.

Before making any changes, make a backup copy of the file - httpd-vhosts.conf..

Replace in the VirtualHost sections
on the

httpd-vhosts.conf. - Contents Apache 2.4 Server Configuration File

# Virtual hosts # # Required Modules: mod_log_config # if you want to maintain multiple domains / hostnames on your # Machine You Can Setup Virtualhost Containers for them. Most Configurations # Use Only Name-based Virtual Hosts So The Server Doesn "T Need To Worry About # ip Addresses. This Is Indicated by The Asterisks in the Directives Below. # # Please See The Documentation AT #

In catalog C: \\ Windows \\ System32 \\ Drivers \\ ETC \\
Open the file in the notepad - hosts.
And add a string to it:

127.0.0.1 Localhost www.server-apache24.ru Server-apache24.ru

Singing the Apache server by pressing the button Restart.
In Apache Service Monitor.

Enter browser to the address bar - server-Apache2.ru.
and see you created by you, index page of the main site of the APACHE2.4 server

The site index page must be in the WWW subdirectory (C: \\ Server-apache24.ru \\ www \\)

After installing Apache 2.4 server, log in to the command line and enter commands:

httpd.exe -t.

Two warnings will be received.

Administrator: Command Line

Microsoft Windows (C) Microsoft Corporation, 2016. All rights reserved. C: \\ Windows \\ System32\u003e cD C: \\ Program Files \\ Apache2.4 \\ Bin \\ Apache2.4 \\ Bin \\ Apache2.4 \\ Bin C: \\ Program Files \\ Apache Software Foundation \\ Apache2.4 \\ bin\u003e httpd.exe -t. AH00112: Warning: Documentroot Does Not Exist AH00112: Warning: Documentroot Does Not Exist Syntax OK C: \\ Program Files \\ Apache2.4 \\ Bin\u003e