Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo -n "\033[1;34mDominio en local:\033[0m \033[1;31m"
- read domain
- echo -n "\033[0m\033[1;34mDirectorio de Instalación:\033[0m \033[1;31m"
- read directory
- echo -n "\033[0m\033[1;34mVersión(Ej. 2.1.1):\033[0m \033[1;31m"
- read version
- echo -n "\033[0m\033[1;34mDescargar con Vendors (si/no)[NO]:\033[0m \033[1;31m"
- read vendors
- echo "\033[0m"
- cd $directory
- if [ "$vendors" = "si" ]; then
- echo "\033[1;32mDescargamos Symfony $version, con vendors\033[0m"
- wget http://symfony.com/get/Symfony_Standard_Vendors_$version.tgz
- tar zxpf Symfony_Standard_Vendors_$version.tgz
- rm Symfony_Standard_Vendors_$version.tgz
- mv Symfony $domain
- cd $domain
- else
- echo "\033[1;32mDescargamos Symfony $version, sin vendors\033[0m"
- wget http://symfony.com/get/Symfony_Standard_$version.tgz
- tar zxpf Symfony_Standard_$version.tgz
- rm Symfony_Standard_$version.tgz
- mv Symfony $domain
- cd $domain
- echo "\033[1;32mDecargamos e instalamos Vendors\033[0m"
- curl -s http://getcomposer.org/installer | php
- php composer.phar install
- fi
- echo "\033[1;32mConfiguración de Permisos\033[0m"
- sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
- sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
- echo "\033[1;32mCreamos el servidor virtual\033[0m"
- echo "" >> /etc/apache2/sites-enabled/000-default
- echo "" >> /etc/apache2/sites-enabled/000-default
- echo "<VirtualHost *:80>" >> /etc/apache2/sites-enabled/000-default
- echo " ServerName $domain" >> /etc/apache2/sites-enabled/000-default
- echo " DocumentRoot "$directory/$domain/web"" >> /etc/apache2/sites-enabled/000-default
- echo " DirectoryIndex app.php" >> /etc/apache2/sites-enabled/000-default
- echo " <Directory "$directory/$domain/web">" >> /etc/apache2/sites-enabled/000-default
- echo " AllowOverride All" >> /etc/apache2/sites-enabled/000-default
- echo " Allow from All" >> /etc/apache2/sites-enabled/000-default
- echo " </Directory>" >> /etc/apache2/sites-enabled/000-default
- echo "</VirtualHost> " >> /etc/apache2/sites-enabled/000-default
- echo "\033[1;32mCreamos el indicamos donde esta en alias\033[0m"
- echo "127.0.0.1 $domain" >> /etc/hosts
- echo "\033[1;32mReiniciamos el Servidor Apache\033[0m"
- sudo /etc/init.d/apache2 restart
- echo "\033[1;32mLanzamos el el proyecto\033[0m"
- firefox http://$domain/app_dev.php
Advertisement
Add Comment
Please, Sign In to add comment