Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo -n "Introduce el nombre del Proyecto: "
- read nombre
- echo -n "Introduce la version de symfony a descargar (ej:1.4.11): "
- read version
- echo ------------------- "Creamos la ubicacion en /var/www y otorgamos Permisos"
- mkdir -p /var/www/$nombre
- cd /var/www/$nombre
- chmod -R 777 /var/www/$nombre
- echo ------------------- "Preparamos y Descargamos Symfony"
- mkdir -p lib/vendor
- cd lib/vendor
- wget http://www.symfony-project.org/get/symfony-$version.tgz
- tar zxpf symfony-$version.tgz
- mv symfony-$version symfony
- rm symfony-$version.tgz
- cd /var/www/$nombre
- echo ------------------- "Generamos el proyecto Symfony"
- php lib/vendor/symfony/data/bin/symfony generate:project $nombre --orm=Doctrine
- echo ------------------- "Agregamos la priemra aplicación"
- echo -n "Introduce el nombre de la primera aplicación: "
- read app
- php symfony generate:app --escaping-strategy=on --csrf-secret=UniqueSecret frontend
- echo ------------------- "Creamos el servidor virtual"
- 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 $nombre" >> /etc/apache2/sites-enabled/000-default
- echo " DocumentRoot "/var/www/$nombre/web"" >> /etc/apache2/sites-enabled/000-default
- echo " DirectoryIndex index.php" >> /etc/apache2/sites-enabled/000-default
- echo " <Directory "/var/www/$nombre/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 " Alias /sf /var/www/$nombre/lib/vendor/symfony/data/web/sf" >> /etc/apache2/sites-enabled/000-default
- echo " <Directory "/var/www/proyecto/lib/vendor/symfony/data/web/sf">" >> /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 ------------------- "Creamos el indicamos donde esta en alias"
- echo "127.0.0.1 $nombre" >> /etc/hosts
- echo ------------------- "Reiniciamos el Servidor Apache"
- sudo /etc/init.d/apache2 restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement