+sed -i "s@define *( *'BRISK_DEBUG',[^)]*)@define('BRISK_DEBUG', $brisk_debug)@g" ${web_path}__/Obj/brisk.phh
+
+sed -i "s@define *( *'LEGAL_PATH',[^)]*)@define('LEGAL_PATH', \"$legal_path\")@g" ${web_path}__/Obj/brisk.phh
+
+sed -i "s@define *( *'PROXY_PATH',[^)]*)@define('PROXY_PATH', \"$proxy_path\")@g" ${web_path}__/Obj/brisk.phh
+
+sed -i "s@define *( *'BRISK_CONF',[^)]*)@define('BRISK_CONF', \"$brisk_conf\")@g" ${web_path}__/Obj/brisk.phh
+
+sed -i "s@define *( *'BRISK_AUTH_CONF',[^)]*)@define('BRISK_AUTH_CONF', \"$brisk_auth_conf\")@g" ${web_path}__/Obj/auth.phh
+
+sed -i "s@var \+cookiepath \+= \+\"[^\"]*\";@var cookiepath = \"$prefix_path\";@g" ${web_path}__/commons.js
+
+sed -i "s@\( \+cookiepath *: *\)\"[^\"]*\" *,@\1 \"$prefix_path\",@g" ${web_path}__/xynt-streaming.js
+
+document_root="$(grep DocumentRoot "${apache_conf}" | grep -v '^[ ]*#' | awk '{ print $2 }')"
+sed -i "s@^\(\$DOCUMENT_ROOT *= *[\"']\)[^\"']*\([\"']\)@\1$document_root\2@g" ${web_path}__/spush/*.ph*
+
+if [ -d ${web_path} ]; then
+ mv ${web_path} ${web_path}.old
+fi
+
+if [ -d ../brisk-img ]; then
+ cd ../brisk-img
+ ./INSTALL.sh -w ${web_path}__
+ cd - >/dev/null 2>&1
+fi
+
+# config file installation or diff
+if [ -f "$etc_path/$brisk_conf" ]; then
+ echo "Config file $etc_path/$brisk_conf exists."
+ echo "=== Dump the diff. ==="
+ # diff -u "$etc_path/$brisk_conf" "${web_path}__""/Obj/brisk.conf-templ.pho"
+ diff -u <(cat "$etc_path/$brisk_conf" | grep '\$[a-zA-Z_ ]\+=' | sed 's/ = .*/ = /g' | sort | uniq) <(cat "${web_path}__""/Obj/brisk.conf-templ.pho" | grep '\$[a-zA-Z_ ]\+=' | sed 's/ = .*/ = /g' | sort | uniq )
+ echo "=== End dump. ==="
+else
+ echo "Config file $etc_path/$brisk_conf not exists."
+ echo "Install a template."
+ cp "${web_path}__""/Obj/brisk.conf-templ.pho" "$etc_path/$brisk_conf"
+fi
+
+mv ${web_path}__ ${web_path}
+if [ -d ${web_path}.old ]; then
+ rm -rf ${web_path}.old
+fi
+if [ "$web_only" = "FALSE" ]; then
+ mv "$ftokk_path" "$ftok_path"
+fi
+if [ -f WARNING.txt ]; then
+ echo ; echo " ==== WARNING ===="
+ echo
+ cat WARNING.txt
+ echo
+fi