Last active
December 12, 2015 03:59
-
-
Save lucasdavila/4711321 to your computer and use it in GitHub Desktop.
Instalação i-Educar
This file contains hidden or 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
echo -e "\n\n** Atualizando apt-get" | |
sudo apt-get update -y | |
echo -e "\n\n** Instalando git" | |
sudo apt-get install -y git-core | |
echo -e "\n\n** Instalando apache e mod_rewrite" | |
sudo apt-get install -y apache2 | |
sudo a2enmod rewrite | |
sudo service apache2 restart | |
echo -e "\n\n** Instalando php5" | |
sudo apt-get install -y libapache2-mod-php5 php5-pgsql | |
echo -e "\n\n** Instalando pear" | |
sudo apt-get install -y php-pear | |
sudo service apache2 restart | |
echo -e "\n\n** Instalando pgvm" | |
#curl -s -L https://raw.github.com/lucasdavila/pgvm/master/bin/pgvm-self-install | bash -s -- --update | |
curl -s -L https://raw.github.com/guedes/pgvm/master/bin/pgvm-self-install | bash |
This file contains hidden or 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
echo -e "\n\n** Instalando dependências para instalação postgresql" | |
sudo apt-get install -y libreadline6 libreadline6-dev make gcc zlib1g-dev | |
echo -e "\n\n** Instalando postgres 8.2 via pgvm" | |
pgvm install 8.2 | |
echo -e "\n\n** Criando cluster main" | |
pgvm use 8.2.23 | |
pgvm cluster create main | |
pgvm cluster start main | |
echo -e "\n\n** Adicionando usuário ieducar" | |
~/.pgvm/environments/8.2.23/bin/createuser --superuser ieducar -p 5433 | |
echo -e "\n\n** Baixando dump banco de dados" | |
sudo apt-get install -y wget | |
rm -f ieducar.backup.gz | |
rm -f ieducar.backup | |
wget https://s3-us-west-2.amazonaws.com/portabilis2/public/ieducar/ieducar.backup.gz | |
gunzip ieducar.backup.gz | |
echo -e "\n\n** Destruindo banco de dados caso exista" | |
~/.pgvm/environments/8.2.23/bin/dropdb ieducar -p 5433 | |
echo -e "\n\n** Restaurando dump do banco de dados" | |
~/.pgvm/environments/8.2.23/bin/createdb ieducar -E latin1 -p 5433 | |
~/.pgvm/environments/8.2.23/bin/pg_restore -d ieducar -p 5433 -U ieducar --no-owner ieducar.backup | |
echo -e "\n\n** Definindo search_path" | |
~/.pgvm/environments/8.2.23/bin/psql -d ieducar -p 5433 -c 'ALTER DATABASE ieducar SET search_path = "$user", public, portal, cadastro, acesso, alimentos, consistenciacao, historico, pmiacoes, pmicontrolesis, pmidrh, pmieducar, pmiotopic, urbano, modules;' |
This file contains hidden or 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
echo -e "\n\n** Configurando virtual host" | |
sudo apt-get install -y rpl | |
sudo rm -f /etc/apache2/sites-enabled/ieducar | |
sudo rm -f /etc/apache2/sites-available/ieducar | |
sudo wget https://s3-us-west-2.amazonaws.com/portabilis2/public/ieducar/apache/sites-available/ieducar -P /etc/apache2/sites-available/ | |
sudo rpl "/home/lucasdavila" "/home/$USER" /etc/apache2/sites-available/ieducar | |
sudo a2dissite 000-default | |
sudo a2ensite ieducar | |
sudo service apache2 restart | |
if ! grep -q ieducar.local /etc/hosts; then | |
echo -e "\n\n** Adicionando host para ieducar.local" | |
echo "127.0.0.1 ieducar.local" | sudo tee -a /etc/hosts | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment