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
server { | |
listen 80; | |
server_name cakephp.org www.cakephp.org; | |
# root directive should be global | |
root /var/www/cakephp.org/webroot/; | |
index index.php; | |
access_log /var/www/cakephp.org/logs/nginx_access.log; | |
error_log /var/www/cakephp.org/logs/nginx_error.log; |
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
<VirtualHost *:80> | |
ServerAdmin support@your_domain.com | |
ServerName subdomain.your_domain.com | |
ServerAlias www.subdomain.your_domain.com | |
DocumentRoot /var/www/subdomain.your_domain.com | |
# your folder /var/www/subdomain.your_domain.com | |
<Directory /var/www/subdomain.your_domain.com> | |
Options Indexes FollowSymLinks MultiViews | |
DirectoryIndex index.php index.html | |
AllowOverride All |
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^old_domain.com [NC,OR] | |
RewriteCond %{HTTP_HOST} ^www.old_domain.com [NC] | |
RewriteRule ^(.*)$ http://new_domain.net/$1 [L,R=301,NC] | |
RewriteRule ^$ webroot/ [L] | |
RewriteRule (.*) webroot/$1 [L] | |
</IfModule> |
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
<ifModule mod_gzip.c> | |
mod_gzip_on Yes | |
mod_gzip_dechunk Yes | |
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ | |
mod_gzip_item_include handler ^cgi-script$ | |
mod_gzip_item_include mime ^text/.* | |
mod_gzip_item_include mime ^application/x-javascript.* | |
mod_gzip_item_exclude mime ^image/.* | |
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* | |
</ifModule> |
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
(setup ssl self-cert first https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04) | |
1) Install the Server Dependencies: | |
apt-get update | |
apt-get install git | |
2) Download the Let’s Encrypt Client: | |
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt | |
3) Set Up the SSL Certificate: |
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 | |
namespace App\Auth; | |
use Cake\Auth\BaseAuthenticate; | |
use Cake\Network\Request; | |
use Cake\Network\Response; | |
class LdapAuthenticate extends BaseAuthenticate | |
{ |
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
Go to http://dev.mysql.com/downloads/repo/apt/ then download the .deb file to your server | |
Install downloaded package: sudo dpkg -i package_name | |
Update Apt: sudo apt-get update | |
Install mysql: sudo apt-get install mysql-server | |
After install, going to secure it: | |
sudo mysql_secure_installation |
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
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt-get install php5.6 | |
you can install more php5.6 module | |
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-intl php5.6-intl php5.6-mbstring php-apcu php-uuid php5.6-cgi php5.6-cli php5.6-gd php5.6-ldap php5.6-sqlite3 php-uploadprogress |
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 | |
## Author: Anh Tuan Nguyen ([email protected]) | |
## Created: 08/08/2016 | |
# update, upgrade to latest source | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
# GOOGLE PAGE SPEED | |
sudo apt-get install -y build-essential zlib1g-dev libpcre3 libpcre3-dev unzip |
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 | |
## Author: Anh Tuan Nguyen ([email protected]) | |
## Created: 08/08/2016 | |
## Install nginx, openssl, php7.0, mysql 5.7, phpmyadmin, cakephp 3.x | |
# update, upgrade to latest source | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
# GOOGLE PAGE SPEED |