LAMP server setup on Linode Ubuntu 14.04.1 LTS
-
Update system
- apt-get update
- apt-get upgrade
- Check Unattended upgrades package
| <Macro VHost $name $domain $db_host $db_name $db_user $db_pw> | |
| <VirtualHost *:80> | |
| # The ServerName directive sets the request scheme, hostname and port that | |
| # the server uses to identify itself. This is used when creating | |
| # redirection URLs. In the context of virtual hosts, the ServerName | |
| # specifies what hostname must appear in the request's Host: header to | |
| # match this virtual host. For the default virtual host (this file) this | |
| # value is not decisive as it is used as a last resort host regardless. | |
| # However, you must set it for any further virtual host explicitly. |
| /** | |
| * Remove array key prefixes | |
| * | |
| */ | |
| function remove_prefix($array, $prefix) | |
| { | |
| return array_combine( | |
| array_map( | |
| function($k,$prefix){ | |
| return preg_replace("/^$prefix/", '', $k); |
| <?php | |
| namespace App\Http\Controllers; | |
| use Illuminate\Http\Request; | |
| use App\Http\Requests; | |
| use Carbon\Carbon; |
LAMP server setup on Linode Ubuntu 14.04.1 LTS
Update system
https://wiki.apache.org/httpd/PHP-FPM
Steps
add-apt-repository multiverseapt-get update| <?php | |
| namespace App\Models; | |
| class Agreement extends BaseModel | |
| { | |
| const CREATED_AT = 'CreatedOn'; | |
| const UPDATED_AT = 'LastUpdateOn'; | |
| /** |
| @servers(['web' => $user.'@'.$host,'localhost' => '127.0.0.1']) | |
| @setup | |
| // Sanity checks | |
| if (empty($host)) { | |
| exit('ERROR: $host var empty or not defined'); | |
| } | |
| if (empty($user)) { | |
| exit('ERROR: $user var empty or not defined'); | |
| } |
| # Bitbucket Pipelines Configuration file | |
| # https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html | |
| # options: | |
| # size: 2x | |
| # max-time: 60 | |
| pipelines: | |
| default: | |
| - step: | |
| script: | |
| - echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'." |
| Route::get('/route-list', function () { | |
| Artisan::call('route:list'); | |
| return '<pre>'.Artisan::output(); | |
| }); |
| <?php | |
| namespace App; | |
| use Geocoder\Laravel\ProviderAndDumperAggregator as G; | |
| class Geocoder | |
| { | |
| protected $geocoder; |