970_90

Thursday, 25 August 2016

How to put online your WampServer? - Access Local code globally

How to put online your WampServer - Access Local code globally

We have done some R&D on How to Put Online Your WampServer?
Now, If any one have code in their local WampServer.
For Example:
http://localhost/myproject1
Access with
http://192.168.0.17/myproject1

It can be access with globally using the same network.

Benefits:
Suppose you have code in local system, But you want to test the functionality in different Mobile devices and Ipad.
With use of this, you can do the same without push the code in LIVe.


Question:How to do this?
Following the Below steps.
Step 1
Get to know the your Private IP.
Go to command prompt and type ipconfig and press enter. You will get simiar to following response.
C:\>ipconfig
  Connection-specific DNS Suffix  . :
  IP Address. . . . . . . . . . . . : 192.168.0.17
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Default Gateway . . . . . . . . . : 192.168.1.1

Now 192.168.0.17 is your local Ip Address.
Step 2
Make sure Windows Firewall is disabled
How to check/update windows firewall
Control Panel=>System and Security=>Windows Firewall=>Turn windows firewall on/off
Turn windows firewall on/off


Step 3
means
http://192.168.0.17/myproject1
can be access globally within same network.



Question:How to apache listen multiple port?
Each system have one unique Ip Address.
But you can set multiple port with same ip address.
Open httpd.conf file in your wamp server
I have http.conf in following location.
E:\wamp\bin\apache\apache2.2.22\conf\httpd.conf

Add following port as below after "Listen 80"
Listen 5555
Listen 5556
Listen 5557
Listen 5558

(I have added port 5555-5558, you can choose your own)

Question: I am using Virtual host for my local websites? Can we access globally for this also?
Yes, You can do the same. Just add the following code in your http-vhosts.conf file.

 <VirtualHost 192.168.0.17:5555>
    DocumentRoot "E:\wamp\www\myproject2\public_html"  
    <Directory "E:\wamp\www\myproject2\public_html">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Please modify URL and IP Address above as per your system.

Now can Access With
http://192.168.0.17:5555

No comments:

Post a Comment