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

Linux Environment Variables

Published on

BASH /bin/bash BASH_VERSION 4.3.11(1)-release DISPLAY display that X11 programs should use by default :0 HOME home directory of the current user /home/username IFS Internal Field Separator that is used by the parser for word splitting after expansion LANG default system locale en_US.UTF-8 PATH search path for commands /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-7-oracle/bin:/usr/lib/jvm/java-7-oracle/db/bin:/usr/lib/jvm/java-7-oracle/jre/bin PS1 characters that the shell displays as … Continue reading Linux Environment Variables

Webpage Testing

Published on

Web Loading Test Tool Run a free website speed test from multiple locations around the globe using real browsers (IE and Chrome) and at real consumer connection speeds. Open Site Explorer Searches a site for links. SEOgadget for Excel Performs bulk analysis of inbound links. Microsoft Edge Dev Tools Free tools for testing Microsoft Edge … Continue reading Webpage Testing