Reputation: 75
We have installed wampserver2.5 and set up the wampserver in my system, we can access through local system but cannot access trough my local network. The following error appears
Please help me to resolve this problem.
Upvotes: 3
Views: 9676
Reputation: 171
Locate the file httpd.conf
In my case the file is in C:\wamp\bin\apache\apache2.4.9\conf
Then look for the line <Directory "c:/wamp/www/">
And then look for the line Require local
, next write the following:
Require all granted
Restart your wampserver and you can browse the localhost on every device that stays connected in your local network.
Upvotes: 0
Reputation: 94662
You have to remember that WAMPServer comes configured assuming you are going to use it to develop php based websites locally on a single PC and therefore everything is setup so that the beginner will not get their system compromised by any Off-Box access.
If you want to allow other PC's on your network to access the site(s) you develop then you will have to make some changes to tell Apache that it is allowed to access connections from ip addresses that are not this PC's ip address's
First, if your network is closed i.e. not accessible from any other network or from the internet, you can simply use the wampmanager menus like so :-
wampmanager -> Put Online
This will chnage the httpd.conf file from
Require local
To
Require all granted
And restart Apache so it see's the change.
If you just want to open up your WAMPServer to your local network, or if you are in any way security conscious, it is better to edit the httpd.conf file manually again using the wampmanager menus to make sure you edit the correct file.
wampmanager -> Apache -> httpd.conf
Find the line
# onlineoffline tag - don't remove
Require local
And add this
# onlineoffline tag - don't remove
Require local
Require ip 192.168.1
To allow any ip address on your local subnet i.e. any ip starting with 192.168.1
Or for a specific ip adderss only
# onlineoffline tag - don't remove
Require local
Require ip 192.168.1.41
Now if you want to allow these other ip's access to phpMyAdmin then you need to edit this file: \wamp\alias\phpmyadmin.conf
In here you will also see commands that tell Apache who is allowed to access this alias. And change to look like this :-
Alias /phpmyadmin "d:/wamp/apps/phpmyadmin4.1.14/"
<Directory "d:/wamp/apps/phpmyadmin4.1.14/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
<IfDefine APACHE24>
Require local
Require ip 192.168.1 <-- this line added
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from localhost ::1 127.0.0.1
</IfDefine>
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
</Directory>
Upvotes: 5