Symfony2 Nginx Docker Deploy Script

Published on

#!/bin/bash COMPOSER_EXEC=/usr/local/bin/composer PHP_EXEC=/usr/bin/php WWW_DOC_ROOT=/var/www/production STAGING_DOC_ROOT=/var/www/staging die () { echo >&2 “$@” exit 1 } [ “$#” -eq 1 ] || die “Please provide a website name (folder) to deploy.” if echo “$1” | grep ‘staging’; then DOC_ROOT=$STAGING_DOC_ROOT/$1 else DOC_ROOT=$WWW_DOC_ROOT/$1 fi if [ ! -d “$DOC_ROOT” ]; then die “The specified directory ($DOC_ROOT) does not exist.” … Continue reading Symfony2 Nginx Docker Deploy Script

Symphony2 Nginx Deploy Script

Published on

#!/bin/bash COMPOSER_EXEC=/usr/local/bin/composer PHP_EXEC=/usr/bin/php WWW_DOC_ROOT=/var/www/production STAGING_DOC_ROOT=/var/www/staging die () { echo >&2 “$@” exit 1 } [ “$#” -eq 1 ] || die “Please provide a website name (folder) to deploy.” if echo “$1” | grep ‘staging’; then DOC_ROOT=$STAGING_DOC_ROOT/$1 else DOC_ROOT=$WWW_DOC_ROOT/$1 fi if [ ! -d “$DOC_ROOT” ]; then die “The specified directory ($DOC_ROOT) does not exist.” … Continue reading Symphony2 Nginx Deploy Script

Laravel Homestead Creation

Published on

Homestead Includes: Ubuntu 14.04 PHP 5.6 HHVM Nginx MySQL Postgres Node (with Bower, Grunt, and Gulp) Redis Memcached Beanstalkd Laravel Envoy Fabric + HipChat Extension Before you begin. Install Composer. See Installing Composer on Ubuntu. Create a Laravel project. composer create-project laravel/laravel PROJECT_NAME –prefer-dist Download VirtualBox from https://www.virtualbox.org/wiki/Downloads and install. (Make sure you select the … Continue reading Laravel Homestead Creation

Installing Drupal 8 on Ubuntu 14.04 Nginx on AWS

Published on

Create a database. mysql -h localhost -u root -p CREATE DATABASE DRUPAL_DATABASE; CREATE USER DRUPAL_USER@localhost IDENTIFIED BY ‘password’; GRANT ALL PRIVILEGES ON DRUPAL_DATABASE.* TO DRUPAL_USER@localhost; FLUSH PRIVILEGES; exit; Install git and drush. sudo apt-get install git drush -y Create the project. You can do this three ways. With Composer (Recommended) cd /var/www git clone –branch … Continue reading Installing Drupal 8 on Ubuntu 14.04 Nginx on AWS

Symfony2 Nginx Configuration File

Published on

server { listen 80; server_name PROJECT_DOMAIN; root /www/PROJECT_DOMAIN/web; # strip app.php/ prefix if it is present rewrite ^/app_dev\.php/?(.*)$ /$1 permanent; client_max_body_size 50m; location / { index app_dev.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app_dev.php/$1 last; } # pass the PHP scripts to FastCGI server from upstream phpfcgi location ~ ^/(app|app_dev|app_staging|config)\.php(/|$) { fastcgi_pass … Continue reading Symfony2 Nginx Configuration File

Installing Node.js on Ubuntu 14.04

Published on

Refresh your local package index. sudo apt-get update sudo apt-get install nodejs Install npm, which is the Node.js package manager. sudo apt-get install npm Because of a conflict with another package, the executable from the Ubuntu repositories is called nodejs instead of node. References: How to Install Node.js on an Ubuntu 14.04 server | DigitalOcean

Nginx Symfony2 Server Configuration

Published on

server { listen 80; #listen [::]:80 default_server ipv6only=on;root /usr/share/nginx/html; #index index.php index.html index.htm; server_name DOMAIN_NAME; root /var/www/SITE_DIRECTORY/web; # strip app.php/ prefix if it is present rewrite ^/app_dev\.php/?(.*)$ /$1 permanent; client_max_body_size 50m; location / { index app_dev.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app_dev.php/$1 last; } # pass the PHP scripts to FastCGI … Continue reading Nginx Symfony2 Server Configuration

Installing WordPress on Ubuntu 14.04 Nginx on AWS

Published on

Create a database. mysql -h localhost -u root -p CREATE DATABASE WORDPRESS_DATABASE; CREATE USER WORDPRESS_USER@localhost IDENTIFIED BY ‘password’; GRANT ALL PRIVILEGES ON WORDPRESS_DATABASE.* TO WORDPRESS_USER@localhost; FLUSH PRIVILEGES; exit; Download WordPress and copy it to the document root. cd ~ wget http://wordpress.org/latest.tar.gz tar xzvf latest.tar.gz sudo mv wordpress/ /var/www/WORDPRESS_DIRECTORY/ Download some additional PHP modules WordPress will … Continue reading Installing WordPress on Ubuntu 14.04 Nginx on AWS

Nginx Server Configuration on Ubuntu 14.04

Published on

server { listen 80 default_server; listen [::]:80 default_server ipv6only=on;root /var/www/SITE_DIRECTORY/html; index index.php index.html index.htm; # Make site accessible from http://localhost/ server_name DOMAIN_NAME; client_max_body_size 50m; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; # Uncomment to enable naxsi … Continue reading Nginx Server Configuration on Ubuntu 14.04

Nginx Server Configuration for WordPress on Ubuntu 14.04

Published on

server { listen 80 #listen 80 default_server; #listen [::]:80 default_server ipv6only=on; root /var/www/WORDPRESS_DIRECTORY; index index.php index.html index.htm; # Make site accessible from http://localhost/ server_name WORDPRESS_DOMAIN; client_max_body_size 50m; location / { # try_files $uri $uri/ =404; try_files $uri $uri/ /index.php?q=$uri&$args; } error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page … Continue reading Nginx Server Configuration for WordPress on Ubuntu 14.04