:::: MENU ::::
Browsing posts in: Mac

5 Reasons why Pressmatic is the Ultimate MAMP/Vagrant/DesktopServer Replacement Tool

I’ve had the privilege of being a part of an early testing group for the brand new Mac (and soon for Windows) application called Pressmatic.  While Pressmatic has only been around a short while, it instantly competes with all the other players in the game.  There are already a few in-depth reviews available, so I just want to go over some killer features that will hopefully convince you to give Pressmatic a chance.  Let’s begin.

1. ngrok

What in the world is ngrok? That was my first thought too.  ngrok is a tunneler that allows you to share your local development sites with clients, or friends without the need to deploy.  Ever wanted to check out a local site on your smartphone, only to spend the next couple hours trying to figure out a solution locally? (See my squidman post) And then you usually just deploy to a live server anyway in order to test. ngrok changes that.  It’s super simple to use with Pressmatic.  All you need to do is enable the add-on:

ngrok-enable

And then in the site settings, under Utilites, enable the tunnel:

ngrok-enable

Once the tunnel is enabled, you can just click on the link to view the site, or type it into your smartphone’s browser and voila! You can view your local site from anywhere.

ngrok-enabled

2. MailCatcher

4 years ago, I wrote a post on how to send mail from Max OS X using Postfix.  That was 4 years ago (light years in tech terms) and yet not much has changed.  All I usually need is to make sure the site is sending emails properly, before deploying to production.  Enter MailCatcher.  MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface.  While this does not allow outbound emails, it does create a simpler solution for my needs than Postfix and all that mess.

To use MailCatcher, simply navigate to the site settings > utilities tab and click on “Open Mailcatcher”.

mailcatcher-launch

Once opened, you will be able to see all emails sent through your Pressmatic WordPress install.

mailcatcher-launched

3. Hot-Swapping PHP Versions

So, in a perfect world, everybody would be using the latest version of PHP, and all their code would be compatible.  But we don’t live in a perfect world and with WordPress officially supporting PHP 5.2.4 still, we have to write code that works for everyone.  With that being said, Pressmatic makes that super simple by allowing you to change out PHP versions on the fly.  After your site is created, just go to the main site settings page and choose which PHP version you want from the list (I hear more PHP versions will be available soon!):

php-versions

Once you’ve made your change, you can confirm that the correct PHP version is working by pressing on information icon right next to the versions drop-down.  That will open up a phpinfo() page.

php-info

4. One-Click MySQL Admin for Sequel Pro or Adminer

Do you ever find yourself scratching your head trying to remember what the login info is for your MySQL database?  Well with Pressmatic, not only do you get all that information readily available in the Database tab, you can also use the one-click buttons to login to the database using Sequel Pro or the built in Adminer (who uses phpmyadmin any more anyway?).

mysql

5. Simple SSH

For those of you who are advanced developers, this one is for you.  Since Pressmatic is built using docker containers, you have to run any scripts or commands you want inside that virtual machine.  For SSH access, simply right click on the site and select “Open Site SSH”:

ssh-open

That will open up terminal and log you in directly to the virtual machine as the root user.  Simple (and way faster than vagrant ssh).

ssh-terminal

You can even set your default SSH client in the main settings:

terminal-app

As you probably have figured out by now, the theme of this post is: Pressmatic is simple. Enough talk, do yourself a favor and try it out today!

pressmatic-raster


Configuring Postfix to Send Mail from Mac OS X Mountain Lion

I recently upgraded my Mac to use Apple’s latest operating system, Mountain Lion, and in so doing, wiped out my postfix configuration that I had previously set up with advice from many different blogs. Postfix is essential for my line of business where I send many emails through MAMP on my local machine.

After hours of updating settings and getting nowhere, I stumbled across a blog post that set me in the right direction.

Rather than do this process again when Apple releases a new upgrade, I decided to document the steps I took to get this working (more for a reference for myself, but also to help those with the same issues).

I personally use Google Apps, so this process is for those also trying to authenticate through Gmail.  This process is much simpler if you don’t need SSL encryption when sending mail.  I use TextMate as a text editor, so the following command line options use the ‘mate’ command.  Alternatively, you can use ‘vi’, ‘vim’ or ‘nano’ depending on what you are familiar with.

Step 1

First, we need to create a Simple Authentication and Security Layer (SASL) password file.  To do this, open up Terminal and enter in the following command:

[cc]sudo mate /etc/postfix/sasl_passwd[/cc]

You will be required to enter your root password to edit the file. Enter in the following information, replacing <username@domain.com> with your google apps username and domain or your gmail account, and <password> with your password:

Save and exit.

Step 2

Next, we need to create a postfix lookup for our new SASL password file.  To do this, type the following command in the Terminal:

[cc]sudo postmap /etc/postfix/sasl_passwd[/cc]

Step 3

Then we need to configure Postfix’s main.cf file which has all the configuration information for Postfix.  I would recommend backing up this file in case anything happens.  The first line of the following commands does just that, by creating a copy before editing it:

[cc]sudo cp /etc/postfix/main.cf /etc/postfix/main.cf.orig
sudo mate /etc/postfix/main.cf[/cc]

Most of the information here is commented out.  You just need to scroll down to the bottom and paste in the following lines:

[cc]# Minimum Postfix-specific configurations.
mydomain_fallback = localhost
mail_owner = _postfix
setgid_group = _postdrop
relayhost=smtp.gmail.com:587

# Enable SASL authentication in the Postfix SMTP client.
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options=

# Enable Transport Layer Security (TLS), i.e. SSL.
smtp_use_tls=yes
smtp_tls_security_level=encrypt
tls_random_source=dev:/dev/urandom[/cc]

Save and exit.

Step 4

At this point, we just need to start up Postfix with our changes.  Use the following command:

[cc]sudo postfix start[/cc]

If you entered in any information incorrectly in the main.cf file, this may throw errors.  Fix the errors and then reload Postfix:

[cc]sudo postfix reload[/cc]

Step 5

You can test this configuration by sending a test email from Terminal:

[cc]date | mail -s test youremailaddress@yourdomain.com[/cc]

If all goes well, you should receive an email to your inbox.

Step 6

Once you have everything working, you can set Postfix to start on boot by adding a key to /System/Library/ LaunchDaemons/org.postfix.master.plist file.

The key to add is:

[cc lang=”xml”]
RunAtLoad
[/cc]

The updated file looks like this (text version below):

[cc lang=”xml”]

Label
org.postfix.master
Program
/usr/libexec/postfix/master
ProgramArguments

master
-e
60

QueueDirectories

/var/spool/postfix/maildrop

AbandonProcessGroup
OnDemand
RunAtLoad
[/cc]

And that’s it! You should now be able to send mail using Mac OS X and Postfix from a PHP install. I am not an expert at this by any means, but feel free to leave a comment below letting me know if this helped you or if you have any issues with it. I would be glad to help in any way I can!