Skip to content

Instantly share code, notes, and snippets.

@meganlkm
Last active May 19, 2019 23:14
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save meganlkm/74dba6c4350ed58bf7bb to your computer and use it in GitHub Desktop.
Save meganlkm/74dba6c4350ed58bf7bb to your computer and use it in GitHub Desktop.
setup a laravel 4.2 project to deploy to a shared hosting provider
#!/bin/bash
myproject='myproject'
mywwwdir='public_html'
# initialize project
composer create-project laravel/laravel $myproject 4.2.*
cd $myproject
perl -pi -e "s|/public|/../${mywwwdir}|" bootstrap/paths.php
perl -pi -e "s|/bootstrap|/${myproject}/bootstrap|" public/index.php
# rename the public folder to match hosting providers web root
mv public $mywwwdir
# create a directory for everything except the public directory
mkdir $myproject
# move stuff to app dir
mv {app,bootstrap,vendor,artisan,composer.*,*.php,*.xml} $myproject
@AlexVentura
Copy link

From which path do i have to run this script? Where do I have to put the script in my hard disk? So that I could run it from terminal. I'm working in Mac OS X.
I mean: /Users/Lexynux/Documents/laravel_app/
or from anywhere else?

@meganlkm
Copy link
Author

meganlkm commented Apr 6, 2015

You can run it from anywhere using the terminal. Depends on where you want your projects. You will end up with 2 subdirectories within the directory it is run. If you ran it from /Users/Lexynux/Documents/laravel_app/laravel_shared_hosting_project.sh

You would end up with these directories:

/Users/Lexynux/Documents/laravel_app/public_html
/Users/Lexynux/Documents/laravel_app/myproject

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment