Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAMP Conflict With OS X Lion Apache

I'm trying to get a development environment setup in OS X Lion using MAMP. I've historically had MAMP setup using it's defaults, but now I need to have an environment setup with virtualhosts. To do so, I've done the following:

1) Added to the hosts file:

127.0.0.1 test.com
127.0.0.1 my.test.com

2) Edited httpd.conf and httpd-vhosts.conf (both located in the MAMP folder). For httpd.conf, I simply uncommented the Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf line. For httpd-vhosts.conf, I added:

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot "/Users/username/Sites/test.com"
    ServerName test.com
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/Users/username/Sites/my.test.com"
    ServerName my.test.com
</VirtualHost>

3) I changed the ports in MAMP to 80 for Apache and 3306 for MySQL.

4) I turned off personal web sharing in system preferences.

Now, with that set, I experience a redirect when I navigate to "test.com" to test.com:8888". I'm not sure where this is coming from. Then, when I go the "http://localhost", I get the "It Works!" greeting suggesting that the OS X Lion Apache server is running.

Am I missing something with this configuration? Any thoughts?

Thanks so much for your help!

like image 417
tollmanz Avatar asked Nov 04 '11 23:11

tollmanz


1 Answers

I would see what's running on port 8888. lsof can show you what is running on a network port (please note this may also show outbound traffic, so use a discerning eye when checking port 80).

sudo lsof -i :8888

Note that lsof is normally used to 'list open files' in a directory (hence the name). This is a little known use for the utility.

like image 59
taco Avatar answered Nov 15 '22 03:11

taco