Skip to content

Instantly share code, notes, and snippets.

View EOM's full-sized avatar

Sergio N. EOM

View GitHub Profile

Production LAMP server setup on Ubuntu 16.04

Introduction

Summary of the steps to get a Ubuntu 16.04 production server running with LAMP, multiple virtual hosts and Let's Encrypt SSL.

Initial setup

<html>
<head>
<title>Non-alcoholic Pina Colada</title>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Recipe",
"name": "Non-alcoholic Pina Colada",
"image": [
"https://example.com/photos/1x1/photo.jpg",
@ogrrd
ogrrd / Cake Composer.md
Last active May 9, 2020 03:30
Install Cake 2.x with Composer

Install CakePHP 2.x with Composer

Remove the main CakePHP lib directory

$ cd /path/to/your/website
$ rm -Rf ./lib

Add the following composer.json file

@cbednarski
cbednarski / nginx-error.conf
Created March 13, 2013 04:52
Example nginx.conf for custom error pages
server {
listen 80;
server_name HOSTNAME;
root /opt/PATH/;
index index.html;
rewrite ^/$ /en/PATH/ redirect;
@THEtheChad
THEtheChad / .htaccess
Created January 13, 2012 23:26
Access-Control-Allow-Origin for Subdomains
SetEnvIf Origin "^(.*\.example\.com)$" ORIGIN_SUB_DOMAIN=$1
Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN
@jult
jult / install_ispcfg_for_deb9.sh
Last active August 14, 2018 14:51 — forked from jniltinho/install_ispconfig_nginx_debian.sh
ISPconfig 3.x install with NGINX 1.13.x + PHP 7.1 on Debian 9 x64 (Stretch) server
#!/bin/bash
## Install ISPConfig + NGINX + PHP 7.1 on Debian 9 x64 (Stretch)
## Filesystem ext4
## Run as root
## Based on: https://www.howtoforge.com/tutorial/perfect-server-debian-jessie-nginx-bind-dovecot-ispconfig-3.1/
## and: https://www.howtoforge.com/tutorial/perfect-server-debian-9-stretch-apache-bind-dovecot-ispconfig-3-1/
## ! For Postfix config see https://www.howtoforge.com/tutorial/perfect-server-debian-9-stretch-apache-bind-dovecot-ispconfig-3-1/
# Check if user has root privileges
@punkdata
punkdata / cloud-config.yaml
Last active August 8, 2018 06:21
CoreOS cloud-config.yaml Example
#cloud-config
hostname: <your hostname>
ssh_authorized_keys:
- ssh-rsa < your Public SSH key AAAAB3NzaC1... >
coreos:
etcd:
addr: $private_ipv4:4001
@EOM
EOM / CustomPaginationForJOIN-in-CakePHP
Last active August 29, 2015 14:21
Personalizar los datos del paginador de CakePHP con la union de datos por medio de JOINS muy simple de implementar
<?php
/**
* Application level Controller
*/
App::uses('Controller', 'Controller');
// Controller Ejemplo
class AppController extends Controller {
public function index(){