Access Wamp 3.1 from PC in local network - php

I know there have been a lot of questions regarding this topic, but I still was not able to get it to work.
I've set up a Wordpress site and a virtual host for that site locally on my notebook (via Wamp 3.1) and now I want to access it from another PC on the same network. On the localhost everything works fine.
My httpd-vhosts.conf file looks like this:
# Virtual Hosts
#
#Wamp
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#Hp1
<VirtualHost *:80>
ServerName hp1.local
DocumentRoot "d:/wamp64/www/hp1"
<Directory "d:/wamp64/www/hp1">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.100.76
</Directory>
</VirtualHost>
I've added 192.168.100.88 hp1.local (the ip of notebook) to my PC's host file. 192.168.100.76 is the ip of my PC.
I can ping my PC from my notebook and vice versa.
I've tried to access the site via
http://192.168.100.88
and
http://hp1.local
But to no avail. Not even a 403 or anything, just
Error: network timeout
Edit:
Thinks I've tried:
Put an inbound rule for port 80 in place (on my PC)
Deactivated the firewall (on my PC)
Added Apaches httpd.exe to my hosts firewall exceptions (solution)

Windows Firewall is likely blocking incoming connections from Apache. Add an exception for Wamp's incoming traffic (or just turn it off, but doing so would be bad for security).

Related

Local wifi network cannot connect to XAMPP apache server running on mac

I have installed XAMPP and have an apache server running on my mac. When I go to the address http://192.168.1.132:80/testproject/test.php from the mac's browser it works (simply echos the word 'success'). When I go to the exact same address from another device on the network it says it cannot connect or similar.
I setup a virtual host, and if I replace the servername with my IP I get the same result (works from the mosting mac but not from other devices on network)
# localhost
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
Options Indexes FollowSymLinks Includes execCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
# My custom host
<VirtualHost *:80>
ServerName wgaamwserver.local
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/wgaamwserver.local-error_log"
</VirtualHost>
I have run "ps -eaf | grep httpd" in terminal while XAMPP was not running to check incase of other httpd services. I got the below output:
501 19343 18144 0 4:57pm ttys000 0:00.00 grep httpd
I have been searching everywhere for a solution to this but googling mostly turns up issues relating to either windows firewall on the host blocking the remote connections, or the apache server simply not responding when connecting from the host. Obviously neither are the case here.
localhost can use only in your`s device, rename them
Try add in hosts file (At another device) 192.168.1.132 wgaamwserver.local and go to wgaamwserver.local

WAMP Gives the Forbidden Error with Static IP Address [duplicate]

I know this question has been asked a lot of times
I followed Most of the answers in the internet But I still get the same Message
403 Forbidden
You don't have permission to access / on this server.
It is weird that when I access using the same PC to localhost:1234 it runs normally but if I access using my IP address 192.168.0.188:1234
Also which is really weird is that I tried to install WAMP on other PC and without any configuration I could access to that PC.
So I thought it's because McAfee and Firewall so I open port on Widows and McAfee and nothing changed also I turned off Firewall and still nothing change.
Then for no reason I opened port through the Router “port forwarding” and still nothing changed.
I don't think that it's because my configuration in WAMP since I am still able to get this 403 Forbidden Message and also by using other PC without any configuration I could access it.
Both PCs are setup like this:
Windows 8 Pro
WAMP Wampserver: 2.4
Apache Version: 2.4.4
PHP Version: 5.4.12
MySQL Version: 5.6.12
The accessible PC uses Microsoft Security Essentials.
The inaccessible PC uses McAfee Internet Security.
I tried to turn off WAMP and start IIS For Microsoft Server (I works perfectly From any PC) but WAMP is still not not working
I followed these tutorial:
How to Access WAMP Server in LAN or WAN
Install & Setup Virtual Host Guide for WAMP
Install & Setup LAN & Worldwide Access Guide for WAMP
And the Stack Overflow answers here:
Cannot access wamp server on local network
WAMP 403 Forbidden message on Windows 7
If you are using WAMPServer 3 See bottom of answer
For WAMPServer versions <= 2.5
By default Wampserver comes configured as securely as it can, so Apache is set to only allow access from the machine running wamp. Afterall it is supposed to be a development server and not a live server.
Also there was a little error released with WAMPServer 2.4 where it used the old Apache 2.2 syntax instead of the new Apache 2.4 syntax for access rights.
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
Require local
Require ip 192.168.0
The Require local allows access from these ip's 127.0.0.1 & localhost & ::1.
The statement Require ip 192.168.0 will allow you to access the Apache server from any ip on your internal network. Also it will allow access using the server mechines actual ip address from the server machine, as you are trying to do.
WAMPServer 3 has a different method
In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for localhost so you have to make the access privilage amendements in the Virtual Host definition config file
First 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>
Hopefully you will have created a Virtual Host for your project and not be using the wamp\www folder for your site. In that case leave the localhost definition alone and make the change only to your Virtual Host.
Dont forget to restart Apache after making this change
For Apache 2.4.9
in addition, look at the httpd-vhosts.conf file in C:\wamp\bin\apache\apache2.4.9\conf\extra
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot C:/wamp/www
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
Change to:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot C:/wamp/www
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
changing from "Require local" to "Require all granted" solved the error 403 in my local network
I got this answer from here. and its works for me
Require local
Change to
Require all granted
Order Deny,Allow
Allow from all
To expand on RiggsFolly’s answer—or for anyone who is facing the same issue but is using Apache 2.2 or below—this format should work well:
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
Allow from localhost
Allow from 192.168
Allow from 10
Satisfy Any
For more details on the format changes for Apache 2.4, the official Upgrading to 2.2 from 2.4 page is pretty clear & concise. Key point being:
The old access control idioms should be replaced by the new
authentication mechanisms, although for compatibility with old
configurations, the new module mod_access_compat is provided.
Which means, system admins around the world don’t necessarily have to panic about changing Apache 2.2 configs to be 2.4 compliant just yet.
For those who may be running WAMP 3.1.4 with Apache 2.4.35 on Windows 10 (64-bit)
If you're having issues with external devices connecting to your localhost, and receiving a 403 Forbidden error, it may be an issue with your httpd.conf and the httpd-vhosts.conf files and the "Require local" line they both have within them.
[Before] httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local <--- This is the offending line.
</Directory>
</VirtualHost>
[After] httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
</Directory>
</VirtualHost>
Additionally, you'll need to update your httpd.conf file as follows:
[Before] httpd.conf
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
# onlineoffline tag - don't remove
Require local #<--- This is the offending line.
</Directory>
[After] httpd.conf
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
# onlineoffline tag - don't remove
# Require local
</Directory>
Make sure to restart your WAMP server via (System tray at bottom-right of screen --> left-click WAMP icon --> "Restart all Services").
Then refresh your machine's browser on localhost to ensure you've still got proper connectivity there, and then refresh your other external devices that you were previously attempting to connect.
Disclaimer: If you're in a corporate setting, this is untested from a security perspective; please ensure you're keenly aware of your local development environment's access protocols before implementing any sweeping changes.

cannot reach symfony app on my debian 404 Not Found

looking for solutions for a small challenge
i have my local network (router)
i have debian server on first machine where i have installed a symfony in /var/www/my-symf-app
i changed /etc/site-available
and
/etc/hosts
for my new web site
when i'm trying to reach in a web browser my-symf-app from my debian machine
--> and it works fine
but when I'm using targeting my server from another PC with my ip http://192.168.0.47/coach.dev
i have a situation
and i receive a 404 not found
but when I'm targeting my debian server just with http://192.168.0.47
it works fine, it shows me a index.htm Works find
i have commented code in config.php
for if server something throw error forbidden
could you pls explain me what I'm doing wrong and how can i fix it?
my /etc//sites-available/coach
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName coach.dev
ServerAlias www.coach.dev
DocumentRoot /var/www/coach/web
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/coach/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
my /etc/hosts
127.0.0.1 coach.dev
Add on the 2nd computer ip and domainname to hosts.
I mean add ip adress of the server and his domain to host on second computer it should work.

Virtual Host Not Behaving Properly

This problem has been bugging me for days and I really need an answer.
I have a previous WAMP server in which I have configured properly so I can set up virtual hosts for applications that I build. It served me well for months.
Recently, there's this software, in which I think is a Malware, that run in my pc. The software was removed and I scanned the pc and there were no viruses.
I re-installed WAMP server and configured it again. It went well but the virtual hosts are not behaving properly.
These are what I have declared:
In httpd-vhost:
<VirtualHost *:80>
ServerAdmin #removed
DocumentRoot "c:/wamp/www/Thesis"
ServerName pixtcha.dev
<Directory "c:/wamp/www/Thesis">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin #removed
DocumentRoot "c:/wamp/www/mvc-pe-system/web"
ServerName copers.com
<Directory "c:/wamp/www/mvc-pe-system/web">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
</Directory>
</VirtualHost>
In my hosts file:
127.0.0.1 pixtcha.dev
127.0.0.1 copers.com
The thing is, I am able to access the pixtcha.dev properly and there were no problems, while the copers.com is inaccessible, when I type it, it redirects me to some website from the web. I just don't understand why this happens. I even tried flushing the dns if there were corrupted local files but I just can't figure it out.
Also, I have tried using the server names from my previous virtual host and they are all inaccessible too. They are giving me:
http://copers.edu.ph is not available
So I resorted to using new server names, but I don't understand why can't I use the previous server names from my previous WAMP configuration. :(
What do you think are the problems? And how to solve them?
Please help. Thanks in advance.
Ok a couple of things that might help here.
As Apache 2.4 is IPV4 and IPV6 aware you need to change your HOSTS file like this so if the browser decides to use IPV6 it knows where to find your domains. I wish I knew what controls the broswers decision, but I dont.
127.0.0.1 localhost
127.0.0.1 pixtcha.dev
127.0.0.1 copers.com
::1 localhost
::1 pixtcha.dev
::1 copers.com
Dont forget to restart the dnscache or reboot after changing this file.
From a command windows, started using the 'Run as Administrator' option, do these 2 commands to restart the dnscache.
net stop dnscache
net start dnscache
Also when you create Virtual Hosts the default host, as defined in httpd.conf, is ignored, so you need to add a VHOST definition for localhost.
Also you are using old Apache 2.2 syntax in your VHOST definitions, incorrectly as well as it happens, and this should be changed to Apache 2.4 syntax
Also it is better to stick to lower case for directory names, Windows does not care but if you ever move code to a Unix live server it may cause confusion.
# Should be the first VHOST definition so that it is the default virtual host
# Also access rights should remain restricted to the local PC and the local network
# So that any random ip address attack will recieve an error code and not gain access
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin #removed
DocumentRoot "c:/wamp/www/thesis"
ServerName pixtcha.dev
<Directory "c:/wamp/www/thesis">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin #removed
DocumentRoot "c:/wamp/www/mvc-pe-system/web"
ServerName copers.com
<Directory "c:/wamp/www/mvc-pe-system/web">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
</VirtualHost>
Check and make sure that your scripts (PHP?) in your copers.com root (index.php?) are not redirecting to these outside URLs, or to URLs further inside your local site that would redirect outside as well.
Also in Chrome, you can open the Network tab of Developer Tools to see what actual web requests are being made, and in what order.

Oops! Google Chrome could not connect to localhost: Apache2 configuration in MacOsX (without MAMP)

I have a machine with Linux and a nother one with MacOsX: the former for web development, the latter for iOS development. I just want to start using my MacBook for web development and stop to have two machines. I dont like virtual machines.
(PS. If I can, I'll like to not install any software like MAMP)
So, ... I've activated apache2, I've defined a VirtualHost:
<VirtualHost *:80>
ServerAdmin sensorario#gmail.com
ServerName localhost
ServerAlias senso.local.com
DocumentRoot /Users/simonegentili/Development/Www
DirectoryIndex index.php
<Directory /Users/simonegentili/Development/Www>
AllowOverride all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/localhost.error.log
LogLevel notice
CustomLog ${APACHE_LOG_DIR}/localhost.access.log combined
</VirtualHost>
And also this DocumentRoot:
DocumentRoot "/Users/simonegentili/Development/Www/"
But I see only a message like this:
Oops! Google Chrome could not connect to localhost

Categories