Accessing the localhost over the wifi on my android phone was not easy task for me, many configuration needed to done. I am writing these steps which worked for me. These steps are applicable on Windows 7.

Install the Wamp server

This is one of the best server I know to set up local server. If you have installed Apache or any other server then ignore this step.
Download and install Wamp Server from here.

Add New rule for port 80 in Windows Firewall setting

1. Open control panel and select Windows firewall


2. Select Advanced setting from left panel of Windows firewall setting page.

3. Select Inbound Rules from left panel(1), next Select New Rule(2).


4. Select Port and click next


5. Select “Specific local ports” radio button and enter 80 as a port value.


6. Keep Allow the connection unchanged and move to next.


7. Keep Profile options unchanged and click next.


8. Give some nice name to your New rule and click on Finish.


This will enable port 80 access on local network ip.

Edit httpd.conf file of Wamp server to fix 403 error

We need to edit httpd.conf file else we will get 403 forbidden error when we access the localhost through local network ip.

1 .Click on wamp server tray icon

2. OpenApache server sub menu

3. Select httpd.conf

4 .Find this section of configuration in httpd.conf file

Directory “c:/wamp/www/”
#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that “MultiViews” must be named *explicitly* — “Options All”
# doesn’t give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag – don’t remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Find and replace ’127.0.0.1′ with ‘All’

Find your local network ip

1. open command prompt

2 .type and enter ipconfig command


3. In my case my local area network address is 10.0.0.2

This is the ip which you need to access your localhost on your android phone over wifi. To test it is working type this ip address in your desktop browser where your localhost server is installed. Browser should display your localhost page successfully. This will assure that this local network ip is now can successfully accessible on your Android phone.
I hope this tutorial will help you too access your localhost over wifi.


Reference : http://www.mobitechie.com/android-2/how-to-access-localhost-on-android-over-wifi