For future reference and benefit as I struggle through this:
Setting up the MAMP environment for Apache
- Don't forget to install XCode before installing MacPorts.
- This MacPorts guide is a good starting point.
- My first struggle was to get the right Apache launching, NOT the built-in Mac version.
- Make sure that the "web sharing" is off in System Preferences. This should be done before installing the apache2 macport.
- To check if you're running the right httpd (Apache daemon process) in terminal:
you want to see /opt/local/apache2/bin/httpdps -ax | grep httpd
you don't want to see /private/etc/apache2 - To get apachectl commands working in terminal, I couldn't get the alias working, I had to add the path to .profile like this:
export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/apache2/bin:$PATH
That includes the paths that MacPorts wrote. - To see if you're going to execute the right apachectl, use this command in terminal:
and you'll see which one is first in line to execute. Very handy little command.which apachectl - I couldn't get my virtual hosts working until I edited /private/etc/hosts to assign them to 127.0.0.1 as described here. It wasn't enough to configure vhosts or my username.conf file and include it in httpd.conf.

No comments:
Post a Comment