Server external connection refused - apache

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

Related

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 ..

Wamp Blocking Outside traffic

Wamp Version:2.5
Windows Version:10
Apache Version:2.4.9
Wamp is Green, and its online, and it works when i type localhost, and it work in my local network meaning anyone in my house can access the site , i already port forwarded! but when i try to access my site from outside my network it keeps loading and never works!
Virtual host
<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
ServerName aaess.tk
ServerAlias www.aaess.tk
Options Indexes FollowSymLinks
<Directory "C:/wamp/www">
AllowOverride All
Require all granted <- to allow inet access
</Directory>
</VirtualHost>
Can someone please help and explain why wamp is blocking outside traffic?
Possibly your ISP is blocking port 80.
Simple Test
You could just change your Port Forwarding.
Instead of forwarding router port 80 to PC port 80, just amend the Routers Port Forwarding to forward Router port 8888 to PC's port 80.
Then access the site using http://aaess.tk:8888
Using this method you can leave your Virtual Host on port 80.
It maybe worth trying a few different port numbers, I have knows ISP's to block port 8000 and 8080 as well as these are the most frequently tried alternative port numbers.
Also if you are getting your internet connection via a central connection in an apartment block or compound of some sort. It maybe that you will not find any port that you can use as the central router will be blocking all ports other than port 80.

Port based virtual hosts on apache

httpd.conf set up as follows on an apache server:
Listen 80
Listen 78
ServerName 162.13.46.59
DocumentRoot /var/www/ftl-media
NameVirtualHost 162.13.46.59:78
<VirtualHost 162.13.46.59:78>
ServerName 162.13.46.59
DocumentRoot /var/www/vapetropolis
</VirtualHost>
However, requests to port 78 aren't working. "Oops! Google Chrome could not connect to 162.13.46.59:78".
What's wrong with this config?
Generally speaking, port numbers less than 1024 require the process to run as root. This isn't so much of a firewall issue as a security policy -- those ports are reserved for system processes.
If you want to use port 78, some configuration will be required.
Maybe this question will help?
Is there a way for non-root processes to bind to "privileged" ports on Linux?

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

XAMPP Apache server not working on internal network

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.