<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<!--
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
              This file is generated from xml source: DO NOT EDIT
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      -->
<title>Getting Started - Apache HTTP Server Version 2.4</title>
<link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet">
<link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size">
<link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css"><link rel="stylesheet" type="text/css" href="./style/css/prettify.css">
<script src="./style/scripts/prettify.min.js">
</script>

<link href="./images/favicon.png" rel="shortcut icon"></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.html">Directives</a> | <a href="https://cwiki.apache.org/confluence/display/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a> | <a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2">Report a bug</a></p>
<p class="apache">Apache HTTP Server Version 2.4</p>
<img alt="" src="./images/feather.png"></div>
<div class="up"><a href="./"><img title="<-" alt="<-" src="./images/left.gif"></a></div>
<div id="path">
<a href="https://www.apache.org/">Apache</a> &gt; <a href="https://httpd.apache.org/">HTTP Server</a> &gt; <a href="https://httpd.apache.org/docs/">Documentation</a> &gt; <a href="./">Version 2.4</a></div><div id="page-content"><div id="preamble"><h1>Getting Started</h1>
<button aria-label="Toggle language list" class="lang-toggle"><svg xmlns="http://www.w3.org/2000/svg" stroke-width="2" stroke="currentColor" fill="none" viewBox="0 0 24 24" height="16" width="16"><circle r="10" cy="12" cx="12"/><line y2="12" x2="22" y1="12" x1="2"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg></button>
<div class="toplang">
<p><span>Available Languages: </span><a href="./en/getting-started.html" title="English">&nbsp;en&nbsp;</a> |
<a href="./fr/getting-started.html" hreflang="fr" rel="alternate" title="Fran&ccedil;ais">&nbsp;fr&nbsp;</a> |
<a href="./ru/getting-started.html" hreflang="ru" rel="alternate" title="Russian">&nbsp;ru&nbsp;</a></p>
</div>

<p>If you're completely new to the Apache HTTP Server, or even to running
a website at all, you might not know where to start, or what questions to
ask. This document walks you through the basics.</p>
</div>
<div id="quickview"><ul id="toc"><li><img alt="" src="./images/down.gif"> <a href="#clientserver">Clients, Servers, and URLs</a></li>
<li><img alt="" src="./images/down.gif"> <a href="#dns">Hostnames and DNS</a></li>
<li><img alt="" src="./images/down.gif"> <a href="#configuration">Configuration Files and Directives</a></li>
<li><img alt="" src="./images/down.gif"> <a href="#content">Web Site Content</a></li>
<li><img alt="" src="./images/down.gif"> <a href="#logs">Log Files and Troubleshooting</a></li>
<li><img alt="" src="./images/down.gif"> <a href="#other">What's next?</a></li>
</ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
<h2 id="clientserver">Clients, Servers, and URLs <a title="Permanent link" href="#clientserver" class="permalink">&para;</a></h2>


<p>
Addresses on the Web are expressed with URLs - Uniform Resource Locators
- which specify a protocol (e.g. <code>http</code>), a servername (e.g.
<code>www.apache.org</code>), a URL-path (e.g.
<code>/docs/current/getting-started.html</code>), and possibly a query
string (e.g. <code>?arg=value</code>) used to pass additional
arguments to the server.
</p>

<p>A client (e.g., a web browser) connects to a server (e.g., your Apache HTTP Server),
with the specified protocol, and makes a <strong>request</strong> for a resource using the
URL-path.</p>

<p>The URL-path may represent any number of things on the server. It may
be a file (like <code>getting-started.html</code>) a handler (like <a href="mod/mod_status.html">server-status</a>) or some kind of program
file (like <code>index.php</code>). We'll discuss this more below in
the <a href="#content">Web Site Content</a> section.</p>

<p>
The server will send a <strong>response</strong> consisting of a status
code and, optionally, a response body.
The status code indicates whether the request was successful, and, if not, what
kind of error condition there was. This tells the client what it should
do with the response. You can read about the possible response codes in
<a href="https://cwiki.apache.org/confluence/display/httpd/CommonHTTPStatusCodes">HTTP Server
wiki</a>.</p>

<p>Details of the transaction, and any error conditions, are written to
log files. This is discussed in greater detail below in the <a href="#logs">Logs Files and Troubleshooting</a> section.</p>

</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
<h2 id="dns">Hostnames and DNS <a title="Permanent link" href="#dns" class="permalink">&para;</a></h2>


<p>In order to connect to a server, the client will first have to resolve
the servername to an IP address - the location on the Internet where the
server resides. Thus, in order for your web server to be reachable, it
is necessary that the servername be in DNS.</p>

<p>If you don't know how to do this, you'll need to contact your network
administrator, or Internet service provider, to perform this step for
you.</p>

<p>More than one hostname may point to the same IP address, and more
than one IP address can be attached to the same physical server. Thus, you
can run more than one web site on the same physical server, using a
feature called <a href="vhosts/">virtual hosts</a>.</p>

<p>If you are testing a server that is not Internet-accessible, you
can put host names in your hosts file in order to do local resolution.
For example, you might want to put a record in your hosts file to map a
request for <code>www.example.com</code> to your local system, for
testing purposes. This entry would look like:</p>

<div class="example"><p><code>
127.0.0.1 www.example.com
</code></p></div>

<p>A hosts file will probably be located at <code>/etc/hosts</code> or
<code>C:\Windows\system32\drivers\etc\hosts</code>.</p>

<p>You can read more about the hosts file at <a href="http://en.wikipedia.org/wiki/Hosts_(file)">Wikipedia.org/wiki/Hosts_(file)</a>, and
more about DNS at <a href="http://en.wikipedia.org/wiki/Domain_Name_System">Wikipedia.org/wiki/Domain_Name_System</a>.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
<h2 id="configuration">Configuration Files and Directives <a title="Permanent link" href="#configuration" class="permalink">&para;</a></h2>


<p>The Apache HTTP Server is configured via simple text files.
These files may be located any of a variety of places, depending on how
exactly you installed the server. Common locations for these files may
be found <a href="https://cwiki.apache.org/confluence/display/httpd/DistrosDefaultLayout">in
the httpd wiki</a>. If you installed httpd from source, the default
location of the configuration files is
<code>/usr/local/apache2/conf</code>. The default configuration file is
usually called <code>httpd.conf</code>. This, too, can vary in
third-party distributions of the server.</p>

<p>The configuration is frequently broken into multiple smaller files,
for ease of management. These files are loaded via the <code class="directive"><a href="./mod/core.html#include">Include</a></code> directive. The names or locations of
these sub-files are not magical, and may vary greatly from one
installation to another. Arrange and subdivide these files as
makes the most sense to <strong>you</strong>. If the file arrangement
you have by default doesn't make sense to you, feel free to rearrange it.</p>

<p>The server is configured by placing <a href="mod/quickreference.html">configuration directives</a> in these
configuration files. A directive is a keyword followed by one or more
arguments that set its value.</p>

<p>The question of "<em>Where should I put that
directive?</em>" is generally answered by considering where you want a
directive to be effective. If it is a global setting, it should appear
in the configuration file, outside of any <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>, <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>, <code class="directive"><a href="./mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>, or other section. If it is to
apply only to a particular directory, then it should go inside a
<code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> section referring to
that directory, and so on. See the <a href="sections.html">Configuration
Sections</a> document for further discussion of these sections.</p>

<p>In addition to the main configuration files, certain directives may go in
<code>.htaccess</code> files located in the content directories.
<code>.htaccess</code> files are primarily for people who do not have
access to the main server configuration file(s). You can read more about
<code>.htaccess</code> files in the <a href="howto/htaccess.html"><code>.htaccess</code> howto</a>.</p>

</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
<h2 id="content">Web Site Content <a title="Permanent link" href="#content" class="permalink">&para;</a></h2>


<p>Web site content can take many different forms, but may be broadly
divided into static and dynamic content.</p>

<p>Static content is things like HTML files, image files, CSS files,
and other files that reside in the filesystem. The <code class="directive"><a href="./mod/core.html#documentroot">DocumentRoot</a></code> directive specifies where in your
filesystem you should place these files. This directive is either set
globally, or per virtual host. Look in your configuration file(s) to
determine how this is set for your server.</p>

<p>Typically, a document called <code>index.html</code> will be served
when a directory is requested without a file name being specified. For
example, if <code>DocumentRoot</code> is set to
<code>/var/www/html</code> and a request is made for
<code>http://www.example.com/work/</code>, the file
<code>/var/www/html/work/index.html</code> will be served to the
client.</p>

<p>Dynamic content is anything that is generated at request
time, and may change from one request to another. There are numerous
ways that dynamic content may be generated. Various <a href="handler.html">handlers</a> are available to generate content. <a href="howto/cgi.html">CGI programs</a> may be written to generate
content for your site.</p>

<p>Third-party modules like mod_php may be used to write code that does a
variety of things. Many third-party applications, written using a
variety of languages and tools, are available for download and
installation on your Apache HTTP Server. Support of these third-party
things is beyond the scope of this documentation, and you should find
their documentation or other support forums to answer your questions
about them.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
<h2 id="logs">Log Files and Troubleshooting <a title="Permanent link" href="#logs" class="permalink">&para;</a></h2>

<p>As an Apache HTTP Server administrator, your most valuable assets are
the log files, and, in particular, the error log. Troubleshooting any
problem without the error log is like driving with your eyes closed.</p>

<p>The location of the error log is defined by the <code class="directive"><a href="./mod/core.html#errorlog">ErrorLog</a></code> directive, which may be set globally,
or per virtual host. Entries in the error log tell you what went wrong,
and when. They often also tell you how to fix it. Each error log message
contains an error code, which you can search for online for even more
detailed descriptions of how to address the problem. You can also
configure your error log to contain a log ID which you can then
correlate to an access log entry, so that you can determine what request
caused the error condition.</p>

<p>You can read more about logging in the <a href="logs.html">logs
documentation</a>.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif"></a></div>
<div class="section">
<h2 id="other">What's next? <a title="Permanent link" href="#other" class="permalink">&para;</a></h2>


<p>Once you have the prerequisites under your belt, it's time to move
on.</p>

<p>This document covers only the bare basics. We hope that this gets you
started, but there are many other things that you might need to
know.</p>

<ul>
<li><a href="http://httpd.apache.org/download.cgi">Download</a></li>
<li><a href="install.html">Install</a></li>
<li><a href="configuring.html">Configure</a></li>
<li><a href="invoking.html">Start</a></li>
<li><a href="https://cwiki.apache.org/confluence/display/httpd/FAQ">Frequently Asked Questions</a></li>
</ul>

</div></div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="./en/getting-started.html" title="English">&nbsp;en&nbsp;</a> |
<a href="./fr/getting-started.html" hreflang="fr" rel="alternate" title="Fran&ccedil;ais">&nbsp;fr&nbsp;</a> |
<a href="./ru/getting-started.html" hreflang="ru" rel="alternate" title="Russian">&nbsp;ru&nbsp;</a></p>
</div><div id="footer">
<p class="apache">Copyright 2026 The Apache Software Foundation.<br>Licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.html">Directives</a> | <a href="https://cwiki.apache.org/confluence/display/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a> | <a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2">Report a bug</a></p></div><script><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
    prettyPrint();
}
var langToggle = document.querySelector('.lang-toggle');
var topLang = document.querySelector('.toplang');
if (langToggle && topLang) {
    langToggle.addEventListener('click', function() { topLang.classList.toggle('open'); });
}
var qv = document.getElementById('quickview');
if (qv) {
    document.body.appendChild(qv);
    var qvBtn = document.createElement('button');
    qvBtn.className = 'qv-toggle';
    qvBtn.setAttribute('aria-label', 'Toggle page navigation');
    qvBtn.innerHTML = '&#9776;';
    document.body.appendChild(qvBtn);
    qvBtn.addEventListener('click', function() {
        var isOpen = qv.classList.toggle('open');
        if (isOpen) {
            qv.style.top = window.scrollY + 10 + 'px';
        }
    });
    window.addEventListener('scroll', function() { qv.classList.remove('open'); });
}
//--><!]]></script>
</body></html>