getting-started.xml revision 4c14866954f240e6e2c17c164900c4aa7900bbee
181e56d8b348d301d615ccf5465ae600fee2867berikabele<?xml version='1.0' encoding='UTF-8' ?>
181e56d8b348d301d615ccf5465ae600fee2867berikabele<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
181e56d8b348d301d615ccf5465ae600fee2867berikabele<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki<!-- $LastChangedRevision$ -->
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki<!--
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
5a58787efeb02a1c3f06569d019ad81fd2efa06end
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim http://www.apache.org/licenses/LICENSE-2.0
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz
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.
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim-->
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<manualpage metafile="getting-started.xml.meta">
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd <title>Getting Started</title>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<summary>
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>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim</summary>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim
5a58787efeb02a1c3f06569d019ad81fd2efa06end<section id="clientserver">
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<title>Clients, Servers, and URLs</title>
5a58787efeb02a1c3f06569d019ad81fd2efa06end
5a58787efeb02a1c3f06569d019ad81fd2efa06end<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.
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<code>www.apache.org</code>), a URL-path (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.
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen</p>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
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>
cd694e2baec0c53e1b764ffe52ef88dcb68cfd53jerenkrantz
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>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki<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
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowenwiki</a>.</p>
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen
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>
181e56d8b348d301d615ccf5465ae600fee2867berikabele
b442af56a5e2104663b84fb345c070ce185d4ab3slive</section>
181e56d8b348d301d615ccf5465ae600fee2867berikabele
b442af56a5e2104663b84fb345c070ce185d4ab3slive<section id="dns">
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<title>Hostnames and DNS</title>
38d7b435c9e47c1549c7ec5e899c9461548a228derikabele
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>
181e56d8b348d301d615ccf5465ae600fee2867berikabele
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>
181e56d8b348d301d615ccf5465ae600fee2867berikabele
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
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimyou.</p>
5a58787efeb02a1c3f06569d019ad81fd2efa06end
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>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<example>
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick127.0.0.1 www.example.com
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick</example>
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick
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>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem<p>You can read more about the hosts file at <a
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>
4566c682d671cfda9cfcb77ea3f8e3fb8a265010trawick</section>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolley<section id="configuration">
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolley<title>Configuration Files and Directives</title>
ef26e16090b1b00e96bb5eb1bee6f9cee4651466jwoolley
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>
35618dd145853155d4c7b1d0d6391707315f957ekess
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>
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluem
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<p>The server is configured by placing <a
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>
5a58787efeb02a1c3f06569d019ad81fd2efa06end
b442af56a5e2104663b84fb345c070ce185d4ab3slive<p>The question of "<em>Where should I put that
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
bf380c59be3f235bde21f1c00098e09e3cf7e7aerpluemtype="section">Directory</directive>, <directive
7add1372edb1ee95a2c4d1314df4c7567bda7c62jimtype="section">Location</directive>, <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>
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen
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
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<code>.htaccess</code> files in the <a
b1ced323143ade589985456a78f3f64d6a6580c5yoshikihref="howto/htaccess.html"><code>.htaccess</code> howto</a>.</p>
57d0156f7bbd9ea3a72342cf9912aba61d118702rbowen
5a58787efeb02a1c3f06569d019ad81fd2efa06end</section>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<section id="content">
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim<title>Web Site Content</title>
7add1372edb1ee95a2c4d1314df4c7567bda7c62jim
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<p>Web site content can take many different forms, but may be broadly
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nddivided into static and dynamic content.</p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd
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
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>
</section>
<section id="logs">
<title>Log Files and Troubleshooting</title>
<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 <directive
module="core">ErrorLog</directive> 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 a 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>
</section>
<section id="other">
<title>What Else Do I Need To Know?</title>
<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.
Here's a partial list of what you might be looking for:</p>
<ul>
<li><a href="howto/auth.html">Authentication and Authorization (password protecting resources)</a></li>
<li><a href="howto/access.html">Access Control</a></li>
<li><a href="ssl/ssl_howto.html">Setting up SSL</a></li>
<li><a href="http://wiki.apache.org/httpd/FAQ">Frequently Asked Questions</a></li>
</ul>
</section>
</manualpage>