Adding Password Authentication on Apache with Ubuntu 14.04

Published on

Update packages and make sure apache2-utils is installed. sudo apt-get update sudo apt-get install apache2 apache2-utils Add the user to the password file. (Only use the -c parameter the first time to create the file.) sudo htpasswd -c /etc/apache2/.htpasswd USERNAME Configure the access control within the virtual host definition /etc/apache2/sites-available/HOST_CONF_FILE. Add the lines in red. … Continue reading Adding Password Authentication on Apache with Ubuntu 14.04

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 setfacl Commands for Nginx

Published on

Since Nginx does not support chmod +a you will need to run setfacl to give the app/cache, app/logs and other directories the proper permissions. sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX app/cache app/logs web/sitemaps sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs web/sitemaps Reference: See the Setting up Permissions section in the Installing and … Continue reading Symfony2 setfacl Commands for Nginx

Symfony2 .gitignore Sample File

Published on

/web/bundles/ /app/bootstrap.php.cache /app/cache/* /app/config/parameters.yml /app/config/parameters_dev.yml /app/logs/* !app/cache/.gitkeep !app/logs/.gitkeep /build/ /vendor/ /bin/ /.idea/ /web/css/ /web/js/ /web/apc.php /app/spool/*

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

Large MySQL Data Imports

Published on

Disable MySQL indexes MySQL can import many rows with a single disk write. It makes the import go many times faster and minimizes the impact on other customers. Database files created with phpMyAdmin or mysqldump already contain commands to disable the indexes. To disable MySQL indexes: Add these commands before the import starts: ALTER TABLE … Continue reading Large MySQL Data Imports

Using scp to Copy to/from a Remote Server with SSH

Published on

scp stands for secure cp (copy), which means that you can copy files across an ssh connection that will be encrypted, and therefore secured. With it you can copy files from or to a remote server. You can even copy files from one remote server to another remote server. Usage scp [[user@]from-host:]source-file [[user@]to-host:][destination-file] Parameters: from-host … Continue reading Using scp to Copy to/from a Remote Server with SSH

vi Cheat Sheet

Published on

Modes vi has two modes insertion mode and command mode. The editor begins in command mode, where the cursor movement and text deletion and pasting occur. Insertion mode begins upon entering an insertion or change command. [ESC] returns the editor to command mode (where you can quit, for example by typing :q!). Most commands execute … Continue reading vi Cheat Sheet