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
# PHP | |
# Test and package your PHP project. | |
# Add steps that run tests, save build artifacts, deploy, and more: | |
# https://docs.microsoft.com/azure/devops/pipelines/languages/php | |
pool: | |
vmImage: 'Ubuntu 16.04' | |
variables: | |
phpVersion: 7.2 |
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
# name this file as "startup.sh" and call it from "startup command" as "/home/startup.sh" | |
# check out my YouTube video "https://youtu.be/-PGhVFsOnGA" | |
cp /home/default /etc/nginx/sites-enabled/default | |
cp /home/php.ini /usr/local/etc/php/conf.d/php.ini | |
# install support for webp file conversion | |
apt-get update --allow-releaseinfo-change && apt-get install -y libfreetype6-dev \ | |
libjpeg62-turbo-dev \ |
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 |
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/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
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
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
{{-- 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
@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 |
NewerOlder