Advertisement
aasanchez

Creación de Proyecto de symfony automatica

Jun 27th, 2011
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.34 KB | None | 0 0
  1. #!/bin/bash
  2. echo -n "Introduce el nombre del Proyecto: "
  3. read nombre
  4. echo -n "Introduce la version de symfony a descargar (ej:1.4.11): "
  5. read version
  6. echo ------------------- "Creamos la ubicacion en /var/www y otorgamos Permisos"
  7. mkdir -p /var/www/$nombre
  8. cd /var/www/$nombre
  9. chmod -R 777 /var/www/$nombre
  10. echo ------------------- "Preparamos y Descargamos Symfony"
  11. mkdir -p lib/vendor
  12. cd lib/vendor
  13. wget http://www.symfony-project.org/get/symfony-$version.tgz
  14. tar zxpf symfony-$version.tgz
  15. mv symfony-$version symfony
  16. rm symfony-$version.tgz
  17. cd /var/www/$nombre
  18. echo ------------------- "Generamos el proyecto Symfony"
  19. php lib/vendor/symfony/data/bin/symfony generate:project $nombre --orm=Doctrine
  20. echo ------------------- "Agregamos la priemra aplicación"
  21. echo -n "Introduce el nombre de la primera aplicación: "
  22. read app
  23. php symfony generate:app --escaping-strategy=on --csrf-secret=UniqueSecret frontend
  24. echo ------------------- "Creamos el servidor virtual"
  25. echo "" >> /etc/apache2/sites-enabled/000-default
  26. echo "" >> /etc/apache2/sites-enabled/000-default
  27. echo "<VirtualHost *:80>" >> /etc/apache2/sites-enabled/000-default
  28. echo "  ServerName $nombre" >> /etc/apache2/sites-enabled/000-default
  29. echo "  DocumentRoot "/var/www/$nombre/web"" >> /etc/apache2/sites-enabled/000-default
  30. echo "  DirectoryIndex index.php" >> /etc/apache2/sites-enabled/000-default
  31. echo "  <Directory "/var/www/$nombre/web">" >> /etc/apache2/sites-enabled/000-default
  32. echo "    AllowOverride All" >> /etc/apache2/sites-enabled/000-default
  33. echo "    Allow from All" >> /etc/apache2/sites-enabled/000-default
  34. echo "  </Directory>" >> /etc/apache2/sites-enabled/000-default
  35. echo "  Alias /sf /var/www/$nombre/lib/vendor/symfony/data/web/sf" >> /etc/apache2/sites-enabled/000-default
  36. echo "  <Directory "/var/www/proyecto/lib/vendor/symfony/data/web/sf">" >> /etc/apache2/sites-enabled/000-default
  37. echo "    AllowOverride All" >> /etc/apache2/sites-enabled/000-default
  38. echo "    Allow from All" >> /etc/apache2/sites-enabled/000-default
  39. echo "  </Directory>" >> /etc/apache2/sites-enabled/000-default
  40. echo "</VirtualHost> " >> /etc/apache2/sites-enabled/000-default
  41. echo ------------------- "Creamos el indicamos donde esta en alias"
  42. echo "127.0.0.1       $nombre" >> /etc/hosts
  43. echo ------------------- "Reiniciamos el Servidor Apache"
  44. sudo /etc/init.d/apache2 restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement