Yosemite actually comes with Apache already installed. If you want to test it in the web browser go to your sharing settings and it will tell you the local name of your Mac. It’s the same thing as your IP (like 192.168.0.1) but apple makes it way easier so mine is norths-macbook-pro.local/ and when I go to that, it goes to my default folder.
There are a lot of guides online on how to do this.
This is just one of them.
Don’t forget that because you’re on OS X, you can actually build the project in Xcode and run it on your iPhone. That is the BEST way to test it because it’s the real app on a real device.
Also note that OS X Mavericks and lower uses apache 2.2 where as Yosemite uses apache 2.4 so be careful when looking online for guides, the configurations and commands are slightly different. Always be sure you’re looking for Yosemite tutorials