Yeah, the port number is an issue. 🙂 It can’t figure out how to form the blog urls off it.
You can put in a fake domain in your hosts file & use that, or just plain localhost (well, if it was on a standard port…).
I’ve got a ton of fake local doamins I use for testing and made up my own extension. 😉 testing.loc, localhost.localdomain – anything, really.
I’m not sure where the hosts file is in Mamp though.
I use a host file on my computer to block some sites. Can I use this file to make a fake domain? How would I do that? I don’t know much about Mamp. I will do some research. I did a search of the Mamp folder and these are the results:
I don’t think these files have anything to do with the problem I have.
mamp local sites have a default address (without use of Headdress) of:
Does this mean that the default address wouldn’t work also?
I use a host file on my computer to block some sites. Can I use this file to make a fake domain? How would I do that?
Yeah, that’s the file. 🙂 Open it up, add your local IP address (127.0.0.1) and then any fake domain you like.
Thank you andrea_r for showing me the right direction to search for. I’m no longer using Headdress for organizing my virtual hosts (multiple local sites) Now I do it by editing the host file of my computer and the httpd.conf file of Mamp. First I had to reinstall Mamp to get rid of all the files Headdress had changed. then I used textwrangler (Mac text editor) to put my wordpress local domains in the host file like so:
127.0.0.1 localhost mycoolsite.dev anothercoolsite.dev. Text Wrangler will edit the /etc/hosts file with admin privileges. Just use the “Open File by Name” under the File menu.
After that I put these lines at the bottom of the httpd.conf file (located at Applications/MAMP/conf/apache/httpd.conf)
NameVirtualHost * <VirtualHost *> DocumentRoot "/Applications/MAMP/htdocs" ServerName localhost </VirtualHost> <VirtualHost *> DocumentRoot "/Users/[Your User Name]/Sites/mycoolsite" ServerName mycoolsite.dev </VirtualHost> <VirtualHost *> DocumentRoot "/Users/[Your User Name]/Sites/anothercoolsite" ServerName anothercoolsite.dev </VirtualHost>
Substitute “[Your User Name]” with your Username.
After that you have to reboot or type “lookupd -flushcache” in the Terminal to make these changes take effect (flush DNS cache).
Make sure you set Mamps ports to the default Apache and MySQL ports. Click the “Set to default Apache and MySQL ports” in Preferences/Ports.
Now I have multiple local sites with clean urls
(http://mycoolsite.dev/ and http://anothercoolsite.dev/)without a port number and use the Network feature of WordPress.
One final update. Permalinks other than the default structure were not working. I found the solution here
So here is the final code for a virtual host.
<VirtualHost *> DocumentRoot "/Users/[Your User Name]/Sites/mycoolsite" ServerName mycoolsite.dev Alias /mycoolsite.dev "/Users/[Your User Name]/Sites/mycoolsite" <Directory "/Users/[Your User Name]/Sites/mycoolsite"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
And make sure that the following line is uncommented (ie remove the # before it):
LoadModule rewrite_module modules/mod_rewrite.so
Just noting that
is the relevant bit. This forces your htaccess file into being read and not ignored.
I’m having the same problems. Could you tell me what the host file of your computer is? Is it the htaccess file?
The htaccess file and the hosts file are two different files. 😉 Those are their names.
No idea where it is on a Windows computer.
location host file Windows 7/Vista/XP = C:\WINDOWS\SYSTEM32\DRIVERS\ETC
To access this file in Mac Finder: Go > Go To Folder, and type in /etc. A normal finder window will appear. In this window you find the file called “hosts”
Thanks for starting and resolving this thread guys! I also use MAMP and was at a complete loss at how to get it working with WP 3.0 Multi-Site.
Just to add to the instructions, my ports are Apache 80 and MySQL 3000 (not the defaults) and in order to get it working properly I formatted my httpd.conf section like so:
<VirtualHost *:80> ALL THE OTHER BITS IN HERE (I left out the Alias line as well as all the lines inside the Directory tag except for the AllowOverride All, which is the only relevant line. </VirtualHost>
This is now functioning for me so far…but I need to test further.
Thanks again 🙂
Ok I made some changes based on JsonB123 and this is my final code
Put this above all your virtual hosts
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "/Applications/MAMP/htdocs" ServerName localhost </VirtualHost>
And for every site (virtual host) I use this:
<VirtualHost *:80> DocumentRoot "/Users/[Your User Name]/Sites/mycoolsite" ServerName mycoolsite.dev <Directory "/Users/[Your User Name]/Sites/mycoolsite"> AllowOverride All </Directory> </VirtualHost>
Tested it and it works.
A slight change in direction. Been using MAMP for several years just fine, but could not get the above to work. Decided to see if I would have better luck with Snow Leopard’s own Apache 2 install recognizing it’s a bit more cumbersome to get going. Well I’ve got WP Network Sites functioning, but WP files are not being served to the subdirectory sites. I just get directory listings when at the the sub-site/subdirectory roots. If I append a specific wp-admin file path to the sub-site’s url I get a 404 error.
My .htaccess file is per the code generated by the WP network install script. WP is installed in Snow Leopard’s User Sites root folder …/user/Sites/ with the root url being http://10.0.1.5/~user/ I’m not using any virtual hosts at the moment so the urls are straight out of Snow Leopard’s box. The urls all seem to be appropriately represented in the config.php, .htaccess and within WP sub-site configurations.
Is there something specific I might try with the PHP’s httpd.conf and httpd-vhost.conf settings? I have tried the following in the vhost.conf:
<Directory "/Users/username/Sites/"> Options Indexes MultiViews AllowOverride All Allow from all </Directory>
But this just gets the the “Forbidden” permissions’ error for everything including the main site.
Assign it a fake domain in your hosts file. Won’t work on an IP address.
Do you mean assign the fake to the main site root as in mainsite.dev. When I do that I get the “Forbidden” permissions error?
<VirtualHost *:80> <Directory /Users/username/Sites> AllowOverride All </Directory> DocumentRoot /Users/username/Sites ServerName mainsite.dev </VirtualHost>
FYI, I don’t get the error if I assign a fake to a WP subsite/subdirectory. In fact it seems every time I try to assign a fake domain to a WP install directory I get the “Forbidden” error.
Ok everything has been reinstalled under the fake domain mainsite.dev. Thus we have mainsiste.dev/subsite1, mainsite.dev/subsite2, etc. This is how the urls appear, but the subsites have the same problem as before, WP pages are not being served to them. I just get directory listings for subsites.
Here’s the user.conf code
<Directory "/Users/username/Sites/"> Options Indexes MultiViews AllowOverride All Order allow,deny Allow from all </Directory>
Here’s the vhosts.conf code
NameVirtualHost *:80 <VirtualHost *:80> <Directory /Users/username/Sites> AllowOverride All Options +FollowSymLinks </Directory> DocumentRoot /Users/olmini/Sites ServerName mainsite.dev </VirtualHost>
If “Options +FollowSymLinks” is not there, error 403 shows up?
- The topic ‘wordpress 3 network (multisite) on a local development site’ is closed to new replies.