[Mapbender-commits] r9997 - trunk/mapbender/resources/db
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Nov 13 10:20:11 PST 2018
Author: armin11
Date: 2018-11-13 10:20:11 -0800 (Tue, 13 Nov 2018)
New Revision: 9997
Modified:
trunk/mapbender/resources/db/install_geoportal_mb28.sh
Log:
Some fixes and enhancements - thanx to frank.jaeger from krz lemgo
Modified: trunk/mapbender/resources/db/install_geoportal_mb28.sh
===================================================================
--- trunk/mapbender/resources/db/install_geoportal_mb28.sh 2018-11-08 16:52:15 UTC (rev 9996)
+++ trunk/mapbender/resources/db/install_geoportal_mb28.sh 2018-11-13 18:20:11 UTC (rev 9997)
@@ -14,6 +14,7 @@
############################################################
mapbender_database_name="mapbender"
mapbender_database_port="5432"
+# don't give any $ symbols in password ord username!
mapbender_database_user="mapbenderdbuser"
mapbender_database_password="mapbenderdbpassword"
############################################################
@@ -82,7 +83,10 @@
############################################################
#
############################################################
-use_proxy="true"
+use_proxy_system="true"
+use_proxy_svn="true"
+use_proxy_apt="true"
+use_proxy_mb="true"
http_proxy_host="proxyip"
http_proxy_port="proxyport"
@@ -120,14 +124,18 @@
############################################################
# set some environment variables
############################################################
-if [ $use_proxy = 'true' ]; then
+if [ $use_proxy_svn = 'true' ]; then
# set proxy env for wget from shell
cp /etc/subversion/servers /etc/subversion/servers_backup_geoportal
+fi
+if [ $use_proxy_system = 'true' ]; then
export http_proxy=http://$http_proxy_host:$http_proxy_port
export https_proxy=http://$https_proxy_host:$https_proxy_port
# for git access behind proxy
# git config --global http.proxy http://$http_proxy_host:$http_proxy_port
# git config --global https.proxy http://$https_proxy_host:$https_proxy_port
+fi
+if [ $use_proxy_apt = 'true' ]; then
# for apt alter or create /etc/apt/apt.conf
if [ -e "/etc/apt/apt.conf" ]; then
echo "File exists"
@@ -150,7 +158,7 @@
############################################################
# install needed debian packages
############################################################
- apt-get install -y php5-mysql libapache2-mod-php5 php5-pgsql php5-gd php5-curl php5-cli php-gettext g++ make bison bzip2 unzip zip gdal-bin cgi-mapserver php5-imagick mysql-server imagemagick locate postgresql postgis postgresql-9.4-postgis-2.1 mc zip unzip links w3m lynx arj xpdf dbview odt2txt ca-certificates oidentd gettext phppgadmin gkdebconf subversion subversion-tools php5-memcached php5-memcache php-apc
+ apt-get install -y php5-mysql libapache2-mod-php5 php5-pgsql php5-gd php5-curl php5-cli php-gettext g++ make bison bzip2 unzip zip gdal-bin cgi-mapserver php5-imagick mysql-server imagemagick locate postgresql postgis postgresql-9.4-postgis-2.1 mc zip unzip links w3m lynx arj xpdf dbview odt2txt ca-certificates oidentd gettext phppgadmin gkdebconf subversion subversion-tools php5-memcached php5-memcache php-apc curl
fi
# +655MB
# mysql root password: mysqlroot - normally debian-sys-maint
@@ -172,7 +180,7 @@
# set some environment variables
############################################################
-if [ $use_proxy = 'true' ]; then
+if [ $use_proxy_svn = 'true' ]; then
# for subversion alter /etc/subversion/servers - alter following lines
# # http-proxy-host = defaultproxy.whatever.com
sed -i "s/# http-proxy-host = defaultproxy.whatever.com/http-proxy-host = $http_proxy_host/g" /etc/subversion/servers
@@ -327,7 +335,7 @@
if [ $install_mapbender_database = 'true' ]; then
echo -n 'install mapbender database ... '
# su postgres
-# createuser -S -D -R -P mapbenderdbuser #mapbenderdbpassword
+# createuser -S -D -R -P $mapbender_database_user #mapbenderdbpassword
# CREATE DATABASE yourdbname;
# CREATE USER youruser WITH ENCRYPTED PASSWORD 'yourpass';
# GRANT ALL PRIVILEGES ON DATABASE yourdbname TO youruser;
@@ -534,7 +542,7 @@
ALTER TABLE groups_for_publishing
OWNER TO postgres;
GRANT ALL ON TABLE groups_for_publishing TO postgres;
-GRANT ALL ON TABLE groups_for_publishing TO mapbenderdbuser;
+GRANT ALL ON TABLE groups_for_publishing TO $mapbender_database_user;
-- View: registrating_groups
@@ -551,7 +559,7 @@
ALTER TABLE registrating_groups
OWNER TO postgres;
GRANT ALL ON TABLE registrating_groups TO postgres;
-GRANT ALL ON TABLE registrating_groups TO mapbenderdbuser;
+GRANT ALL ON TABLE registrating_groups TO $mapbender_database_user;
-- View: users_for_publishing
@@ -568,7 +576,7 @@
ALTER TABLE users_for_publishing
OWNER TO postgres;
GRANT ALL ON TABLE users_for_publishing TO postgres;
-GRANT ALL ON TABLE users_for_publishing TO mapbenderdbuser;
+GRANT ALL ON TABLE users_for_publishing TO $mapbender_database_user;
EOF
#####################
sudo -u postgres psql -q -p $mapbender_database_port -d $mapbender_database_name -f ${installation_folder}geoportal_database_adoption_1.sql
@@ -607,7 +615,7 @@
su - postgres -c "psql -q -p $mapbender_database_port -d $mapbender_database_name -c 'GRANT CREATE ON SCHEMA mapbender TO $mapbender_database_user'"
-#su - postgres -c "psql -q -p 5432 -d mapbender -c 'GRANT CREATE ON DATABASE mapbender TO mapbenderdbuser'"
+#su - postgres -c "psql -q -p 5432 -d mapbender -c 'GRANT CREATE ON DATABASE mapbender TO $mapbender_database_user'"
#####################
# add precise coordinate transformation to proj and postgis extension
#####################
@@ -658,7 +666,7 @@
# define proxy settings
#####################
# sed -i "s///g" ${installation_folder}mapbender/conf/mapbender.conf
- if [ $use_proxy = 'true' ]; then
+ if [ $use_proxy_mb = 'true' ]; then
sed -i "s/define(\"CONNECTION_PROXY\", \"\");/define(\"CONNECTION_PROXY\", \"$http_proxy_host\");/g" ${installation_folder}mapbender/conf/mapbender.conf
sed -i "s/define(\"CONNECTION_PORT\", \"\");/define(\"CONNECTION_PORT\", \"$http_proxy_port\");/g" ${installation_folder}mapbender/conf/mapbender.conf
sed -i "s/define(\"NOT_PROXY_HOSTS\", \"<ip>,<ip>,<ip>\");/define(\"NOT_PROXY_HOSTS\", \"localhost,127.0.0.1\");/g" ${installation_folder}mapbender/conf/mapbender.conf
@@ -726,7 +734,7 @@
# define proxy settings
#####################
# sed -i "s///g" ${installation_folder}mapbender/conf/mapbender.conf
- if [ $use_proxy = 'true' ]; then
+ if [ $use_proxy_mb = 'true' ]; then
sed -i "s/define(\"CONNECTION_PROXY\", \"\");/define(\"CONNECTION_PROXY\", \"$http_proxy_host\");/g" ${installation_folder}conf/mapbender.conf
sed -i "s/define(\"CONNECTION_PORT\", \"\");/define(\"CONNECTION_PORT\", \"$http_proxy_port\");/g" ${installation_folder}conf/mapbender.conf
sed -i "s/define(\"NOT_PROXY_HOSTS\", \"<ip>,<ip>,<ip>\");/define(\"NOT_PROXY_HOSTS\", \"localhost,127.0.0.1\");/g" ${installation_folder}conf/mapbender.conf
@@ -787,7 +795,7 @@
# define proxy settings
#####################
# sed -i "s///g" ${installation_folder}mapbender/conf/mapbender.conf
- if [ $use_proxy = 'true' ]; then
+ if [ $use_proxy_mb = 'true' ]; then
sed -i "s/define(\"CONNECTION_PROXY\", \"\");/define(\"CONNECTION_PROXY\", \"$http_proxy_host\");/g" ${installation_folder}conf/mapbender.conf
sed -i "s/define(\"CONNECTION_PORT\", \"\");/define(\"CONNECTION_PORT\", \"$http_proxy_port\");/g" ${installation_folder}conf/mapbender.conf
sed -i "s/define(\"NOT_PROXY_HOSTS\", \"<ip>,<ip>,<ip>\");/define(\"NOT_PROXY_HOSTS\", \"localhost,127.0.0.1\");/g" ${installation_folder}conf/mapbender.conf
@@ -1126,7 +1134,7 @@
#!/bin/bash
curl http://localhost/mapbender/php/mod_exportISOMetadata.php?Type=ALL > /tmp/metadataGeneration.log
EOF
-
+chmod u+x ${installation_folder}cronjobs/generateMetadata.sh
############################################################
# install cronjobs for root account
############################################################
@@ -1224,7 +1232,7 @@
rm ${installation_folder}install.log
rm ${installation_folder}initialize_typo3_database.sql
-if [ $use_proxy = 'true' ]; then
+if [ $use_proxy_apt = 'true' ]; then
if [ -e "/etc/apt/apt.conf_backup_geoportal" ]; then
echo "Backup version of file exists - overwrite it with the original one"
cp /etc/apt/apt.conf_backup_geoportal /etc/apt/apt.conf
More information about the Mapbender_commits
mailing list