XAMPP Apache server not working on internal network - apache

I have XAMPP installed on my local laptop (Vista) and it works fine. Apache and MySQL are running as services, and I can get to both http://localhost/ and http://192.168.2.2/ without any hassles.
However, if I try accessing the server from another laptop on my internal network by typing in the http://192.168.2.2/ ip address, it errorstimes out. What am I missing here?
When I run Port Check, I get the following:
Service Port Status
==============================================================================
Apache (HTTP) 80 Program: C:\xampp\xampp\apache\bin\httpd.exe
Apache (WebDAV) 81 free
Apache (HTTPS) 443 Program: C:\xampp\xampp\apache\bin\httpd.exe
MySQL 3306 Program: C:\Program Files\MySQL\MySQL Server 5.1\bin
\mysqld.exe
and when I try telnetting to localhost port 80, that works too. My httpd-vhosts.conf file contains the following lines:
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/xampp/htdocs/"
</VirtualHost>
<VirtualHost 192.168.2.2>
ServerName localhost
DocumentRoot "C:/xampp/xampp/htdocs/"
</VirtualHost>
Any thoughts?

Answered via help at ServerFault.com
The problem was that the Windows Firewall had port 80 blocked. To fix this, I opened Windows Firewall, clicked Change Settings, went to the Exceptions tab, and then "Add Port". I set Name to "Web Server (TCP 80)", Port Number to 80, and Protocol to TCP and that was it.

Related

What is wrong with my apache Virtual host setup?

I have set up the virtual host like its displayed in the apache documentation:
NameVirtualHost Localhost:8080
<VirtualHost Localhost:8080>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot D:\Users\daniel_diezel\Apache24\htdocs
</VirtualHost>
<VirtualHost Localhost:8080>
ServerName www.otherdomain.tld
DocumentRoot D:\Users\daniel_diezel\Apache24\htdocs
</VirtualHost>
After i saved it and started the httpd.exe the following error accured while starting Apache:
`
(OS 10013)Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulõssig. : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs`
But if i change the Port to 8080 its working.
But the problem no is when the apache starts i cant find the server when i type https://domain.ltd in my browser but if I go for Localhost:8080 it shows me the index file on the site.
What can i do to fix it?
There seems to be two different issues. According to your file structure I assume you are using Windows.
Port usage
Port 80 might be already in use. Open CMD and type netstat -ano and find all processes using port 80 apart from the system process (typically PID 4). Identify the processes by using the command tasklist and look for the PIDs using port 80 from the step before.
Now open your task manager and stop all processes if they are not relevant to keep your system running. Now the port binding error should be gone.
Accessing local domain names
domain.tld is resolved by your configured DNS-provider, so it is looked up to be found in the internet. If you want to resolve domain-names locally (before reaching out for the DNS) you have to add it to your host file.
Open C:/Windows/drivers/etc/hosts with a editor of your choice an add the following line:
127.0.0.1 domain.tld
Now everything should work as expected. If you want to use different ports you can also use 127.0.0.1:port domain.tld

Https server works locally, not through internet with Apache 2.4

I'm kind of a new Apache user (version 2.4). I'm having trouble configuring the whole thing. My server has an IP address- 192.168.2.10, for example my public IP is 123.123.123.123. In my hosting provider website I did set an A record pointing at 123.123.123.123. My Apache config looks like:
Listen 443
<VirtualHost _default_:433>
# General setup for the virtual host
DocumentRoot "${SRVROOT}/htdocs"
ServerName www.example.com:443
ServerAdmin my#mail.com
ErrorLog "${SRVROOT}/logs/error.log"
TransferLog "${SRVROOT}/logs/access.log"
The problem is I receive ERR_CONNECTION_TIMED_OUT all the time. When I tried swaping www.example.com with local IP 192.168.2.5 it KIND OF worked (SSL certificate problems because they are connected to www.example.com, but I managed to see HTTP response. Where seems to be the problem?
EDIT:
I think the problem is I can't use port 443 because it's my routers default managment port. How should I configure it then? I have NAT rule on my router that does forward every :8456 request to 192.168.2.10:443.
I resolved the issue. It was "SSL 3.0" option turned off on my router.

Connect with public IP (ok) & Domain (not ok) EC2 Windows Instance

here is what I did so far:
I have setup a windows 10 instance
I assigned an Elastic IP
I added rules to the security group
HTTP TCP 80 0.0.0.0/0
Custom TCP Rule TCP 7474 0.0.0.0/0
MYSQL/Aurora TCP 3306 0.0.0.0/0
I assigned the public IP to the domain in the hosted zone as A record
I installed XAMPP 3.2.2
I made sure in httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
is active
In httpd-vhosts.conf I entered
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/my_app"
ServerName myapp.cloud
ServerAlias www.myapp.cloud
<Directory "c:/xampp/htdocs/my_app">
AllowOverride All
Require all Granted
</Directory>
</VirtualHost>
I also changed hosts on the Windows Server (C:\Windows\System32\drivers\etc)
127.0.0.1 myapp.cloud
I rebooted the system
I started Apache via XAMPP Panel
Results:
I can access myapp.cloud local on the server with RDP session
I can access the public IP from outside and get the XAMPP screen
I can also access publicIP/my_app and get my application
A ping confirms that port 80 is obviously open (otherwise I wouldnt see the XAMPP screen as well)
I CANNOT access the application by typing myapp . cloud - this results in
ERR_CONNECTION_TIMED_OUT
Also Port 7474 seems NOT open although there is an entry
A port check (http://ping.eu/port-chk/) gives:
myapp.cloud:80 is open
myapp.cloud:3306 is open
myapp.cloud:7474 is CLOSED
Apparently the domain resolves correct as a DNS check returns the correct IP
So my issues:
Port 7474 isnt open although set in security
Cant access myapp.cloud although DNS seems right and port 80 is open and listens. (tested on FF and Chrome)
Any hints are very appreciated,
thanks.
######## EDIT ############# 09-11-2017
The problem of the unconnected IP is solved. It was a wrong DNS setting in my internal router - the router didnt renewed the IP settings. So Internet said DNS is correct but private network didnt - I flushed DNS on my PC but forgot to check the router and there was the problem.
Still struggling with the ports ..

Server external connection refused

I am currently using WampServer 3.04, I can connect to it using my local network IP without any problem, but when it comes to connect via the Internet I always get this response: Connection REFUSED!
I have done a lot of things:
Enable Incoming Connections on my firewall for the port 8080 (The port that I want to use)
Configured HTTPD and HTTPD-vhosts both on my current IP and the port
Enabled port forward from extenal 8080 to private 8080 to my computer IP
Enabled put Online on Wamp
Tested if my port 8080 is open and it is open.
I honestly do not have anything else to try.
My httpd-vhosts:
<VirtualHost *:8080>
ServerName 192.168.1.3
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
I also had the same issue since port 80 was used by VMware process. Hence I killed VMware process.
Run Powershell (get-process VM | stop-process -force)
Use star before &after vm
Start WAMP then goto Apache then -test port 80. If its not working then install Apache service(found below test port 80).It should solve the problem.
Regards,
Aameer

XAMPP (WIN7) port change and vhosts

I've decided to change the ports for Apache to clear up some conflicts with other applications, and maybe even give IIS a shot in the future. I've run into the problem described below.
The basic context:
WIN 7 x64
XAMPP 1.7.4 (Apache 2.2.17, MySQL 5.5.8, PHP 5.3.5)
So I've changed the default Apache port from 80 to 8080, by changing this in the httpd.conf:
Listen 8080 (was Listen 80)
ServerName localhost:8080 (was ServerName localhost)
In my vhosts file I have:
NameVirtualHost 127.0.0.1:8080
And several virtual hosts defined like this:
<VirtualHost 127.0.0.1:8080>
DocumentRoot "somepath"
ServerName servername
<directory "somepath">
usual stuff here
</directory>
</VirtualHost>
When I try to access the virtual host using the servername defined above it does not work without explicitly specifying the port:
servername:8080
It would also seem that the port defined in the vhosts file does not make any difference, whatever I tried (80, 8080, nothing), it allways requires the port to be given with the server name.
phpinfo() says:
SERVER_PORT: 8080
Apache error logs do not show any errors.
I guess I'm wondering if this is normal behaviour, or there is something I overlooked.
The 80 port is default for browsers so that's why you don't need to access servername:80. In your case it's normal to acces server like this : servername:8080
If your want to access localhost without specify the port number in the URL http://localhost instead of http://localhost:8080.
Open Xampp Control Panel
Go to Config ► Service and Port Settings ► Apache
Replace the Main Port value ​​with 8080.
Save Service settings
Save Configuration of Control Panel
Restart the Apache Server