Sometimes we have configuration or properties file (as templates) such as httpd.conf or server.conf where we want to dynamically replace $variables with values before writing the output to a new file.
# httpd.conf.tmpl SetHandler server-status Order deny,allow Deny from all Allow from $MONITOR_IP We want to develop an install script in Bash such that it reads the httpd.conf.tmpl and replaces the $STATUS_URI and $MONITOR_IP with appropriate values (either passed in as script arguments or coded in the bash script) and then write out the resulting output to a new file such as /tmp/httpd.
Below are my steps to installing mod_python under Apache HTTPD in CentOS 6.2.
Download mod_python-3.3.1.tgz or a later version of mod_python available here: http://archive.apache.org/dist/httpd/modpython/
[sourcecode] curl -O http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz tar zxvf mod_python-3.3.1.tgz cd mod_python-3.3.1 ./configure make [/sourcecode]
You may encounter the following error at this point: apxs:Error: Command failed with rc=65536
If so… no worries…
This bug has been addressed here: https://bugzilla.redhat.com/show_bug.cgi?id=465246
Download the patch and (if you can figure out how to patch like I did, I manually opened the file and examined the contents: ` diff -rNu mod_python-3.
Case #1: When the Tomcat config is this: [sourcecode language="jscript”] [/sourcecode] Observe the “path” element in the “Context”. Then… http://localhost/index.jsp yields to the “index.jsp” under HelloWorld folder. http://localhost/HelloWorld/index.jsp yields to a “404 Page”.
Case #2: When the Tomcat setup is this: [sourcecode language="jscript”] [/sourcecode]
Once again observe the “path” element in the “Context”. Then… http://localhost/index.jsp yields to a “blank page”. http://localhost/HelloWorld/index.jsp yields to a “blank page”. http://localhost/hw/index.jsp yields to the “index.