Ok, well here’s what I’ve got/tried, and maybe someone sees what I’m missing/doing wrong. (Sorry a bit long here)
Attempt 1: On this one I tried using the ports and settings that worked before with one site in the MAMP preferences and working based off of that.
On this try all of the source files for Site #1 were contained in /Applications/MAMP/htdocs/site-1
Files for Site #2 were in /Applications/MAMP/htdocs/site-2
I have a database set up for each site in phpMyAdmin.
MAMP settings: (these are what MAMP is set to when I click “Reset MAMP ports”)
Apache Port: 8888
MySQL Port: 8889
Apache Document Root : /Applications/MAMP/htdocs
Site #1 WP_Config Settings:
/** The name of the database for WordPress */
define('DB_NAME', 'site-1');
/** MySQL database username */
define('DB_USER', 'user);
/** MySQL database password */
define('DB_PASSWORD', 'password');
/** MySQL hostname */
define('DB_HOST', 'localhost');
Site #2 WP_Config Settings:
/** The name of the database for WordPress */
define('DB_NAME', 'site-2');
/** MySQL database username */
define('DB_USER', 'user);
/** MySQL database password */
define('DB_PASSWORD', 'password');
/** MySQL hostname */
define('DB_HOST', 'localhost');
This is what I added in the host file:
127.0.0.1 localhost
127.0.0.1 localhost site-1.dev
127.0.0.1 localhost site-2.dev
And this is what I put into the httpd.conf file
NameVirtualHost *
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs/site-1"
ServerName site-1.dev
<Directory "/Applications/MAMP/htdocs/site-1">
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs/site-2"
ServerName site-2.dev
<Directory "/Applications/MAMP/htdocs/site-2">
AllowOverride All
</Directory>
</VirtualHost>
Then I rebooted…
No go. Browsers are unable to find the servers.
Then, after copying the source files into Users/user_name/Sites I tried again with the following settings:
MAMP settings: (these are what MAMP is set to when I click “Set to default Apache and MySQL ports”)
Apache Port: 80
MySQL Port: 3306
Apache Document Root : /Applications/MAMP/htdocs
WP_Config Settings: Nothing changed here.
host file: Nothing changed here.
httpd.conf file:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/user_name/Sites/site-1"
ServerName site-1.dev
<Directory "/Users/user_name/Sites/site-1">
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/user_name/Sites/site-2"
ServerName site-2.dev
<Directory "/Users/user_name/Sites/site-2">
AllowOverride All
</Directory>
</VirtualHost>
Rebooted and… still can’t find the servers.
Then I just started throwing things at the wall seeing if anything stuck. Like using the MAMP ports from the first attempt with the httpd.conf settings from the second and different things like that, but no luck still.
I’ve been going at this awhile now and seem to be making no progress.
Anyone see my mistake?