LAMP? Or close to it on OSX (MacOS) Part 2

In my last post I covered installing Nginx, php7-fpm, and MariaDB using homebrew on osX. Ok, lets configure these up so we can access the dev code from localhost. MariaDB config was left untouched, just create the database and user. Nginx config is pretty standard, just make sure you have the php socket set correct. In my case, I set the socket location in my Aptana workspace dir. Remember the previous part when setting up the php70-fpm pool too.

Nginx vhost config:

server {

    listen 8080;

    server_name local.nerdifymylife.com;

    root /Users/shaun/Documents/workspace/www.nerdifymylife.com/;

    location / {

    }

    location /app/                { deny all; }

    location /includes/           { deny all; }

    location /lib/                { deny all; }

    location /media/downloadable/ { deny all; }

    location /pkginfo/            { deny all; }

    location /report/config.xml   { deny all; }

    location /var/                { deny all; }

    location ~ /. {

        deny all;

        access_log off;

        log_not_found off;

    }

        rewrite  / /index.php;

    }

        rewrite ^(.*.php)/ $1 last;

    }

        fastcgi_pass   unix:/Users/shaun/Documents/workspace/www.nerdifymylife.com.socket;

        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

        fastcgi_param  MAGE_RUN_TYPE store;

    }

}

 php70-fpm pool config:

[www.nerdifymylife.com]

listen = /Users/shaun/Documents/workspace/www.nerdifymylife.com.socket

listen.owner = shaun

listen.group = staff

listen.mode = 0600

pm = ondemand

pm.max_children = 2

pm.process_idle_timeout = 60m

request_slowlog_timeout = 0

chdir = /

php_flag[display_errors] = on

php_admin_flag[log_errors] = on

php_admin_value[memory_limit] = 64M

Don’t forget to disable the WP-Cache in wp-config.php and make sure your database creds are good. Do almost everything right and you get …

yay!
yay!