Mac host environment

How to setup multiple sites hosted on your Mac with OSX 10.8 + (MAMP Part 5)

15 thoughts on “How to setup multiple sites hosted on your Mac with OSX 10.8 + (MAMP Part 5)

  1. Just dropping by to say that this is the best explanation I could find. Thank you so much! I’m new to Mac OS X and I was really having trouble understanding all the .conf editing and whatnot. This has made my life so much easier and I finally understand how it’s done. Thanks again man! 🙂

  2. Hey Jonathan, great tutorial man! Really very helpful it was. Thanks a lot and keep writing such coll and clean stuff 🙂

  3. Hi Jonathan!

    First of all wanted to say thanks for the tutorials, they are really helpful and guides newbs like me step by step.

    I finished Part 1-5 step by step and I didn’t have any issues until I got to the end. In order to test everything, I created a test php file called “helloworld.php” which just prints out helloworld. I saved it in the directory “/Users/koj/Sites/mysite/html”.

    I then went back to test if the phpinfo.php file would open in the localhost server but now that doesn’t work either. It was previously working before I got to the latter Parts in the tutorial. Now I get an error every time that says “This webpage is not available ERR_CONNECTION_REFUSED”. Strange this is that when I type in “http://localhost” I get the message that “It works!”

    I can’t figure out what might have gone wrong. My only suspicion is in Step 2. Configure the virtual hosts file to setup the directories and logs for Apache; in the second virtual host record, I basically copied the exact same directory location in your example (in the green) except I changed “Jonathan” to “koj” which is my username. The thing is, I created the files and subdirectories “mysite”, “html”, “log”, and “mysite.localhost.error_log” in Finder before configuring the virtual hosts file. It wasn’t explicitly stated whether this was the right thing to do or not.

    That’s the only thing I remember doing that was not explicitly stated in your tutorial. I can’t really find any other potential room for error. All I know is that the phpinfo.php was opening in the browser yesterday but after completing all 5 Parts today, I get a connection error…Please help if you can! 😮

    1. Hi Joseph,

      Thanks for your detailed question. This might take some digging, but I will be able to take a look at it later tonight to see if I can find a solution for you. Cheers

    2. Hi Joseph, I’ve updated the virtual hosts file.

      Try adding the following line inside the tags for your site

      Require all granted

  4. Great set of tutorials, Jonathan. I am having some difficulties with this last part however. For some reason, in following these steps I’ve managed to “break” the rest of the setup from the previous tutorials. I’m receiving a “connection refused” when trying to access mysite.local or even the phpmyadmin site from the other tutorials. I know it’s something in the vhosts.conf file because I went in and removed everything I added and everything started working again. Any ideas as to what I should look for?

    1. Hi George,

      Hmmm, that’s an interesting problem. Sounds like a setting issue. What does your apache error log say?

      sudo nano /var/log/apache2/error_log

      1. Sorry for the delay Jonathan, the one entry that stands out to me is this: “AH01797: client denied by server configuration: /Users/”username”/Sites/.” The log does have the correct username and path there. I’ve done some research and found some documentation that I may need to add this directory to my httpd.conf file to give access. Is that the case?
        Operating system: OS X Yosemite Version 10.10.3
        Apache version: Apache/2.4.10
        Once again, thanks for the help.

  5. Great tutorial! It was very easy to understand and follow, and had no issues setting up.
    Thanks a lot, and hope you continue the great work 🙂

    – a very happy programmer starting out on webdevelopment

  6. Thanks. Great Post! It helped me a lot. Very easy to follow.

    By the way, you have a wrong path at 2. step / 2. Scroll down to the end of the …

    “/User/username/Sites”
    should be
    “/Users/username/Sites”

Leave a Reply

Your email address will not be published.

Previous post We need to talk about the impact of Likes
Next post Mac – How to clear a file’s contents using Terminal command