getting-started.xml revision f9569bee58de8f7a4f4ceb5bcacdaa07e1950603
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive<!-- $LastChangedRevision$ -->
b686b6a420bde7f78c416b90be11db94cb789979nd Licensed to the Apache Software Foundation (ASF) under one or more
b686b6a420bde7f78c416b90be11db94cb789979nd contributor license agreements. See the NOTICE file distributed with
b686b6a420bde7f78c416b90be11db94cb789979nd this work for additional information regarding copyright ownership.
b686b6a420bde7f78c416b90be11db94cb789979nd The ASF licenses this file to You under the Apache License, Version 2.0
b686b6a420bde7f78c416b90be11db94cb789979nd (the "License"); you may not use this file except in compliance with
b686b6a420bde7f78c416b90be11db94cb789979nd the License. You may obtain a copy of the License at
b686b6a420bde7f78c416b90be11db94cb789979nd Unless required by applicable law or agreed to in writing, software
b686b6a420bde7f78c416b90be11db94cb789979nd distributed under the License is distributed on an "AS IS" BASIS,
b686b6a420bde7f78c416b90be11db94cb789979nd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4b5981e276e93df97c34e4da05ca5cf8bbd937dand See the License for the specific language governing permissions and
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd limitations under the License.
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen<p>If you're completely new to the Apache HTTP Server, or even to running
3b3b7fc78d1f5bfc2769903375050048ff41ff26nda website at all, you might not know where to start, or what questions to
b686b6a420bde7f78c416b90be11db94cb789979ndask. This document walks you through the basics.</p>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndAddresses on the Web are expressed with URLs - Uniform Resource Locators
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd- which specify a protocol (e.g. <code>http</code>), a servername (e.g.
5b10fd3977e6dfff19afe770e612e276962f7950nd<code>/docs/current/getting-started.html</code>), and possibly a query
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2ndstring (e.g. <code>?arg=value</code>) used to pass additional
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2ndarguments to the server.
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd<p>A client (e.g., a web browser) connects to a server (e.g., your Apache HTTP Server),
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2ndwith the specified protocol, and makes a <strong>request</strong> for a resource using the
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndURL-path.</p>
5b10fd3977e6dfff19afe770e612e276962f7950nd<p>The URL-path may represent any number of things on the server. It may
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndbe a file (like <code>getting-started.html</code>) a handler (like <a
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndhref="mod/mod_status.html">server-status</a>) or some kind of program
2aff288113d772cedca6add888eb643afffe9fb1ndfile (like <code>index.php</code>). We'll discuss this more below in
166c7891cc2a7545eca0f4dda6af92026bc43fcfrpluemThe server will send a <strong>response</strong> consisting of a status
2aff288113d772cedca6add888eb643afffe9fb1ndcode and, optionally, a response body.
2aff288113d772cedca6add888eb643afffe9fb1ndThe status code indicates whether the request was successful, and, if not, what
316f02e3836836c82e19019ff23f90a7ebc65289nilgunkind of error condition there was. This tells the client what it should
2aff288113d772cedca6add888eb643afffe9fb1nddo with the response. You can read about the possible response codes in
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd<a href="http://wiki.apache.org/httpd/CommonHTTPStatusCodes">HTTP Server
2aff288113d772cedca6add888eb643afffe9fb1nd<p>Details of the transaction, and any error conditions, are written to
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndlog files. This is discussed in greater detail below in the <a
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndhref="#logs">Logs Files and Troubleshooting</a> section.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p>In order to connect to a server, the client will first have to resolve
2aff288113d772cedca6add888eb643afffe9fb1ndthe servername to an IP address - the location on the Internet where the
50c04f297d76a57ead2fa6b73845f7563b1fc788sfserver resides. Thus, in order for your web server to be reachable, it
2aff288113d772cedca6add888eb643afffe9fb1ndis necessary that the servername be in DNS.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p>More than one hostname may point to the same IP address, and more
2aff288113d772cedca6add888eb643afffe9fb1ndthan one IP address can be attached to the same physical server. Thus, you
635e08c1d8332adc365b1c20bbe3577d59ebcd78kesscan run more than one web site on the same physical server, using a
d9b843d090f14405079b4a61a493316cd3f1e5b9minfrinfeature called <a href="vhosts/">virtual hosts</a>.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p>If you don't know how to do this, you'll need to contact your network
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirinadministrator, or Internet service provider, to perform this step for
2aff288113d772cedca6add888eb643afffe9fb1nd<p>If you are testing a server that is not Internet-accessible, you
a29610af88e278144045bfa1bc63b4a1a4b5ff14trawickcan put host names in your hosts file in order to do local resolution.
a29610af88e278144045bfa1bc63b4a1a4b5ff14trawickFor example, you might want to put a record in your hosts file to map a
42af92a661a06b3cebc88d585aad75064a309d51ndrequest for <code>www.example.com</code> to your local system, for
42af92a661a06b3cebc88d585aad75064a309d51ndtesting purposes. This entry would look like:</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p>A hosts file will probably be located at <code>/etc/hosts</code> or
2aff288113d772cedca6add888eb643afffe9fb1ndhref="http://en.wikipedia.org/wiki/Hosts_(file)">Wikipedia.org/wiki/Hosts_(file)</a>, and
2aff288113d772cedca6add888eb643afffe9fb1ndmore about DNS at <a
43f6cc6aa3312619633538b8978619a48c0ce52eminfrinhref="http://en.wikipedia.org/wiki/Domain_Name_System">Wikipedia.org/wiki/Domain_Name_System</a>.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p>The Apache HTTP Server is configured via simple text files.
2aff288113d772cedca6add888eb643afffe9fb1ndThese files may be located any of a variety of places, depending on how
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndexactly you installed the server. Common locations for these files may
2aff288113d772cedca6add888eb643afffe9fb1ndbe found <a href="http://wiki.apache.org/httpd/DistrosDefaultLayout">in
e67fa8d3f161e595dd448fc24a591ee17ae59131ndthe httpd wiki</a>. If you installed httpd from source, the default
05ede5110427cb9dc071cc671d5aaba5d3b88c79ndlocation of the configuration files is
e8b603fa9ccf7b17b11b42df6d8916fd97c2331dnd<code>/usr/local/apache2/conf</code>. The default configuration file is
bf94bedcb62d7f0b926f4286069def5ee6b07b60ndusually called <code>httpd.conf</code>. This, too, can vary in
bf94bedcb62d7f0b926f4286069def5ee6b07b60ndthird-party distributions of the server.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p>The configuration is frequently broken into multiple smaller files,
2aff288113d772cedca6add888eb643afffe9fb1ndfor ease of management. These files are loaded via the <directive
ee5db395bc3723609919edfa96af387eea37c491jimmodule="core">Include</directive> directive. The names or locations of
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndthese sub-files are not magical, and may vary greatly from one
2aff288113d772cedca6add888eb643afffe9fb1ndinstallation to another. Arrange and subdivide these files as
e55e60efce8a3e2139132c1d6ad9f6f0d2976614ndmakes the most sense to <strong>you</strong>. If the file arrangement
e55e60efce8a3e2139132c1d6ad9f6f0d2976614ndyou have by default doesn't make sense to you, feel free to rearrange it.</p>
7f3fdc63be07f2ad39e01a44e68e9324998a5c03slivehref="mod/quickreference.html">configuration directives</a> in these
7f3fdc63be07f2ad39e01a44e68e9324998a5c03sliveconfiguration files. A directive is a keyword followed by one or more
75585bd48fe0f30483dba4762e61edf39ea3e0f6ndarguments that set its value.</p>
03a4ff9ac4c9b8009249010e7c53bb86ff05915anddirective?</em>" is generally answered by considering where you want a
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nddirective to be effective. If it is a global setting, it should appear
3b58542e01ec69422f3086db5825a12fc77b726endin the configuration file, outside of any <directive
1e367a83311e5243e04d68857d007d04765a48f9chrisdtype="section" module="core">Directory</directive>, <directive
1e367a83311e5243e04d68857d007d04765a48f9chrisdtype="section" module="core">Location</directive>, <directive
a0d937b340692a3578f1d2f2535890c520c4bf0cndtype="section" module="core">VirtualHost</directive>, or other section. If it is to
7d15331eeb5429d7148d13d6fd914a641bf1c000pquernaapply only to a particular directory, then it should go inside a
2aff288113d772cedca6add888eb643afffe9fb1nd<directive type="section" module="core">Directory</directive> section referring to
2aff288113d772cedca6add888eb643afffe9fb1ndthat directory, and so on. See the <a href="sections.html">Configuration
2aff288113d772cedca6add888eb643afffe9fb1ndSections</a> document for further discussion of these sections.</p>
2704de98885368683621b01c8f8f4e4b01557611takashi<p>In addition to the main configuration files, certain directives may go in
2704de98885368683621b01c8f8f4e4b01557611takashi<code>.htaccess</code> files located in the content directories.
2704de98885368683621b01c8f8f4e4b01557611takashi<code>.htaccess</code> files are primarily for people who do not have
1e367a83311e5243e04d68857d007d04765a48f9chrisdaccess to the main server configuration file(s). You can read more about
08842292d2f1550b40ae73e0dafc7641c5955c82ndhref="howto/htaccess.html"><code>.htaccess</code> howto</a>.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p>Web site content can take many different forms, but may be broadly
2aff288113d772cedca6add888eb643afffe9fb1nddivided into static and dynamic content.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p>Static content is things like HTML files, image files, CSS files,
2aff288113d772cedca6add888eb643afffe9fb1ndand other files that reside in the filesystem. The <directive
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndmodule="core">DocumentRoot</directive> directive specifies where in your
c023f60e35022146373e40249f0c8c8d623b6fcfndfilesystem you should place these files. This directive is either set
1de1266f0ea387d6373be8415745dfd2ab876341jimglobally, or per virtual host. Look in your configuration file(s) to
27d778df0b517e1578f907d2e51eb961cd8ee5fbjimdetermine how this is set for your server.</p>
a43bfa789f4e52dde53ae8e53fa0427b5c1cf977nd<p>Typically, a document called <code>index.html</code> will be served
a43bfa789f4e52dde53ae8e53fa0427b5c1cf977ndwhen a directory is requested without a file name being specified. For
438b4817913a5ff55d9cad4c7ddf133330b4466ejim<code>/var/www/html/work/index.html</code> will be served to the
438b4817913a5ff55d9cad4c7ddf133330b4466ejimclient.</p>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<p>Dynamic content is anything that is generated at request
604c89126c27104f659d7a51b0113e3bd435faf8fieldingtime, and may change from one request to another. There are numerous
a329941afa602684be21fa85a54f2639e91763f8pquernaways that dynamic content may be generated. Various <a
73ba54c33b4fcad0e13005e10ea8648c9fe4265bndhref="handler.html">handlers</a> are available to generate content. <a
73ba54c33b4fcad0e13005e10ea8648c9fe4265bndhref="howto/cgi.html">CGI programs</a> may be written to generate
73ba54c33b4fcad0e13005e10ea8648c9fe4265bndcontent for your site.</p>
0a69d9bb491d9810892a9949c01403a1de3c7ac2nd<p>Third-party modules like mod_php may be used to write code that does a
ebdfe3e677aaa92fe2df702295eac81a97a4610frbowenvariety of things. Many third-party applications, written using a
ebdfe3e677aaa92fe2df702295eac81a97a4610frbowenvariety of languages and tools, are available for download and
4a3b6b890a52931991a7ed042d5973ef2039c623minfrininstallation on your Apache HTTP Server. Support of these third-party
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowethings is beyond the scope of this documentation, and you should find
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowetheir documentation or other support forums to answer your questions
5f4e50966b2b9b58436a1651cbe588d1b595657ewroweabout them.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p>As an Apache HTTP Server administrator, your most valuable assets are
50cb7e2b30597f481fee57bac945190f06ebcc58jortonthe log files, and, in particular, the error log. Troubleshooting any
79b024b81f6bb3c44dce77a7552191daf8b522d2jimproblem without the error log is like driving with your eyes closed.</p>
4277c95b5a9454a5c25f8d8762634fcff37aa840minfrin<p>The location of the error log is defined by the <directive
f195a136dcd90148b116fdae8ce95b41ba92b87eminfrinmodule="core">ErrorLog</directive> directive, which may be set globally,
4277c95b5a9454a5c25f8d8762634fcff37aa840minfrinor per virtual host. Entries in the error log tell you what went wrong,
2aff288113d772cedca6add888eb643afffe9fb1ndand when. They often also tell you how to fix it. Each error log message
1de1266f0ea387d6373be8415745dfd2ab876341jimcontains a error code, which you can search for online for even more
1de1266f0ea387d6373be8415745dfd2ab876341jimdetailed descriptions of how to address the problem. You can also
2aff288113d772cedca6add888eb643afffe9fb1ndconfigure your error log to contain a log ID which you can then
2aff288113d772cedca6add888eb643afffe9fb1ndcorrelate to an access log entry, so that you can determine what request
89fd815688f9a51a91d5fffa88663215c5c4d411rbowencaused the error condition.</p>
89fd815688f9a51a91d5fffa88663215c5c4d411rbowen<p>You can read more about logging in the <a href="logs.html">logs
2aff288113d772cedca6add888eb643afffe9fb1nd<p>This document covers only the bare basics. We hope that this gets you
2aff288113d772cedca6add888eb643afffe9fb1ndstarted, but there are many other things that you might need to know.
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42ndHere's a partial list of what you might be looking for:</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<li><a href="howto/auth.html">Authentication and Authorization (password protecting resources)</a></li>
2aff288113d772cedca6add888eb643afffe9fb1nd<li><a href="http://wiki.apache.org/httpd/FAQ">Frequently Asked Questions</a></li>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</manualpage>