getting-started.xml revision 4c14866954f240e6e2c17c164900c4aa7900bbee
181e56d8b348d301d615ccf5465ae600fee2867berikabele<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
181e56d8b348d301d615ccf5465ae600fee2867berikabele<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki<!-- $LastChangedRevision$ -->
5a58787efeb02a1c3f06569d019ad81fd2efa06end Licensed to the Apache Software Foundation (ASF) under one or more
5a58787efeb02a1c3f06569d019ad81fd2efa06end contributor license agreements. See the NOTICE file distributed with
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim this work for additional information regarding copyright ownership.
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim The ASF licenses this file to You under the Apache License, Version 2.0
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim (the "License"); you may not use this file except in compliance with
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim the License. You may obtain a copy of the License at
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim Unless required by applicable law or agreed to in writing, software
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim distributed under the License is distributed on an "AS IS" BASIS,
5a58787efeb02a1c3f06569d019ad81fd2efa06end WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim See the License for the specific language governing permissions and
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd limitations under the License.
b442af56a5e2104663b84fb345c070ce185d4ab3slive<p>If you're completely new to the Apache HTTP Server, or even to running
5a58787efeb02a1c3f06569d019ad81fd2efa06enda website at all, you might not know where to start, or what questions to
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimask. This document walks you through the basics.</p>
b442af56a5e2104663b84fb345c070ce185d4ab3sliveAddresses on the Web are expressed with URLs - Uniform Resource Locators
aaf7b7f4cc1be050310c3d7f48bce0ec67e174e4nd- which specify a protocol (e.g. <code>http</code>), a servername (e.g.
aaf7b7f4cc1be050310c3d7f48bce0ec67e174e4nd<code>/docs/current/getting-started.html</code>), and possibly a query
aaf7b7f4cc1be050310c3d7f48bce0ec67e174e4ndstring (e.g. <code>?arg=value</code>) used to pass additional
b442af56a5e2104663b84fb345c070ce185d4ab3slivearguments to the server.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<p>A client (e.g., a web browser) connects to a server (e.g., your Apache HTTP Server),
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemwith the specified protocol, and makes a <strong>request</strong> for a resource using the
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemURL-path.</p>
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen<p>The URL-path may represent any number of things on the server. It may
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimbe a file (like <code>getting-started.html</code>) a handler (like <a
b1ced323143ade589985456a78f3f64d6a6580c5yoshikihref="mod/mod_status.html">server-status</a>) or some kind of program
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemfile (like <code>index.php</code>). We'll discuss this more below in
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenthe <a href="#content">Web Site Content</a> section.</p>
cd694e2baec0c53e1b764ffe52ef88dcb68cfd53jerenkrantzThe server will send a <strong>response</strong> consisting of a status
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowencode and, optionally, a response body.
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimThe status code indicates whether the request was successful, and, if not, what
b442af56a5e2104663b84fb345c070ce185d4ab3slivekind of error condition there was. This tells the client what it should
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowendo with the response. You can read about the possible response codes in
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen<a href="http://wiki.apache.org/httpd/CommonHTTPStatusCodes">HTTP Server
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<p>Details of the transaction, and any error conditions, are written to
b442af56a5e2104663b84fb345c070ce185d4ab3slivelog files. This is discussed in greater detail below in the <a
181e56d8b348d301d615ccf5465ae600fee2867berikabelehref="#logs">Logs Files and Troubleshooting</a> section.</p>
b442af56a5e2104663b84fb345c070ce185d4ab3slive<p>In order to connect to a server, the client will first have to resolve
181e56d8b348d301d615ccf5465ae600fee2867berikabelethe servername to an IP address - the location on the Internet where the
d1bfc6be06494f56e80960d8cdc40c4e3f1fc3abnoirinserver resides. Thus, in order for your web server to be reachable, it
d1bfc6be06494f56e80960d8cdc40c4e3f1fc3abnoirinis necessary that the servername be in DNS.</p>
b442af56a5e2104663b84fb345c070ce185d4ab3slive<p>More than one hostname may point to the same IP address, and more
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemthan one IP address can be attached to the same physical server. Thus, you
b442af56a5e2104663b84fb345c070ce185d4ab3slivecan run more than one web site on the same physical server, using a
b442af56a5e2104663b84fb345c070ce185d4ab3slivefeature called <a href="vhosts/">virtual hosts</a>.</p>
5383fa753e1bcd3a04ec34ba9810d671302380f2colm<p>If you don't know how to do this, you'll need to contact your network
181e56d8b348d301d615ccf5465ae600fee2867berikabeleadministrator, or Internet service provider, to perform this step for
5a58787efeb02a1c3f06569d019ad81fd2efa06end<p>If you are testing a server that is not Internet-accessible, you
b442af56a5e2104663b84fb345c070ce185d4ab3slivecan put host names in your hosts file in order to do local resolution.
b442af56a5e2104663b84fb345c070ce185d4ab3sliveFor example, you might want to put a record in your hosts file to map a
20189240503ef2c8f5dc6e2248b57faab4b23b5andrequest for <code>www.example.com</code> to your local system, for
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimtesting purposes. This entry would look like:</p>
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick<p>A hosts file will probably be located at <code>/etc/hosts</code> or
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick<code>C:\Windows\system32\drivers\etc\hosts</code>.</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemhref="http://en.wikipedia.org/wiki/Hosts_(file)">Wikipedia.org/wiki/Hosts_(file)</a>, and
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimmore about DNS at <a
9bcfc3697a91b5215893a7d0206865b13fc72148ndhref="http://en.wikipedia.org/wiki/Domain_Name_System">Wikipedia.org/wiki/Domain_Name_System</a>.</p>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<p>The Apache HTTP Server is configured via simple text files.
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolleyThese files may be located any of a variety of places, depending on how
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemexactly you installed the server. Common locations for these files may
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawickbe found <a href="http://wiki.apache.org/httpd/DistrosDefaultLayout">in
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawickthe httpd wiki</a>. If you installed httpd from source, the default
b442af56a5e2104663b84fb345c070ce185d4ab3slivelocation of the configuration files is
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick<code>/usr/local/apache2/conf</code>. The default configuration file is
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawickusually called <code>httpd.conf</code>. This, too, can vary in
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimthird-party distributions of the server.</p>
b442af56a5e2104663b84fb345c070ce185d4ab3slive<p>The configuration is frequently broken into multiple smaller files,
181e56d8b348d301d615ccf5465ae600fee2867berikabelefor ease of management. These files are loaded via the <directive
b4600e71d7e8201b3c14c67f4ef873cadd4c1d17trawickmodule="core">Include</directive> directive. The names or locations of
d1bfc6be06494f56e80960d8cdc40c4e3f1fc3abnoirinthese sub-files are not magical, and may vary greatly from one
181e56d8b348d301d615ccf5465ae600fee2867berikabeleinstallation to another. Arrange and subdivide these files as
b442af56a5e2104663b84fb345c070ce185d4ab3slivemakes the most sense to <strong>you</strong>. If the file arrangement
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolleyyou have by default doesn't make sense to you, feel free to rearrange it.</p>
9bcfc3697a91b5215893a7d0206865b13fc72148ndhref="mod/quickreference.html">configuration directives</a> in these
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimconfiguration files. A directive is a keyword followed by one or more
5a58787efeb02a1c3f06569d019ad81fd2efa06endarguments that set its value.</p>
455a5f75c9935108a7ac1d50996f404e0553ac17pauldirective?</em>" is generally answered by considering where you want a
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimdirective to be effective. If it is a global setting, it should appear
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemin the configuration file, outside of any <directive
b1ced323143ade589985456a78f3f64d6a6580c5yoshikitype="section">VirtualHost</directive>, or other section. If it is to
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemapply only to a particular directory, then it should go inside a
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<directive type="section">Directory</directive> section referring to
b1ced323143ade589985456a78f3f64d6a6580c5yoshikithat directory, and so on. See the <a href="sections.html">Configuration
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemSections</a> document for further discussion of these sections.</p>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki<p>In addition to the main configuration files, certain directives may go in
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<code>.htaccess</code> files located in the content directories.
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<code>.htaccess</code> files are primarily for people who do not have
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenaccess to the main server configuration file(s). You can read more about
b1ced323143ade589985456a78f3f64d6a6580c5yoshikihref="howto/htaccess.html"><code>.htaccess</code> howto</a>.</p>
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<p>Web site content can take many different forms, but may be broadly
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nddivided into static and dynamic content.</p>
50337bc37d6a337217f0295bc57aaac558517c11jim<p>Static content is things like HTML files, image files, CSS files,
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimand other files that reside in the filesystem. The <directive
5a58787efeb02a1c3f06569d019ad81fd2efa06endmodule="core">DocumentRoot</directive> directive specifies where in your