Nginx as a Reverse Proxy

/etc/nginx/proxy.conf example:

proxy_redirect          off;
proxy_set_header        Host            $host;
proxy_set_header        X-Real-IP       $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size    10m;
client_body_buffer_size 128k;
proxy_connect_timeout   90;
proxy_send_timeout      90;
proxy_read_timeout      90;
proxy_buffers           32 4k;

Then when I have a site that requires being passed to a proxy, the location looks like this:

location / {
                include         /etc/nginx/proxy.conf;

CiviCRM on WPEngine

CiviCRM: 4.7.7
Wordpress: 4.5.2
Host: WPEngine

After a normal and successful install, I ran into an issue where core assets (like jquery) were 404ing because of url paths. The solution ended up being adding this to the top of civicrm.settings.php (found in /wp-content/uploads/civicrm).

global $civicrm_setting;
$civicrm_setting['Directory Preferences']['customTemplateDir'] = '/nas/content/live/mysite/wp-content/civicrm/templates/';
$civicrm_setting['Directory Preferences']['customPHPPathDir'] = '/nas/content/live/mysite/wp-content/civicrm/php/';
$civicrm_setting['Directory Preferences']['extensionsDir'] = '/nas/content/live/mysite/wp-content/civicrm/extensions/';
$civicrm_setting['URL Preferences']['extensionsURL'] = '';
$civicrm_setting['URL Preferences']['imageUploadURL'] = '';
$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = '';

The source of this answer can be found here

Receiving Emails in Redmine with GMail on Dreamhost

Setting up Redmine to create issues from emails, the way I did it, mostly involved getting a cron job running to rake redmine:email:receive_imap. The basic steps are:

    1. Create a GMail Account
    2. Add a script to run at intervals (I am running it every 30 – */30 * * * *

I created shell script in it’s own file that reads like this:

/home/xxxx/.gems/bin/rake -f ~/xxxx/Rakefile redmine:email:receive_imap RAILS_ENV="production" ssl=SSL port=993 password=xxxx project=xxx tracker=bug priority=Immediate allow_override=project,tracker,priority --trace

One thing that hung me up was that for ruby gems to be in the path in the cron execution context, you’re crontab needs to look like this:

*/30 * * * * . /etc/profile && /path/to/

Without the “. /etc profile” part, your script won’t know what the hell a “rake” is.

I can’t get the “assigned_to” default to work, but I’m happy with it running properly for the time being.

SVN Repo Admin – Commands to Remember

Things I need to remember about SVN on my server that I use less and less:

Make A Repo:

sudo mkdir /var/svn/
sudo svnadmin create /var/svn/
sudo chown -R www-data:www-data /var/svn/
sudo service apache2 restart

Add a user

sudo htpasswd2 -m /etc/apache2/dav_svn.passwd