Accessing local host from another machine - apache

I have seen many answers on this with what would appear to be simple solutions, none of which are working for me at this time.
I have WAMP install with Apache 2.4.33 32bit installed on a PC. I can access the site on that PC without a problem using the alias mySite.local.
The PC's host file looks like this
127.0.0.1 mySite.local
The remote lap top's host file is
192.168.1.114 mySite.local
That is the IP of the PC on the network.
httpd.conf
Listen 80
ServerName mySite.local:80
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "H:/Intranet/mySite_v2_www/public"
httpd-vhosts.conf
<VirtualHost *:80>
ServerName mySite.local
DocumentRoot "H:/Intranet/mySite_v2_www/public"
</VirtualHost>
I have tried disabling the windows firewall and virus checker on the PC.
The laptop appears to be getting there but being blocked. The message is..
Forbidden
You don't have permission to access / on this server.
Apache/2.4.33 (Win32) PHP/7.2.4 Server at mySite.local Port 80
So it looks like it can see Apache but is being blocked. So what else needs to be set to get access to the server?
Here are two of the links that I have been following to try and get this to work
Error message "Forbidden You don't have permission to access / on this server"
and
How do I connect to this localhost from another computer on the same network?
Thanks for any direction you can provide.

To complement the answer of Paul Neale:
Forbidden You don't have permission to access / on this server. Apache/2.4.33 (Win32) PHP/7.2.4 Server at mySite.local Port 80
That message is an answer from Apache. Disabling the windows firewall and virus checker on the PC won't have any effect, you are already reaching Apache there is not any networking problem.
Apache is receiving your request to access the root folder "public":
H:/Intranet/mySite_v2_www/public
But denies the request because, the directive Require local is enabled. This directive means, you can access to the content of public from the local server (localhost), which is the same to say 127.0.0.0 or localhost.
What you wanted is to tell apache that allows the access of certain IP address to the root directory "public".
When you changed the directive to Require all granted you are telling apache that, no matter who asks, give it access to / (root folder) in other words "public".
So, what you was searching for is "Access Control" in apache, and the directive Require can be used with IP address, here's the main document from Apache, this is an example:
Require host address
Require ip ip.address
It's important to differentiate between Network//Permissions problems. If you want to know if you are able to communicate (At network level) with Apache, you could do:
telnet <IP_APACHE_SERVER> <PORT_APACHE_SERVER>
#example: telnet 172.10.10.2 80

So after playing around will combinations for a day I found that in the httpd.conf I needed to change Require local to Require all granted in the section.
<Directory "H:/Intranet/mySite_v2_www/public/">
Options +Indexes +FollowSymLinks +Multiviews
AllowOverride all
# onlineoffline tag - don't remove
# Require local
Require all granted
</Directory>

Related

apache xampp virtual host makes error 403 windows

I simply want to enable the test.php file to be accessible via a virtualhost so I added just 127.0.0.1 test.localhost in the windows host file and
<VirtualHost *:80>
DocumentRoot "D:/Programmordner/test"
ServerName test.localhost
<Directory "D:/Programmordner/test">
require all granted
#<FilesMatch "^((test|test2).testdateiendung1|.+.testdateiendung2)$">
<FilesMatch "^(test.php)$">
Allow from All
</FilesMatch>
in httpd-vhosts.conf
Now if I add the second, it seems I even cannot open the default documentation website by clicking the admin-button on the apache interface, which should not be affected? If I erase the second the alterations in the windows host file doesnt affect anything and I can access all files in standard htdocs. I switched different versions like allow from all, access denied access granted but nothing changed
If somebody knows there is already which solves my problem, I will not grudge him however I looked for it and it did not help
I made several fixes and changed to Port 80 (without httpS :( ) and everything is running now.

WAMP Server cannot be accessed through local network [duplicate]

So I set up a few virtual hosts with unique urls and they work just fine on the desktop. However, when I connect a mobile device on the network, it can't seem to access anything properly but the default localhost virtualhost and that's only when it's the only virtualhost I have up.
My setup and coding is pretty much this except with a different site title
wamp server 3.0 virtual host on another device
and while that solution redirects me to my unique url, it has a lack of images on a default wordpress website.
Has anyone managed to get mobile devices fully accessing links other than on localhost?
Since I posted the answer you referenced, I have decided upon a simpler solution.
What the actual problem is
Because we cannot fiddle with the configuration of a phone like we can with a PC, the phone can never find the domain name we create in our Virtual Host definition on the Server machine, because it does not exist in any DNS Server for it to locate the IP Address in, and a DNS Server is the only place a phone can look, unless it is jail broke.
If you wanted to access one of your Virtual Hosts domains from another PC you could just add a line like this into the HOSTS file on the other PC like this.
192.168.0.10 example.local
But you cannot do that on a phone/tablet.
What Apache expects to be able to asssociate a request to a Vhost
When we create an Apache Virtual Host, we are actually telling Apache to look at the domain name on the incoming connection and match that domain name to a ServerName that exists in one of our multiple Virtual Hosts definitions.
But if we use for example example.local as our virtually hosted domain when we attempt to connect to that from our phone, the phone does a DNS Lookup and does not find that domain and therefore cannot get its ip address.
The simplest way to get round this is:
Assuming we do not have access to adding record to a DNS Server we have to come up with a different solution.
The simplest of these is to use the IP Address of the PC running the WAMPServer(Apache) server and a specific port number. So thats a different port number for each of our sites we want to use from a phone.
So how do we do this
Add the new listening port to httpd.conf like so after the 2 existing Listen statements
WAMPServer 3: Do this using the menus, not by doing a manual edit on httpd.conf
right click wampmanager-> Tools -> Add listen port for Apache
#Listen 12.34.56.78:80
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:8000
Listen [::0]:8000
Suggested httpd-vhosts.conf file
#
# Virtual Hosts
#
# Always keep localhost, and always first in the list
# this way a ramdom look at your IP address from an external IP
# maybe a hack, will get told access denied
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# The normal Vhost definition for one of our sites
<VirtualHost *:80>
ServerName example.local
DocumentRoot "c:/websrc/example/www"
<Directory "d:/websrc/example/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# Access example.dev from phone for testing
<VirtualHost *:8000>
ServerName example.local
DocumentRoot "c:/websrc/example/www"
<Directory "d:/websrc/example/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
# assuming yoursubnet is 192.168.0.?
# allow any ip on your WIFI access
Require ip 192.168.0
</Directory>
</VirtualHost>
Restart Apache from wampmanager after completing these edits.
Now you test this from the WAMPServer PC by using the ServerName i.e example.dev and from the phone using the ip of the PC running WAMPServer with the port number i.e. 192.168.0.10:8000
Apache will find the correct code to serve from both requests.
If you want more than one Virtual Host to be accessible from your phone you just duplicate this idea and change the port number for each new site, lets say you would use 8001,8002,8003 etc. For as many sites as you want to access.
You may also have to amend your firewall to allow access on http on port 8000, or whatever port you pick to use

WAMP - World Wide Access

I have installed WAMP on my computer running Windows 7. The Apache is running on port 80. I am searching here and there and everybody has its own solution. None of it fulfil the requirement.
Information:
Local IP: 192.168.15.52
External IP: 139.190.233.170 (Collected from whatsmyip.org)
Changed httpd.conf file:
ServerName 139.190.233.170:80
DocumentRoot "c:/wamp/www"
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
I have also added some rule for port 80 in Windows Firewall and also forward port for my LAN IP. Here is the pic:
Nothing happens after all that. Clicking "Put Online" and watching it to go green, nothing happens. I can access www directory by either localhost IP address (127.0.0.1) or my LAN IP address (192.168.15.152).
Questions:
Is it really possible to put WAMP for world wide access?
If it is possible, then how?
I have been searching around but none of them works. I have also searched SO:
Unable to access wamp server from outside my computer
How can i put my WAMP online for someone to access?
e.t.c
Some external sites:
http://www.computerforums.org/forums/server-administration/wamp-server-wont-work-outside-lan-help-207071.html
http://answers.yahoo.com/question/index?qid=20091005091249AAQrHxR
http://wordpress.org/support/topic/problem-accessing-wp-externally-using-wamp
http://wordpress.org/support/topic/self-hosted-wp-wamp-server-not-connecting-externally
http://webhosting.bigresource.com/WAMP-Access-Website-with-my-WAN-IP-pg1Bh4bJ.html
http://guides.jlbn.net/setaccess/setaccess1.html
It is possible, yes.
I would suggest momentarily disabling the firewalls, trying the connection and seeing if it works. If it does, you know it's firewall - turn windows one on and the other one by one to eliminate them. If it doesn't, you know you have issues.
Remember to run httpd -t from the command prompt to verify that your config is free of errors and of course make sure you restart apache and the W is green in the task bar. Make sure it actually is restarting, too - as some times things like mail servers (hMailServer I am particularly aware of) can stop it happening. In this case you need to restart the wampapache service from the services control panel (Start > services.msc).
Here's some extra info though, as you might be better setting up dynamic DNS. I use DynDNS and have the following vhosts conf:
<VirtualHost *:80>
ServerName mysite.dyndns.org
DirectoryIndex index.html index.php
DocumentRoot /home/mysite/
<Directory /home/mysite/>
AllowOverride All
Allow from All
</Directory>
# some logging stuff I cut out here
</VirtualHost>
Put that in mysite.conf inside c:/wamp/bin/apache/Apache2.2.21/conf/virtual. The mysite.dyndns.org is the host I have set up at dyndns. Finally, to make virtual hosts work, add this to your httpd.conf:
NameVirtualHost *:80
Include "c:/wamp/bin/apache/Apache2.2.21/conf/virtual/*.conf"
Now, if it still doesn't work you you probably have other issues. Can you telnet on port 80 to that above address? See above firewall issues.

Cannot access wamp server on local network

I want to host a website on my local network. For some reason I can only access wamp in my local computer.
I have 2 computers in my network. Both computer A and computer B have wamp server installed. when I type the ip address of computer A from computer B I am able to connect to it. But when I do it the other way around it does not work! In other words when I type the ip address of computer B from computer A the browsers says: server at 192.168.0.120 is taking to long to respond.
Things that I have done in order to solve the problem on computer B: (remember I want to connect to computer B from computer A)
1) turn off the firewall
2) Uninstall wamp and reinstall it.
3) turn off the anti-virus.
4) turn off windows firewall
5) Place wamp online and after putting it online restart all services
after doing all those steps I still cannot connect to it from computer B!
I have not chaged any ini file plus I have uninstall it and install it again so why is it not possible to connect to it!? I have used wamp for the last 3 years and I have never experienced this.
Also wamp is the only web server that I have installed on this computer. I don't have IIS nor any other web server installed on my computer.
Turn off your firewall for port 80 from any address. Turn off 443 if you need https (SSL) access. Open the configuration file (http.conf) and find the lines that say:
Allow from 127.0.0.1
Change them to read
Allow from all
Restart the wampserver. It will now work. Enjoy!!
Perhaps your Apache is bounded to localhost only. Look in your apache configuration file for:
Listen 127.0.0.1:80
If you found it, replace it with:
Listen 80
Then restart Apache.
(More info about Apache Binding)
1.
first of all
Port 80(or what ever you are using) and 443 must be allow for both TCP and UDP packets. To do this, create 2 inbound rules for TPC and UDP on Windows Firewall for port 80 and 443.
(or you can disable your whole firewall for testing but permanent solution if allow inbound rule)
2.
If you are using WAMPServer 3 See bottom of answer
For WAMPServer versions <= 2.5
You need to change the security setting on Apache to allow access from anywhere else, so edit your httpd.conf file.
Change this section from :
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
To :
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
if "Allow from all" line not work for your then use "Require all granted"
then it will work for you.
WAMPServer 3 has a different method
In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for localhost so dont amend the httpd.conf file at all, leave it as you found it.
Using the menus, edit the httpd-vhosts.conf file.
It should look like this :
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Amend it to
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Note:if you are running wamp for other than port 80 then VirtualHost will be like VirtualHost *:86.(86 or port whatever you are using) instead of VirtualHost *:80
3.
Dont forget to restart All Services of Wamp or Apache after making this change
go Setting -> General and change url in WordPress Address (URL) and Site Address (URL)
enter your pc name or your ip address in place of localhost
before : http://localhost/wordpress-test
after : http://your-pc-name/wordpress-test
...and that's it..you can access wordpress from any pc in your LAN...!!!
I had to uninstall my anti virus! Before uninstalling I clicked on the option where it said to disable auto-protect for 15 min. I also clicked on another option that supposibly disabled the anti-virus. That still was blocking my server! I don't understand why Norton makes it so hard to literally stop doing everything it's doing. I know I could had solve it by adding an exception to the firewall but Norton was taking care of windows firewall as well.
Wamp server share in local network
Reference Link: http://forum.aminfocraft.com/blog/view/141/wamp-server-share-in-local-netword
Edit your Apache httpd.conf:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
#Deny from all
and
#onlineoffline tag - don't remove
Order Deny,Allow
Allow from all
#Deny from all
to share mysql server:
edit wamp/alias/phpmyadmin.conf
<Directory "E:/wamp/apps/phpmyadmin3.2.0.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
#Deny from all
Allow from all
I had the same issue, tried all nothing works, following works for me
Following is what i had
#onlineoffline tag - don't remove
Require local
Change to
Require all granted
Order Deny,Allow
Allow from all
I know this is an old post BUT I have been having problems getting WAMP server seen on my windows 7 pro network for days, tried all of the solutions offered (including changing windows system files) but still not working. finally in pure desperation I put everything on the system back as it was and installed WAMP Server on a different drive (E:\WAMP ) in my case. The result was it worked perfectly first time with no editing configs or messing with the system. Other users may wish to try this before reaching the 'tear your hair out stage', it certainly saved my sanity or what I have left of it
I hope this helps someone
Dave
If you are using wamp stack, it will be fixed by open port in Firewall (Control Pannel). It work for my case (detail how to open port 80: https://tips.alocentral.com/open-tcp-port-80-in-windows-firewall/)
I had the same problem but mine worked fine. Turn off your firewall, antivirus. Make sure your port 80 is enabled and both pcs are set to be remotely accessed. In each pc under users, add new user using the host ip address of the other pc. Restart all services. Put your wampserver online. It should connect

Allowing 0.0.0.0 access in WAMP

Everything is setup correctly, but I'm getting "403..... Forbidden You don't have permission to access / on this server." error's when I access my IP address or my TLD. Any help?
In your VirtualHost, make sure that you have access permissions set in the Directory block...
order allow,deny
allow from all
Check your DocumentRoot folder for an .htaccess file, it can override the above.
Aside from that, you can also get this error when your VirtualHost does not contain the proper ServerName or ServerAlias and the request ends up falling into the default httpd.conf setup.
Also consider trying out another WAMP package.
xampp (free) -
WampDeveloper Pro (commercial) -
WampServer (free)
You are probably making requests from ::1, which is IP6 127.0.0.1.
So just update your <Directory "c:/wamp/www/"> section at C:\wamp\bin\apache\ApacheX.X.X\conf\httpd.conf sections to:
Order Deny, Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Remember to also do it in all conf files of C:\wamp\alias
This way you preserve the apache security.