svn commit: r47884 - head/en_US.ISO8859-1/books/fdp-primer/the-website

Warren Block <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
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 @@
 
       <screen>&prompt.user; <userinput>cd ~/doc/en_US.ISO8859-1/htdocs/</userinput>
 &prompt.user; <userinput>env DESTDIR=/tmp/www make ENGLISH_ONLY=yes WEB_ONLY=yes all install</userinput></screen>
+
+      <para>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:</para>
+
+      <screen>&prompt.user; <userinput>firefox /tmp/www/data/index.html</userinput></screen>
+
+      <para>Modifications to dynamic files can be tested with a web
+	server running on the local system.  After building the site
+	as shown above, this
+	<filename>/usr/local/etc/apache24/httpd.conf</filename> can be
+	used with <package>www/apache24</package>:</para>
+
+      <programlisting># 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 [email protected]
+ServerName fbsdtest
+
+# deny access to all files
+&lt;Directory /&gt;
+    AllowOverride none
+    Require all denied
+&lt;/Directory&gt;
+
+# allow access to the website directory
+DocumentRoot "${TestRoot}"
+&lt;Directory "${TestRoot}"&gt;
+    Options Indexes FollowSymLinks
+    AllowOverride None
+    Require all granted
+&lt;/Directory&gt;
+
+# prevent access to .htaccess and .htpasswd files
+&lt;Files ".ht*"&gt;
+    Require all denied
+&lt;/Files&gt;
+
+ErrorLog "/var/log/httpd-error.log"
+LogLevel warn
+
+# set up the CGI script directory
+&lt;Directory "${TestRoot}/cgi"&gt;
+    AllowOverride None
+    Options None
+    Require all granted
+    Options +ExecCGI
+    AddHandler cgi-script .cgi
+&lt;/Directory&gt;
+
+Include etc/apache24/Includes/*.conf</programlisting>
+
+      <para>Start the web server with</para>
+
+      <screen>&prompt.root; <userinput>service apache24 onestart</userinput></screen>
+
+      <para>The	web site can be viewed at
+	<link xlink:href="http://localhost"/>.  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 <acronym>DNS</acronym> so
+	<literal>www.FreeBSD.org</literal> resolves to
+	<literal>localhost</literal> or the local
+	<acronym>IP</acronym> address.</para>
     </example>
 
     <example xml:id="the-website-examples-buildinstall">
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.