]> granicus.if.org Git - apache/blob - docs/manual/getting-started.html.en
Help doc writer to spot places where:
[apache] / docs / manual / getting-started.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
4 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
5 <!--
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7               This file is generated from xml source: DO NOT EDIT
8         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9       -->
10 <title>Getting Started - Apache HTTP Server Version 2.5</title>
11 <link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <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" />
14 <script src="./style/scripts/prettify.min.js" type="text/javascript">
15 </script>
16
17 <link href="./images/favicon.ico" rel="shortcut icon" /></head>
18 <body id="manual-page"><div id="page-header">
19 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p>
20 <p class="apache">Apache HTTP Server Version 2.5</p>
21 <img alt="" src="./images/feather.png" /></div>
22 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="./images/left.gif" /></a></div>
23 <div id="path">
24 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="./">Version 2.5</a></div><div id="page-content"><div id="preamble"><h1>Getting Started</h1>
25 <div class="toplang">
26 <p><span>Available Languages: </span><a href="./en/getting-started.html" title="English">&nbsp;en&nbsp;</a> |
27 <a href="./fr/getting-started.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
28 </div>
29
30 <p>If you're completely new to the Apache HTTP Server, or even to running
31 a website at all, you might not know where to start, or what questions to
32 ask. This document walks you through the basics.</p>
33 </div>
34 <div id="quickview"><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#clientserver">Clients, Servers, and URLs</a></li>
35 <li><img alt="" src="./images/down.gif" /> <a href="#dns">Hostnames and DNS</a></li>
36 <li><img alt="" src="./images/down.gif" /> <a href="#configuration">Configuration Files and Directives</a></li>
37 <li><img alt="" src="./images/down.gif" /> <a href="#content">Web Site Content</a></li>
38 <li><img alt="" src="./images/down.gif" /> <a href="#logs">Log Files and Troubleshooting</a></li>
39 <li><img alt="" src="./images/down.gif" /> <a href="#other">What's next?</a></li>
40 </ul><h3>See also</h3><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
41 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
42 <div class="section">
43 <h2><a name="clientserver" id="clientserver">Clients, Servers, and URLs</a> <a title="Permanent link" href="#clientserver" class="permalink">&para;</a></h2>
44
45
46 <p>
47 Addresses on the Web are expressed with URLs - Uniform Resource Locators
48 - which specify a protocol (e.g. <code>http</code>), a servername (e.g.
49 <code>www.apache.org</code>), a URL-path (e.g.
50 <code>/docs/current/getting-started.html</code>), and possibly a query
51 string (e.g. <code>?arg=value</code>) used to pass additional
52 arguments to the server.
53 </p>
54
55 <p>A client (e.g., a web browser) connects to a server (e.g., your Apache HTTP Server),
56 with the specified protocol, and makes a <strong>request</strong> for a resource using the
57 URL-path.</p>
58
59 <p>The URL-path may represent any number of things on the server. It may
60 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
61 file (like <code>index.php</code>). We'll discuss this more below in
62 the <a href="#content">Web Site Content</a> section.</p>
63
64 <p>
65 The server will send a <strong>response</strong> consisting of a status
66 code and, optionally, a response body.
67 The status code indicates whether the request was successful, and, if not, what
68 kind of error condition there was. This tells the client what it should
69 do with the response. You can read about the possible response codes in
70 <a href="http://wiki.apache.org/httpd/CommonHTTPStatusCodes">HTTP Server
71 wiki</a>.</p>
72
73 <p>Details of the transaction, and any error conditions, are written to
74 log files. This is discussed in greater detail below in the <a href="#logs">Logs Files and Troubleshooting</a> section.</p>
75
76 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
77 <div class="section">
78 <h2><a name="dns" id="dns">Hostnames and DNS</a> <a title="Permanent link" href="#dns" class="permalink">&para;</a></h2>
79
80
81 <p>In order to connect to a server, the client will first have to resolve
82 the servername to an IP address - the location on the Internet where the
83 server resides. Thus, in order for your web server to be reachable, it
84 is necessary that the servername be in DNS.</p>
85
86 <p>If you don't know how to do this, you'll need to contact your network
87 administrator, or Internet service provider, to perform this step for
88 you.</p>
89
90 <p>More than one hostname may point to the same IP address, and more
91 than one IP address can be attached to the same physical server. Thus, you
92 can run more than one web site on the same physical server, using a
93 feature called <a href="vhosts/">virtual hosts</a>.</p>
94
95 <p>If you are testing a server that is not Internet-accessible, you
96 can put host names in your hosts file in order to do local resolution.
97 For example, you might want to put a record in your hosts file to map a
98 request for <code>www.example.com</code> to your local system, for
99 testing purposes. This entry would look like:</p>
100
101 <div class="example"><p><code>
102 127.0.0.1 www.example.com
103 </code></p></div>
104
105 <p>A hosts file will probably be located at <code>/etc/hosts</code> or
106 <code>C:\Windows\system32\drivers\etc\hosts</code>.</p>
107
108 <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
109 more about DNS at <a href="http://en.wikipedia.org/wiki/Domain_Name_System">Wikipedia.org/wiki/Domain_Name_System</a>.</p>
110 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
111 <div class="section">
112 <h2><a name="configuration" id="configuration">Configuration Files and Directives</a> <a title="Permanent link" href="#configuration" class="permalink">&para;</a></h2>
113
114
115 <p>The Apache HTTP Server is configured via simple text files.
116 These files may be located any of a variety of places, depending on how
117 exactly you installed the server. Common locations for these files may
118 be found <a href="http://wiki.apache.org/httpd/DistrosDefaultLayout">in
119 the httpd wiki</a>. If you installed httpd from source, the default
120 location of the configuration files is
121 <code>/usr/local/apache2/conf</code>. The default configuration file is
122 usually called <code>httpd.conf</code>. This, too, can vary in
123 third-party distributions of the server.</p>
124
125 <p>The configuration is frequently broken into multiple smaller files,
126 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
127 these sub-files are not magical, and may vary greatly from one
128 installation to another. Arrange and subdivide these files as
129 makes the most sense to <strong>you</strong>. If the file arrangement
130 you have by default doesn't make sense to you, feel free to rearrange it.</p>
131
132 <p>The server is configured by placing <a href="mod/quickreference.html">configuration directives</a> in these
133 configuration files. A directive is a keyword followed by one or more
134 arguments that set its value.</p>
135
136 <p>The question of "<em>Where should I put that
137 directive?</em>" is generally answered by considering where you want a
138 directive to be effective. If it is a global setting, it should appear
139 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
140 apply only to a particular directory, then it should go inside a
141 <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> section referring to
142 that directory, and so on. See the <a href="sections.html">Configuration
143 Sections</a> document for further discussion of these sections.</p>
144
145 <p>In addition to the main configuration files, certain directives may go in
146 <code>.htaccess</code> files located in the content directories.
147 <code>.htaccess</code> files are primarily for people who do not have
148 access to the main server configuration file(s). You can read more about
149 <code>.htaccess</code> files in the <a href="howto/htaccess.html"><code>.htaccess</code> howto</a>.</p>
150
151 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
152 <div class="section">
153 <h2><a name="content" id="content">Web Site Content</a> <a title="Permanent link" href="#content" class="permalink">&para;</a></h2>
154
155
156 <p>Web site content can take many different forms, but may be broadly
157 divided into static and dynamic content.</p>
158
159 <p>Static content is things like HTML files, image files, CSS files,
160 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
161 filesystem you should place these files. This directive is either set
162 globally, or per virtual host. Look in your configuration file(s) to
163 determine how this is set for your server.</p>
164
165 <p>Typically, a document called <code>index.html</code> will be served
166 when a directory is requested without a file name being specified. For
167 example, if <code>DocumentRoot</code> is set to
168 <code>/var/www/html</code> and a request is made for
169 <code>http://www.example.com/work/</code>, the file
170 <code>/var/www/html/work/index.html</code> will be served to the
171 client.</p>
172
173 <p>Dynamic content is anything that is generated at request
174 time, and may change from one request to another. There are numerous
175 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
176 content for your site.</p>
177
178 <p>Third-party modules like mod_php may be used to write code that does a
179 variety of things. Many third-party applications, written using a
180 variety of languages and tools, are available for download and
181 installation on your Apache HTTP Server. Support of these third-party
182 things is beyond the scope of this documentation, and you should find
183 their documentation or other support forums to answer your questions
184 about them.</p>
185 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
186 <div class="section">
187 <h2><a name="logs" id="logs">Log Files and Troubleshooting</a> <a title="Permanent link" href="#logs" class="permalink">&para;</a></h2>
188
189 <p>As an Apache HTTP Server administrator, your most valuable assets are
190 the log files, and, in particular, the error log. Troubleshooting any
191 problem without the error log is like driving with your eyes closed.</p>
192
193 <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,
194 or per virtual host. Entries in the error log tell you what went wrong,
195 and when. They often also tell you how to fix it. Each error log message
196 contains an error code, which you can search for online for even more
197 detailed descriptions of how to address the problem. You can also
198 configure your error log to contain a log ID which you can then
199 correlate to an access log entry, so that you can determine what request
200 caused the error condition.</p>
201
202 <p>You can read more about logging in the <a href="logs.html">logs
203 documentation</a>.</p>
204 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
205 <div class="section">
206 <h2><a name="other" id="other">What's next?</a> <a title="Permanent link" href="#other" class="permalink">&para;</a></h2>
207
208
209 <p>Once you have the prerequisites under your belt, it's time to move
210 on.</p>
211
212 <p>This document covers only the bare basics. We hope that this gets you
213 started, but there are many other things that you might need to
214 know.</p>
215
216 <ul>
217 <li><a href="http://httpd.apache.org/download.cgi">Download</a></li>
218 <li><a href="install.html">Install</a></li>
219 <li><a href="configuring.html">Configure</a></li>
220 <li><a href="invoking.html">Start</a></li>
221 <li><a href="http://wiki.apache.org/httpd/FAQ">Frequently Asked Questions</a></li>
222 </ul>
223
224 </div></div>
225 <div class="bottomlang">
226 <p><span>Available Languages: </span><a href="./en/getting-started.html" title="English">&nbsp;en&nbsp;</a> |
227 <a href="./fr/getting-started.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
228 </div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
229 <script type="text/javascript"><!--//--><![CDATA[//><!--
230 var comments_shortname = 'httpd';
231 var comments_identifier = 'http://httpd.apache.org/docs/trunk/getting-started.html';
232 (function(w, d) {
233     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
234         d.write('<div id="comments_thread"><\/div>');
235         var s = d.createElement('script');
236         s.type = 'text/javascript';
237         s.async = true;
238         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
239         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
240     }
241     else {
242         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
243     }
244 })(window, document);
245 //--><!]]></script></div><div id="footer">
246 <p class="apache">Copyright 2019 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
247 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
248 if (typeof(prettyPrint) !== 'undefined') {
249     prettyPrint();
250 }
251 //--><!]]></script>
252 </body></html>