Skip to content
Snippets Groups Projects
Commit 4e3ac2fb authored by User expired's avatar User expired
Browse files

improved postgresql authentication in vagrantbox

also added phpPgAdmin to bootstraph.sh of vagrantbox
parent a6b91330
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ INSTALL_HTTPD=true
INSTALL_NEO4J=true
INSTALL_POSTGIS=true
INSTALL_TOMCAT=true
INSTALL_POSTGRES_ADMIN=true
DISTRI=$(cat /etc/issue | head -n 1 | cut -d " " -f 1)
DOWNLOAD_DIR=/tmp/vagrant-cache/wget
......@@ -43,7 +44,8 @@ OSM2PGROUTING_VERSION=v2.0.0
OSM2PGROUTING_MAPPING_CONF=$DEPLOY_DIR/osm2pgrouting/mapconfig.xml
OSMOSIS_VERSION=0.43.1
OSMOSIS_FILE=osmosis-$OSMOSIS_VERSION.zip
POSTGRESQL_HBA_CONF=/var/lib/pgsql/9.3/data/pg_hba.conf
POSTGRESQL_DATA_DIR=/var/lib/pgsql/9.3/data
POSTGRESQL_HBA_CONF=$POSTGRESQL_DATA_DIR/pg_hba.conf
POSTGRESQL_PKG_NAME=postgresql93
POSTGRESQL_REPO_RPM=http://yum.postgresql.org/9.3/fedora/fedora-19-x86_64/pgdg-fedora93-9.3-1.noarch.rpm
POSTGRESQL_SERVICE_NAME=postgresql-9.3
......@@ -55,9 +57,9 @@ TOMCAT_PKG_NAME=tomcat
TOMCAT_SERVICE_NAME=$TOMCAT_PKG_NAME
WORKING_DIR=`pwd`
DATABASE_NAME=isochrone
DATABASE_USER=niko
DATABASE_PASSWORD=secretPhdPassword#2013!
DATABASE_NAME="isochrone"
DATABASE_USER="niko"
DATABASE_PASSWORD="secretPhdPassword#2013!"
## Functions
############
......@@ -167,6 +169,11 @@ if [ $INSTALL_POSTGIS ]; then
cd $WORKING_DIR
fi
if [ $INSTALL_POSTGRES_ADMIN ]; then
echo "Installing phpPgAdmin"
yum -y install phpPgAdmin > install_phpPgAdmin.log 2>&1
fi
if [ $INSTALL_TOMCAT ]; then
echo "Installing $TOMCAT_PKG_NAME servlet container"
yum -y install $TOMCAT_PKG_NAME $TOMCAT_PKG_NAME-webapps $TOMCAT_PKG_NAME-admin-webapps > install_tomcat.log 2>&1
......@@ -282,7 +289,14 @@ if [ $INSTALL_POSTGIS ]; then
echo "Configuring and starting postgresql-server"
cp /vagrant/pg_hba.conf $POSTGRESQL_HBA_CONF
echo "listen_addresses = '*'" >> $POSTGRESQL_DATA_DIR/postgresql.conf
echo "port = 5432" >> $POSTGRESQL_DATA_DIR/postgresql.conf
fi
if [ $INSTALL_POSTGRES_ADMIN ]; then
echo "Configuring phpPgAdmin"
cp /vagrant/phpPgAdmin.conf /etc/httpd/conf.d/phpPgAdmin.conf
sed -i 's/\$conf\['\''servers'\''\]\[0\]\['\''host'\''\] = '\'''\''/\$conf\['\''servers'\''\]\[0\]\['\''host'\''\] = '\''localhost'\''/' /usr/share/phpPgAdmin/conf/config.inc.php
fi
if [ $INSTALL_NEO4J ]; then
......
# TYPE DATABASE USER ADDRESS METHOD
local all all peer
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
Alias /phpPgAdmin /usr/share/phpPgAdmin
<Location /phpPgAdmin>
Order deny,allow
Allow from all
</Location>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment