Remotely accessing your Windows WAMP server sites over the internet

Remotely accessing your Windows WAMP server sites over the internet

Learn how to remotely access your WAMP server sites from any computer over the internet. (Windows)


With WAMP server it is possible to host your own websites from your own computer by making a few changes. This can be useful for testing your websites on other devices and remotely accessing data on your PC. For security reasons this should not be used to permanently host a website that you expect other users to access unless you really know what you're doing.


For this tutorial you will need the latest version of WAMP server (3.0.6) which can be downloaded from

wampserver.com

.


Step 1: setting permissions to allow other users to access your server


In WAMP server version 3.0.6 you'll need to modify the permissions that are found within Apache's https-vhosts.conf file which can be found by clicking the WAMP icon in task bar and hovering over the "Apache" dropdown.



For this particular version of WAMP, this file dictates the general permissions for accessing the server, unlike earlier versions where settings had to modified in the httpd.conf file.If you have WAMP installed in the directory C:/wamp64, then by default your https-vhosts.conf file should look similar to the following:

<VirtualHost *:80>  
	ServerName localhost  
	DocumentRoot C:/wamp64/www  
	<Directory  "C:/wamp64/www/">  
		Options +Indexes +Includes +FollowSymLinks +MultiViews  
		AllowOverride All  
		Require local  
	</Directory>  
</VirtualHost>



These settings- specifically "Require local"- currently only allow local connections from the computer on which the server is running, this should be modified to "Require all granted" which will allow any computer to connect to your server.


<VirtualHost *:80>  
	ServerName localhost  
	DocumentRoot C:/wamp64/www  
	<Directory  "C:/wamp64/www/">  
		Options +Indexes +Includes +FollowSymLinks +MultiViews  
		AllowOverride All  
		Require all granted  
	</Directory>  
</VirtualHost>

This isn't exactly great for security as you should rather only be allowing the specific IP's that you want to connect with, but for this tutorial we'll stick to this simple solution.


Step 2: Allowing connections to your server through your firewall


Currently, connections to port 80 ( the port on which the server listens for connections ) should be blocked by your firewall. To allow connections through this port you need to create a new inbound rule for your firewall. To do this you'll need to navigate to your firewall's advanced settings which can be found in the side-panel at:


Control Panel -> System and Security -> Windows Firewall


A window should now open that looks like the following:



From here we need to create a new inbound rule which can be done by navigating to the "Inbound rules" section and clicking "New rule...".



Now in the window that appears you should select the following in the order they appear:


- For rule type select "port"


- For protocol select "TCP"


- For ports select specific local port 80


- Select "allow the connection"


- For when the rule applies, select "public", "private" and "domain"


- Enter a name for the new rule, you can name it something similar to "apache connections"


- Add the new rule


Once this inbound rule has been added, you should be able to connect to your WAMP server from any device within your

local

network. To do this you'll need to know your host computer's local IP address which can be found using the "ipconfig" command. Once you have the host computer's local IP address (we'll use 192.168.1.32 as an example), you can enter the following into the URL bar of your browser:


192.168.1.32:80


This will remotely connect your device to your host computer's WAMP server from within your local network.


Step 3: forwarding port 80 on your router to your computer to allow connections over the internet


For this step you'll need to connect to your router's management page and add a port forwarding rule to forward port 80 to your host's local IP. Your host computer's local IP address (IPv4) can be found using the "ipconfig" command in Windows command prompt.



To connect to your router's management page you will need to find out the local IP address of your router, this will be the "default gateway" when using the command "ipconfig" in Windows command prompt.



You can type this IP into the URL bar of your browser to connect to your routers management page, you will need the password for your router to gain access (leave the password field blank if you don't have a password).


Next you will need to find the port forwarding section within the management page, this can usually be found under "security" or "apps and gaming" or something similar to that.


Once in the port forwarding section, you need to add a new single port forwarding rule. The following information should be entered:


-

External port

: This can be any port with which outside users will connect, for this example we'll use port 8080.


-

Internal port

: The local port which is used to connect to your server, this should be port 80.


-

Protocol

: This should be TCP


-

Device IP

: The device to which the port will be forwarded to, this should be your host's local IP address


Once the port has been added, outside users will now be able to connect to your host computer's WAMP server. They will need to connect to your router's public IP address- which can be found by typing "what is my IP" into google- followed by the external port you have used for the port forwarding. This can be typed into your browser's URL bar.


For example, say your router's public IP is 198.123.8.12 and you used port 8080 as your external port, then you would enter the following into the URL bar to connect:


198.123.8.12:8080


This will remotely connect a device to your host's server.


For any questions feel free to leave a comment.



Christopher Thornton@Instructobit 7 years ago
or