Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
jeff creamer
23,733 PointsMAMP/WAMP best practices: Build a simple php...
Hey all, I've just started Randy's php course. Now that I've installed MAMP, did the exercises and am done for the day; what are the best practices for using and 'putting to sleep' my local server? On the MAMP panel, do I just hit "Quit"? (or "Stop servers" or both)? What do you folks/pros who use it alot do?
And question #2: why did we change the apache port from 8888 to 80?
Thanks so much for any insights. Cheers.
7 Answers

samiff
31,206 PointsBe sure to STOP servers before exiting the program just to make sure no data is corrupted (more important when you start using databases). I only run my local server when I'm developing. Port 80 is the default TCP port used by HTTP. You could still use 8888, but you'd always have to add that to the end of your web address when testing (80 is assumed).
jeff creamer
23,733 PointsHey Sam, thanks much for the info!

Craig London
4,883 PointsRunning a computer with port 80 open might leave you open to HTTP vulnerabilities. Say you configured your router to be in the DMZ [http://en.wikipedia.org/wiki/DMZ_%28computing%29], and leave your computer on all night. A malicious person could just be port scanning and find your computer with open port 80, and launch attack(s) at your computer on port 80.

Craig London
4,883 PointsI use XAMPP, I tried WAMP but didn't care for it much.

James Barnett
39,199 PointsCraig - Whether you have port 80 open or port 8888, it makes no difference.
If a person were running a port scanner, they most likely included 80, 443, 8080 & 8888 as those are all common ports on which to run a web server.
jeff creamer
23,733 Points@Craig, interesting read. I'm doing the MAMP thing for the php course and soon for local dev. Thanks for the heads up and for chiming in.
@James, thanks for the clarification that it's any open port. So what are some other best practices when running VMs, W/MAMP, etc relating to security?

James Barnett
39,199 Pointsjeff -
So what are some other best practices when running VMs, W/MAMP, etc relating to security?
TL;DR - Go to yougetsignal.com and test ports 80 and 8888, if it says closed
your good.
In general you don't want your VMs, W/MAMP, etc be accessible from the outside world. The good news if your private and public IPs are different, then in order for someone outside your local network to access your VM you would need to configure port forwarding first.
The easiest way to make sure that your VM isn't accessible outside your local network is check using the port forward tester over at yougetsignal.com. Try both ports 80 and 8888, if it says that the port is closed
then that means someone outside your network can't find your VM and that's a good thing
If you want to learn more check out, the home networking article from how stuff works.