It's 2017 and there's still no updated, easy guide to setting up a Laravel 5.4 app on WebFaction. So I decided to write one.
It's actually pretty easy.
SSH into your WebFaction server.
- In your home directory (
/home/username/), create another directory called
apps. It can be anything, but it's going to hold our Laravel (or other) apps, so I'm calling it that.
- Clone your repo into
/home/username/apps/, so an example app becomes
alias php=php56to prevent it from running PHP 5.2 by default.
- In your
appsdirectory, follow the instructions on the Composer installer website to get
composer.phar. Set up an alias for this too:
alias composer=php ~/apps/composer.phar
composer installin the
laraveltestdirectory and set things up.
Log into your WebFaction dashboard.
- Set up a new application of category "Symbolic link".
- Set the app type to "Symbolic link to static/cgi/php56 app". You can use PHP 7 if you have a newer server, but remember to make relevant changes in the previous steps too.
- Put the path of the public directory of your Laravel app as follows:
- Now simply create an entry under domains and websites (a website = a domain + an application) and open the URL in the browser.
If everything works out, you can automate step one so it checks out the latest and installs it after you push to master.
This guide was based upon an older one, which has been the guide I've always referred to: https://frontiernxt.com/deploying-a-laravel-app-to-webfaction-using-bitbucket