10

I am quite new to web development. I have this web application I developed using PHP and MySQL that works on my WAMP server. I want to share it with a cousin for tips and suggestions. I want to make my WAMP server accessible to him. So, how do I do it? All I have is a computer running Windows 7 and an internet connection. :-P

P.S. - Additional suggestions are welcome as well. Because I think this is a basic problem that starters in web development will face and I want the optimal solution to come out so that it helps others as well.

Thanks!

Jay Blanchard
  • 32,731
  • 15
  • 70
  • 112
Mayank Choudhary
  • 281
  • 1
  • 4
  • 18

6 Answers6

11

I'm using Wampserver 2.5 64bit on window 7, and this is what I found:

//You need to find this

# Controls who can get stuff from this server. #
# onlineoffline tag - don't remove
Require local

then change to

# Controls who can get stuff from this server. #
# onlineoffline tag - don't remove
Require all granted

Then you can access your site via LAN IP address. For example http://192.168.2.7/.

However, this may cause a bug that makes Wampserver can not be restarted.

Lewis
  • 11,912
  • 9
  • 59
  • 79
8

In Windows Firewall, allow inbound connections through port 80. Then you may need to configure port forwarding on your router to forward inbound connections to your PCs local IP address. After you have done that, just give them your public IP address and they should be able to browse to your site. I can't give you very specific instructions for the port forwarding, because its different for almost every router, but this website should help: http://portforward.com/

ecnepsnai
  • 1,560
  • 4
  • 28
  • 51
  • Thank you for your response, but port forwarding is where I get stuck. Is it too complex for a starter? – Mayank Choudhary Jul 03 '14 at 17:03
  • You'll need some basic understanding of how Ports and NAT work. Also it probably violates your ISPs service agreement. – ecnepsnai Jul 03 '14 at 17:05
  • 1
    Sorry, I should clarify. Opening port 80 on your router probably won't violate anything, but hosting a server is almost always against the SLA for ISPs on residential service. – ecnepsnai Jul 03 '14 at 22:55
  • You can get some usefull insight to Port Forwarding here http://en.wikipedia.org/wiki/Port_forward and www.portforward.com It also has specific instructions on how to do it for many routers. – RiggsFolly Jul 04 '14 at 14:29
4

Nice posts here. I actually had both issues preventing me having web server not accessible over internet (only local host).

Added a Virtual host to a valid domain (or subdomain in my case, ie you.me.com)

So reading through everyone's posts, I got it now.

I had to do both things mentioned

1) Add exception to Windows Firewall ( manually added c:\wamp\bin\apache\apache2.4.37\bin\httpd.exe ) -- A big clue that you need this is when you try to go to your site, it just times out and looks like a non working web page)

2) As another user mentioned. If you're getting a Forbidden error, despite having a index.htm file in your folder, then you need to edit c:\wamp\bin\apache\apache2.4.37\conf\extra\httpd-vhosts.conf and change:

Require local to Require all granted

Here's example:

<VirtualHost *:81>
ServerName me.you.com
DocumentRoot "c:/wamp/www/atitd"
<Directory  "c:/wamp/www/atitd/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local (CHANGE THIS)
</Directory>
</VirtualHost>

I'm using port 81 in this example, because I'm using IIS as main web server (port 80). So in this example I'd access with http://you.me.com:81 . The listening port can be configured by right clicking the icon in toolbar, Tools, User a port other than 80 (Under Apache header). Cheers!

  • This worked perfectly for me because I didn't have to do any port-forwading which seems hard, thanks. Just did step 1, followed by step 2 and I could access my site from an external device – Cypherjac May 14 '20 at 03:25
2
  1. First, you need to do port forwarding on your router to forward (open) port 80.
  2. Check your httpd config.
  3. Try accessing your site via your IP (to find out your WAN IP , go to www.whatismyip.com)
  4. If it didn't work , check your windows firewall (disable it).
Kirill Chatrov
  • 762
  • 4
  • 11
2

You may also have to add the file "httpd.exe" to your list of allowed applications on your Windows Firewall (I encountered this when hosting an app on Windows Server 2012 R2). The file can found at this location (or drive C/D; where you installed WAMP):

"F:\wamp\bin\apache\apache2.4.9\bin"

Raymond Wachaga
  • 1,888
  • 1
  • 19
  • 23
0

I know that if you have a server and want it to be connected to the internet you must forward the server port to 80 and then you leave it from there I believe WAMP server is good for beginners in web programming.