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 @@ - How to set up the Apache - HTTP Server. + How to set up the an HTTP server running either + Apache or Nginx. @@ -3292,9 +3292,9 @@ - + - Apache HTTP Server + Hypertext Transfer Protocol (HTTP) @@ -3309,22 +3309,30 @@ web servers setting up - Apache + + 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 + Apache and + Nginx. - The open source - Apache HTTP Server is the most widely - used web server. &os; does not install this web server by - default, but it can be installed from the - www/apache24 package or port. + + Apache HTTP Server + Apache - This section summarizes how to configure and start version + Apache can be + installed from the www/apache24 package or + port. + + This section summarizes how to configure and start version 2.x of the Apache HTTP Server on &os;. For more detailed information about Apache 2.X and its configuration directives, refer to httpd.apache.org. - - + + Configuring and Starting Apache Apache @@ -3446,9 +3454,8 @@ and should not be expected to work for all startup scripts. - - - + + Virtual Hosting Virtual hosting allows multiple websites to run on one @@ -3490,9 +3497,9 @@ consult the official Apache documentation at: http://httpd.apache.org/docs/vhosts/. - + - + Apache Modules Apache @@ -3514,7 +3521,7 @@ section describes three of the most commonly used modules. - + <filename>mod_ssl</filename> @@ -3537,9 +3544,9 @@ by default in both the package and the port. The available configuration directives are explained at http://httpd.apache.org/docs/current/mod/mod_ssl.html. - + - + <filename>mod_perl</filename> @@ -3559,9 +3566,9 @@ the www/mod_perl2 package or port. Documentation for using this module can be found at http://perl.apache.org/docs/2.0/index.html. - + - + <filename>mod_php</filename> @@ -3636,10 +3643,10 @@ pick up the new configuration changes: &prompt.root; apachectl graceful - - + + - + Dynamic Websites @@ -3653,7 +3660,7 @@ Django and Ruby on Rails. - + Django Python @@ -3710,9 +3717,9 @@ xlink:href="https://docs.djangoproject.com">https://docs.djangoproject.com for more information on how to use Django. - + - + Ruby on Rails Ruby on Rails @@ -3728,6 +3735,105 @@ xlink:href="http://guides.rubyonrails.org">http://guides.rubyonrails.org for more information on how to use Ruby on Rails. + + + + + Nginx HTTP Server + Nginx + + Nginx can be installed from the + www/nginx package or port. + + This section summarizes how to configure and start + Nginx on &os;. For more detailed + information about Nginx and its + configuration options, refer to nginx.org. + + + Configuring and Starting Nginx + + Nginx + configuration file + + In &os;, the main Nginx HTTP + Server configuration file is installed as + /usr/local/etc/nginx/nginx.conf. This + ASCII 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. + + http { + include mime.types; + default_type application/octet-stream; + + server { + listen 80; + server_name localhost; + + location / { + autoindex on; + root /usr/local/www/nginx; + index index.html index.htm; + } + } +} + + + + This line sets the port to listen to HTTP requests. + + + + This line directs Nginx to create and return a + directory listing for requests to directories without index + files. + + + + This line specifies the directory in the file system + to serve content for the HTTP server. + + + + This line specifies the index files to be used to + serve for each directory. + + + + To launch Nginx at system + startup, add the following line to + /etc/rc.conf: + + nginx_enable="YES" + + To start Nginx immediately: + + &prompt.root; service nginx start + + The httpd service can be tested by + entering + http://localhost + in a web browser, replacing + localhost with the fully-qualified + domain name of the machine. The default web page that is + displayed is + /usr/local/www/nginx/index.html, unless + you overrode the root parameter in the + configuration file above. + + + + Access and Error Logs + + The default error log path is compiled in so error logs + will always be found at + /var/log/nginx/error.log. The access log + location can be changed, but defaults to + /var/log/nginx/access.log. Start here if + you have configuration problems with Nginx.