Last active
December 19, 2016 09:40
-
-
Save verax5/08f72229ccfe6761250ede6678169088 to your computer and use it in GitHub Desktop.
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
| # Script by rootArtisan http://rootartisan.com | |
| # Use at your own risk. This script allow you to quick install laravel and take care of all the permissions. | |
| # Usage instructions http://www.rootartisan.com/blog/installing-laravel-withing-seconds | |
| echo "Enter Laravel Project Name." | |
| read project_name | |
| echo "What post to listen to?" | |
| read port | |
| echo "App will run on localhost:" $post | |
| echo "Script will create project with name" $project_name | |
| mkdir $project_name | |
| cd $project_name | |
| if [ $PWD = "/var/www/html/$project_name" ]; then | |
| git clone https://github.com/laravel/laravel.git . | |
| read -p "Press enter to continue.." | |
| echo "Downloading Composer.." | |
| php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
| php -r "if (hash_file('SHA384', 'composer-setup.php') === 'aa96f26c2b67226a324c27919f1eb05f21c248b987e6195cad9690d5c1ff713d53020a02ac8c217dbf90a7eacc9d141d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
| php composer-setup.php | |
| php -r "unlink('composer-setup.php');" | |
| composer install | |
| echo "Renaming .env.example file to .env" | |
| cp ./.env.example ./.env | |
| echo "Assigning 755 perms recursively" | |
| sudo chmod -R 755 . | |
| echo "Assigning current user as project folder owner" | |
| sudo chown -R $(whoami) . | |
| echo "Changing group to www-data. Password required" | |
| sudo chgrp -R www-data ./storage ./bootstrap/cache | |
| echo "Assigning write permissions to storage and bootstrap/cache folder" | |
| chmod -R ug+rw ./bootstrap/cache/ ./storage | |
| echo "Generating app key using artisan.." | |
| php artisan key:generate | |
| echo "Starting PHP server" | |
| php artisan serve --port=$port | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment