Page MenuHomeFreeBSD

D25367.id73358.diff
No OneTemporary

D25367.id73358.diff

Index: en_US.ISO8859-1/books/handbook/Makefile
===================================================================
--- en_US.ISO8859-1/books/handbook/Makefile
+++ en_US.ISO8859-1/books/handbook/Makefile
@@ -217,7 +217,12 @@
# Entities
SRCS+= chapters.ent
-SYMLINKS= ${DESTDIR} index.html handbook.html
+
+SYMLINKS=
+SYMLINKS+= ${DESTDIR} index.html handbook.html
+# TODO(murray): a redirect would be better for search engines
+SYMLINKS+= ${DESTDIR} network-http.html network-apache.html
+
# Turn on all the chapters.
CHAPTERS?= ${SRCS:M*chapter.xml}
Index: en_US.ISO8859-1/books/handbook/network-servers/chapter.xml
===================================================================
--- en_US.ISO8859-1/books/handbook/network-servers/chapter.xml
+++ en_US.ISO8859-1/books/handbook/network-servers/chapter.xml
@@ -65,8 +65,8 @@
</listitem>
<listitem>
- <para>How to set up the <application>Apache</application>
- <acronym>HTTP</acronym> Server.</para>
+ <para>How to set up the an <acronym>HTTP</acronym> server running either
+ <application>Apache</application> or <application>Nginx</application>.</para>
</listitem>
<listitem>
@@ -3292,9 +3292,9 @@
</sect2>
</sect1>
- <sect1 xml:id="network-apache">
+ <sect1 xml:id="network-http">
<info>
- <title>Apache HTTP Server</title>
+ <title>Hypertext Transfer Protocol (HTTP)</title>
<authorgroup>
<author>
@@ -3309,22 +3309,30 @@
<indexterm><primary>web servers</primary>
<secondary>setting up</secondary></indexterm>
- <indexterm><primary>Apache</primary></indexterm>
+
+ <para>The Hypertext Transfer Protocol (HTTP) is the protocol of
+ the World Wide Web. An HTTP server is not included in the base
+ system, but there are several excellent options in the Ports
+ Collection. The most popular options are
+ <application>Apache</application> and
+ <application>Nginx</application>.</para>
- <para>The open source
- <application>Apache HTTP Server</application> is the most widely
- used web server. &os; does not install this web server by
- default, but it can be installed from the
- <package>www/apache24</package> package or port.</para>
+ <sect2 xml:id="network-apache">
+ <title>Apache HTTP Server</title>
+ <indexterm><primary>Apache</primary></indexterm>
- <para>This section summarizes how to configure and start version
+ <para><application>Apache</application> can be
+ installed from the <package>www/apache24</package> package or
+ port.</para>
+
+ <para>This section summarizes how to configure and start version
2.<replaceable>x</replaceable> of the <application>Apache HTTP
Server</application> on &os;. For more detailed information
about <application>Apache</application>&nbsp;2.X and its
configuration directives, refer to <link
xlink:href="http://httpd.apache.org/">httpd.apache.org</link>.</para>
-
- <sect2>
+
+ <sect3>
<title>Configuring and Starting Apache</title>
<indexterm><primary>Apache</primary>
@@ -3446,9 +3454,8 @@
and should not be expected to work for all startup
scripts.</para>
</note>
- </sect2>
-
- <sect2>
+ </sect3>
+ <sect3>
<title>Virtual Hosting</title>
<para>Virtual hosting allows multiple websites to run on one
@@ -3490,9 +3497,9 @@
consult the official <application>Apache</application>
documentation at: <uri
xlink:href="http://httpd.apache.org/docs/vhosts/">http://httpd.apache.org/docs/vhosts/</uri>.</para>
- </sect2>
+ </sect3>
- <sect2>
+ <sect3>
<title>Apache Modules</title>
<indexterm><primary>Apache</primary>
@@ -3514,7 +3521,7 @@
section describes three of the most commonly used
modules.</para>
- <sect3>
+ <sect4>
<title><filename>mod_ssl</filename></title>
<indexterm>
@@ -3537,9 +3544,9 @@
by default in both the package and the port. The available
configuration directives are explained at <uri
xlink:href="http://httpd.apache.org/docs/current/mod/mod_ssl.html">http://httpd.apache.org/docs/current/mod/mod_ssl.html</uri>.</para>
- </sect3>
+ </sect4>
- <sect3>
+ <sect4>
<title><filename>mod_perl</filename></title>
<indexterm>
@@ -3559,9 +3566,9 @@
the <package>www/mod_perl2</package> package or port.
Documentation for using this module can be found at <uri
xlink:href="http://perl.apache.org/docs/2.0/index.html">http://perl.apache.org/docs/2.0/index.html</uri>.</para>
- </sect3>
+ </sect4>
- <sect3>
+ <sect4>
<info>
<title><filename>mod_php</filename></title>
@@ -3636,10 +3643,10 @@
pick up the new configuration changes:</para>
<screen>&prompt.root; <userinput>apachectl graceful</userinput></screen>
- </sect3>
- </sect2>
+ </sect4>
+ </sect3>
- <sect2>
+ <sect3>
<title>Dynamic Websites</title>
<indexterm>
@@ -3653,7 +3660,7 @@
<application>Django</application> and
<application>Ruby on Rails</application>.</para>
- <sect3>
+ <sect4>
<title>Django</title>
<indexterm><primary>Python</primary></indexterm>
@@ -3710,9 +3717,9 @@
xlink:href="https://docs.djangoproject.com">https://docs.djangoproject.com</uri>
for more information on how to use
<application>Django</application>.</para>
- </sect3>
+ </sect4>
- <sect3>
+ <sect4>
<title>Ruby on Rails</title>
<indexterm><primary>Ruby on Rails</primary></indexterm>
@@ -3728,6 +3735,105 @@
xlink:href="http://guides.rubyonrails.org">http://guides.rubyonrails.org</uri>
for more information on how to use <application>Ruby on
Rails</application>.</para>
+ </sect4>
+ </sect3>
+ </sect2>
+ <sect2 xml:id="network-nginx">
+ <title>Nginx HTTP Server</title>
+ <indexterm><primary>Nginx</primary></indexterm>
+
+ <para>Nginx can be installed from the
+ <package>www/nginx</package> package or port.</para>
+
+ <para>This section summarizes how to configure and start
+ <application>Nginx</application> on &os;. For more detailed
+ information about <application>Nginx</application> and its
+ configuration options, refer to <link
+ xlink:href="http://nginx.org/">nginx.org</link>.</para>
+
+ <sect3>
+ <title>Configuring and Starting Nginx</title>
+
+ <indexterm><primary>Nginx</primary>
+ <secondary>configuration file</secondary></indexterm>
+
+ <para>In &os;, the main <application>Nginx HTTP
+ Server</application> configuration file is installed as
+ <filename>/usr/local/etc/nginx/nginx.conf</filename>. This
+ <acronym>ASCII</acronym> text file is a custom hierarchical
+ configuration format. The following listing shows a subset of a
+ default configuration file to highlight a couple of common
+ configuration options.</para>
+
+ <programlisting>http {
+ include mime.types;
+ default_type application/octet-stream;
+
+ server {
+ listen 80; <co xml:id="network-nginx-co-listen" />
+ server_name localhost;
+
+ location / {
+ autoindex on; <co xml:id="network-nginx-co-autoindex" />
+ root /usr/local/www/nginx; <co xml:id="network-nginx-co-root" />
+ index index.html index.htm; <co xml:id="network-nginx-co-indexfiles" />
+ }
+ }
+}</programlisting>
+
+ <calloutlist>
+ <callout arearefs="network-nginx-co-listen">
+ <para>This line sets the port to listen to HTTP requests.</para>
+ </callout>
+
+ <callout arearefs="network-nginx-co-autoindex">
+ <para>This line directs Nginx to create and return a
+ directory listing for requests to directories without index
+ files.</para>
+ </callout>
+
+ <callout arearefs="network-nginx-co-root">
+ <para>This line specifies the directory in the file system
+ to serve content for the HTTP server.</para>
+ </callout>
+
+ <callout arearefs="network-nginx-co-indexfiles">
+ <para>This line specifies the index files to be used to
+ serve for each directory.</para>
+ </callout>
+ </calloutlist>
+
+ <para>To launch <application>Nginx</application> at system
+ startup, add the following line to
+ <filename>/etc/rc.conf</filename>:</para>
+
+ <programlisting>nginx_enable="YES"</programlisting>
+
+ <para>To start <application>Nginx</application> immediately:</para>
+
+ <screen>&prompt.root; <userinput>service nginx start</userinput></screen>
+
+ <para>The <command>httpd</command> service can be tested by
+ entering
+ <literal>http://<replaceable>localhost</replaceable></literal>
+ in a web browser, replacing
+ <replaceable>localhost</replaceable> with the fully-qualified
+ domain name of the machine. The default web page that is
+ displayed is
+ <filename>/usr/local/www/nginx/index.html</filename>, unless
+ you overrode the <literal>root</literal> parameter in the
+ configuration file above.</para>
+
+ </sect3>
+ <sect3>
+ <title>Access and Error Logs</title>
+
+ <para>The default error log path is compiled in so error logs
+ will always be found at
+ <filename>/var/log/nginx/error.log</filename>. The access log
+ location can be changed, but defaults to
+ <filename>/var/log/nginx/access.log</filename>. Start here if
+ you have configuration problems with Nginx.</para>
</sect3>
</sect2>
</sect1>

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 17, 3:00 AM (1 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27678463
Default Alt Text
D25367.id73358.diff (9 KB)

Event Timeline