From owner-svn-doc-head@freebsd.org Thu Dec 17 14:05:11 2015 Return-Path: Delivered-To: svn-doc-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 569D2A480C0; Thu, 17 Dec 2015 14:05:11 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CF141D91; Thu, 17 Dec 2015 14:05:11 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHE5Ag4072090; Thu, 17 Dec 2015 14:05:10 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHE5AfC072089; Thu, 17 Dec 2015 14:05:10 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201512171405.tBHE5AfC072089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Thu, 17 Dec 2015 14:05:10 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r47884 - head/en_US.ISO8859-1/books/fdp-primer/the-website X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 14:05:11 -0000 Author: wblock Date: Thu Dec 17 14:05:09 2015 New Revision: 47884 URL: https://svnweb.freebsd.org/changeset/doc/47884 Log: Add a minimal Apache httpd.conf example for running test versions of the web site locally, including CGI scripts. Modified: head/en_US.ISO8859-1/books/fdp-primer/the-website/chapter.xml Modified: head/en_US.ISO8859-1/books/fdp-primer/the-website/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/fdp-primer/the-website/chapter.xml Thu Dec 17 13:35:32 2015 (r47883) +++ head/en_US.ISO8859-1/books/fdp-primer/the-website/chapter.xml Thu Dec 17 14:05:09 2015 (r47884) @@ -169,6 +169,88 @@ &prompt.user; cd ~/doc/en_US.ISO8859-1/htdocs/ &prompt.user; env DESTDIR=/tmp/www make ENGLISH_ONLY=yes WEB_ONLY=yes all install + + Changes to static files can usually be tested by viewing + the modified files directly with a web browser. If the site + has been built as shown above, a modified main page can be + viewed with: + + &prompt.user; firefox /tmp/www/data/index.html + + Modifications to dynamic files can be tested with a web + server running on the local system. After building the site + as shown above, this + /usr/local/etc/apache24/httpd.conf can be + used with www/apache24: + + # httpd.conf for testing the FreeBSD website +Define TestRoot "/tmp/www/data" + +# directory for configuration files +ServerRoot "/usr/local" + +Listen 80 + +# minimum required modules +LoadModule authz_core_module libexec/apache24/mod_authz_core.so +LoadModule mime_module libexec/apache24/mod_mime.so +LoadModule unixd_module libexec/apache24/mod_unixd.so +LoadModule cgi_module libexec/apache24/mod_cgi.so +LoadModule dir_module libexec/apache24/mod_dir.so + +# run the webserver as user and group +User www +Group www + +ServerAdmin you@example.com +ServerName fbsdtest + +# deny access to all files +<Directory /> + AllowOverride none + Require all denied +</Directory> + +# allow access to the website directory +DocumentRoot "${TestRoot}" +<Directory "${TestRoot}"> + Options Indexes FollowSymLinks + AllowOverride None + Require all granted +</Directory> + +# prevent access to .htaccess and .htpasswd files +<Files ".ht*"> + Require all denied +</Files> + +ErrorLog "/var/log/httpd-error.log" +LogLevel warn + +# set up the CGI script directory +<Directory "${TestRoot}/cgi"> + AllowOverride None + Options None + Require all granted + Options +ExecCGI + AddHandler cgi-script .cgi +</Directory> + +Include etc/apache24/Includes/*.conf + + Start the web server with + + &prompt.root; service apache24 onestart + + The web site can be viewed at + . Be aware that many + links refer to the real &os; site by name, and those links + will still go to the external site instead of the local test + version. Fully testing the local site will require + temporarily setting DNS so + www.FreeBSD.org resolves to + localhost or the local + IP address.