From f16e4ec5b5b5c95954d020b488cfb0c85348c3a0 Mon Sep 17 00:00:00 2001 From: Murray Stokely Date: Wed, 21 Jul 2004 07:39:45 +0000 Subject: [PATCH] Add a section about the Apache HTTP Server : Installing, basic required httpd.conf configuration directives, additional available Apache modules, mod_ssl, PHP, etc.. Sponsored by: FreeBSD Mall, Inc. --- .../handbook/network-servers/chapter.sgml | 238 ++++++++++++++++++ 1 file changed, 238 insertions(+) diff --git a/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml b/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml index bd79525dc5..7f4a0624ca 100644 --- a/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml +++ b/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml @@ -3875,6 +3875,244 @@ zone "10.168.192.in-addr.arpa" in { + + + + + Murray + Stokely + Contributed by + + + + Apache HTTP Server + + web server + setting up + Apache + + + Overview + + &os; is used to run some of the busiest web sites in the + world. The majority of web servers on the Internet are using + the the Apache HTTP Server. + Apache software packages should be + included on your FreeBSD installation media. If you did not + install Apache when you first + installed FreeBSD, then you can install it from the www/apache13 or www/apache2 port. + + Once Apache has been installed + successfully, it must be configured. + + This section covers version 1.3.X of the + Apache HTTP Server as that is the + most widely used version for &os;. Apache 2.X introduces many + new technologies but they are not discussed here. For more + information about Apache 2.X, please see . + + + + + Configuration + + Apache + configuration file + + The main Apache HTTP Server configuration file is + installed as + /usr/local/etc/apache/httpd.conf on &os;. + This file is a typical Unix text configuration file with + comment lines beginning with the # + character. A comprehensive description of all possible + configuration options is outside the scope of this book, so + only the most frequently modified directives will be described + here. + + + + ServerRoot "/usr/local" + + + This specifies the default directory hierarchy for + the Apache installation. Binaries are stored in the + bin and + sbin subdirectories + from this root, and configuration files are store in + etc/apache. + + + + + ServerAdmin you@your.address + + + Your address, where problems with the server should + be emailed. This address appears on some + server-generated pages, such as error documents. + + + + + ServerName www.example.com + + + ServerName allows you to set a host name which is + sent back to clients for your server if it's different + than the one the program would get (i.e., use "www" + instead of the host's real name). + + + + + DocumentRoot "/usr/local/www/data" + + + DocumentRoot: The directory out of which you will + serve your documents. By default, all requests are taken + from this directory, but symbolic links and aliases may + be used to point to other locations. + + + + + It's always a good idea to make backup copies of your + Apache configuration file before making changes. Once you are + satisfied with your initial configuration you are ready to + start running Apache. + + + + + + + + Running <application>Apache</application> + + Apache + starting or stopping + + Apache does not run from the + inetd super server as many other + network servers do. It is configured to run standalone for + better performance for incoming HTTP requests from client web + browsers. A shell script wrapper is included to make + starting, stopping, and restarting the server as simple as + possible. To start up Apache for + the first time, just run: + + &prompt.root; /usr/local/sbin/apachectl start + + You can stop the server at any time by typing : + + &prompt.root; /usr/local/sbin/apachectl stop + + After making changes to the configuration file for any + reason, you will need to restart the server: + + &prompt.root; /usr/local/sbin/apachectl restart + + To launch Apache at system + startup, add the following line to + /etc/rc.conf: + + apache_enable="YES" + + If you would like to supply additional command line + options for the Apache + httpd program started at system boot, you + may specify them with an additional line in + rc.conf: + + apache_flags="" + + Now that the web server is running, you can view your web + site by pointing a web browser to + http://localhost/. The default web page + that is displayed is + /usr/local/www/data/index.html. + + + + + Apache Modules + + Apache + modules + + There are many different Apache modules available to add + functionality to the basic server. The FreeBSD Ports + Collection provides an easy way to install + Apache together with some of the + more popular add-on modules. + + + mod_ssl + + web server + secure + SSL + cryptography + + The mod_ssl module uses the OpenSSL library to provide + strong cryptography via the Secure Sockets Layer (SSL v2/v3) + and Transport Layer Security (TLS v1) protocols. This + module provides everything necessary to request a signed + certificate from a trusted certificate signing authority so + that you can run a secure web server on &os;. + + If you have not yet installed + Apache, then a version of Apache + that includes mod_ssl may be installed with the www/apache13-modssl port. + + + + + + + + mod_perl + + Perl + + The Apache/Perl integration project brings together the + full power of the Perl programming language and the Apache + HTTP server. With the mod_perl module it is possible to + write Apache modules entirely in Perl. In addition, the + persistent interpreter embedded in the server avoids the + overhead of starting an external interpreter and the penalty + of Perl start-up time. + + If you have not yet installed + Apache, then a version of Apache + that includes mod_perl may be installed with the www/apache13-modperl port. + + + + PHP + + PHP + + PHP, which stands for PHP: Hypertext + Preprocessor is a widely-used Open Source + general-purpose scripting language that is especially suited + for Web development and can be embedded into HTML. Its + syntax draws upon C, Java, and Perl, and is easy to learn. + The main goal of the language is to allow web developers to + write dynamically generated webpages quickly, but you can do + much more with PHP. + + PHP may be installed from the lang/php5 port. + + + +