Skip to content

Instantly share code, notes, and snippets.

@mroffice
Last active October 21, 2015 15:36
Show Gist options
  • Save mroffice/db62285c46c1e9465fe2 to your computer and use it in GitHub Desktop.
Save mroffice/db62285c46c1e9465fe2 to your computer and use it in GitHub Desktop.
A quick guide to setting up MAMP Pro 3.0 on your local machine (Mac), with clean URLs (without port number) for your local development environment

MAMP Pro 3.0 with Clean URLs for Mac Guide

  1. Download and install MAMP Pro 3

n.b. You need to download and install both MAMP and MAMP Pro

  1. Under General in the preferences click Set default MAMP ports and hit Save

  2. Open Terminal and stop Apache:

$ sudo apachectl stop
  1. Restart MAMP Pro

  2. Still under General click Set ports to 80, 443 & 3306 and hit Save

  3. Open Terminal and restart Apache:

$ sudo apachectl restart
  1. Under Hosts in the preferences, add whatever web apps or static sites you need. For example, I have a Dev directory in my home folder that I use to house all my local development work.
$ ls ~/Dev
website1 website2 website3

In MAMP Pro, I setup a new host for each, the only settings you need to change are the Server Name and the Document root.

After setting each one up and restarting the MAMP server I can then in my web browser can navigate to http://local.website1, for example, without specifying the port number because we are using the default Apache port of 80. I would recommend having a fullstop/period in there somewhere as some browsers and other situations may not recognise it as a URL if you don't.

Usually with the default MAMP (non-pro) settings, you would have to stop the servers, change the document root and then start the servers again. You can of course set up your own vhosts file if you are confident with Apache configurations, this would take you some way to negating the need for MAMP Pro.

Further info

If you want to know what the Apache conifg looks like that MAMP Pro generates for you, it is located here: /Library/Application\ Support/appsolute/MAMP\ Pro/conf/httpd.conf on my install around 50 lines from the end of the file. This is taken from my http.conf file:

<VirtualHost *:80>
	ServerName local.website1
	
	
	DocumentRoot "/Users/euan/Dev/website1"

    <IfModule xsendfile_module>
        XSendFilePath "/Users/euan/Dev/website1"
    </IfModule>

	<Directory "/Users/euan/Dev/website1">
		Options Includes FollowSymLinks  ExecCGI
		AllowOverride All
		Order allow,deny
        Allow from all
		
	</Directory>

    WSGIDaemonProcess local.website1 processes=2 threads=15
WSGIProcessGroup local.website1
    WSGIScriptAlias /website1WsgiApp "/Users/euan/Dev/website1/wsgiapp.py"
    
	
</VirtualHost>

Analytics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment