0

I'm trying host a website on my mac mountain lion.

Do I need virtualhostx to have my website online? So far it's only local and none of my friends can view it?

nimbus
  • 141
  • 2
  • 2
  • 11
  • 1
    No you don't need to add any "virtualhostx" to do that. What is your IP ? try accessing with http://IP/SiteName . Add the PORT 80 to your firewall. – Joddy Dec 15 '12 at 12:39
  • 1
    Duplicates: http://stackoverflow.com/questions/7404699/connecting-to-local-web-server-when-i-am-outside-my-lan , http://stackoverflow.com/questions/13574186/access-webrick-server-from-outside , – sinni800 Dec 15 '12 at 12:49
  • 1
    Hosting a site from 'home' is usually a bad idea and will lead to problems. – markus Dec 15 '12 at 13:00
  • 1
    possible duplicate of [setting up apache web server - noob question](http://stackoverflow.com/questions/3556002/setting-up-apache-web-server-noob-question) – Jocelyn Dec 16 '12 at 01:00

2 Answers2

1

Your viewing it as locahost or 127.0.0.1 I presume. My guess is that you're behind a router, and you could even get to your site with the IP provisioned by the router. The problem is that your router doesn't know how to redirect requests coming from outside, so anyone hitting your external IP can't reach your machine.

To get around this, you need to create a Port Forwarding rule on your router to explicitly tell it where to send port 80 requests.

How To: Port Forwarding

Wikipedia: Port Forwarding

Ian Atkin
  • 6,302
  • 2
  • 17
  • 24
0

Usually internet connectivity is done using a NAT router, thus port forwarding needs to be in place for Apache to work behind it.

Since there's so many router models all around the world, you should follow this web page, as it's arguably the best resource out there:

http://portforward.com/

Also this question was asked quite a lot of times, actually. Please make a search before asking next time.

sinni800
  • 1,451
  • 14
  • 29