36.
httpd Apache Web Server 36.2. Installing and Conguring Apache
36.2 Installing and Conguring Apache
Because all distributions package Apache in a different way, here I assume Apache
to have been installed from its source tree, rather than from a.debor.rpm
package. You can refer to Section 24.1 on how to install Apache from its source
.tar.gzle like any other GNU package. (You can even install it under Win-
dows, Windows NT, or OS/2.) The source tree is, of course, available fromThe
Apache Home Pagehttp://www.apache.org. Here I assume you have installed it in--
prefix=/opt/apache/. In the process, Apache will have dumped a huge reference
manual into/opt/apache/htdocs/manual/ .
36.2.1 Samplehttpd.conf
Apache has several legacy conguration les:access.confandsrm.confare two
of them. These les are now deprecated and should be left empty. A single congura-
tion le/opt/apache/conf/httpd.conf may contain at minimum:
¨ ¥
ServerType standalone
ServerRoot "/opt/apache"
PidFile /opt/apache/logs/httpd.pid
ScoreBoardFile /opt/apache/logs/httpd.scoreboard
5Port 80
User nobody
Group nobody
HostnameLookups Off
ServerAdmin
[email protected]
10UseCanonicalName On
ServerSignature On
DefaultType text/plain
ErrorLog /opt/apache/logs/error_log
LogLevel warn
15LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog /opt/apache/logs/access_log common
DocumentRoot "/opt/apache/htdocs"
DirectoryIndex index.html
AccessFileName .htaccess
20<Directory />
Options FollowSymLinks
AllowOverride None
Order Deny,Allow
Deny from All
25</Directory>
<Files "\.ht">
Order allow,deny
Deny from all
</Files>
30<Directory "/opt/apache/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
393