title: Setting Up Laravel in Ubuntu / DigitalOcean keywords: servers, laravel, coderstape, coder's tape description: Let's take a look at settting up a server from scratch for Laravel. date: April 1, 2019 tags: servers, laravel permalink: setting-up-laravel-in-ubuntu-digitalocean img: https://coderstape.com/storage/uploads/GZTXUbyGum2xeUZM9qBD5aPv8EKLwG3C8RGcRon4.jpeg author: Victor Gonzalez authorlink: https://github.com/vicgonvt
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
.factory('appSettings', ['$q', function ($q) { | |
var settingService = { | |
debugMode: true, | |
dbName: "gwu_mobile_v1", | |
defaultUserId: "00000000-0000-0000-0000-000000000000", | |
googleGeoCodeApiUrl: 'http://maps.googleapis.com/maps/api/geocode/json?', | |
pageSize: 12, | |
numberOfRecordsPerRowPhone: 3, | |
pageSizeTablet: 15, | |
numberOfRecordsPerRowTablet: 5, |
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
@servers(['web' => '[email protected]']) | |
@setup | |
$root = '~/public_html'; | |
$dir = $root . '/laravel'; | |
$branch = 'master'; | |
$artisan = $dir . '/artisan'; | |
$composer = '~/composer.phar'; | |
$repo = '[email protected]:username/repository.git'; | |
@endsetup |
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
@servers(['web' => '[email protected]']) | |
@setup | |
$root = '~/public_html'; | |
$dir = $root . '/laravel'; | |
$branch = 'master'; | |
$artisan = $dir . '/artisan'; | |
$composer = '~/composer.phar'; | |
$repo = '[email protected]:username/repository.git'; | |
@endsetup |
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
{{-- Define all our servers --}} | |
@servers(['staging' => '', 'production' => '']) | |
@setup | |
{{-- The timezone your servers run in --}} | |
$timezone = 'Europe/Amsterdam'; | |
{{-- The base path where your deployments are sitting --}} | |
$path = '/var/www/site.com/htdocs'; |
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
Random PHP scripts |
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
import { Pipe, PipeTransform } from '@angular/core'; | |
import { parsePhoneNumber, CountryCode } from 'libphonenumber-js/min'; | |
@Pipe({ | |
name: 'phone' | |
}) | |
export class PhonePipe implements PipeTransform { | |
transform(phoneValue: number | string, country: string): any { | |
try { |
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
#!/bin/bash | |
# Update Package Index | |
sudo apt update | |
# Install Apache2, MySQL, PHP | |
sudo apt-get install -y php7.4 php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath | |
# Allow to run Apache on boot up | |
sudo systemctl enable apache2 |
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
alias sshkey="pbcopy < ~/.ssh/id_rsa.pub" |
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
#!/bin/sh | |
set -e | |
vendor/bin/phpunit | |
(git push) || true | |
git checkout production | |
git merge master |
OlderNewer