Created
May 15, 2018 19:41
-
-
Save versionsix/a95b194d1fcbba1145d7e82bd2a8528b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# setup LAPP server with | |
# pg admin postgres | postgrespw | |
# try with `export PGPASSWORD='postgrespw'; psql -h <serverip> -U postgres` | |
export DEBIAN_FRONTEND=noninteractive | |
export DEBIAN_PRIORITY=critical | |
sudo -E apt-get -qy update | |
sudo -E apt-get -qy -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" upgrade | |
sudo -E apt-get -qy autoclean | |
apt install \ | |
apache2 \ | |
php \ | |
php-pgsql \ | |
libapache2-mod-php \ | |
php-xml \ | |
php-mbstring \ | |
postgresql \ | |
postgresql-client \ | |
-qq -y --no-install-recommends | |
sudo /etc/init.d/apache2 restart | |
echo "listen_addresses = '*'" >> /etc/postgresql/9.5/main/postgresql.conf | |
cd / | |
sudo -u postgres psql template1 -c "ALTER USER postgres with encrypted password 'postgrespw';" | |
echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.5/main/pg_hba.conf | |
echo "host all all ::/0 md5" >> /etc/postgresql/9.5/main/pg_hba.conf | |
sudo systemctl restart postgresql.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment