Apache: Only respond to HTTPS-URLs on vhost with 443 binding - https

I have 20+ vhosts listening on port 80 and a single one listening on port 443.
The 443 one is setup like this: <VirtualHost secure.mywebsite.com:443> but never the less, all other vhosts also respond to their domains with https in front of them... This results in https://myothersite.com to respond with the certificate of secure.mywebsite.com.
How do I avoid this?
I thought setting a specific domain would take care of the problem. I've searched the Googles to no avail and would really appreciate some help.

Related

Ways to host a web server with ports bellow 1024 blocked (except 22)?

My provider is Ask4 and they only provide 1:1 NAT which opens ports 22 and all above 1024. No UPnP. However, I want to use ports 80 and 443 for a web server.
Is there a way without changing those ports to host a web server?
Can SSH Dynamic port forwarding or Proxies/Tunnelling software help me with this?
I want to avoid VPNs as they tend to be a slower solution. The more responsive the better.
Thanks!
For me, i looked into it further and after a couple of days found that a reverse proxy was the best.
It works by running on one server running apache, nginx, etc and then basically sending that traffic to the designated IP. You can also select a port!

How to open HTTPS port in Google cloud?

Hello today configured vps on Google Cloud and put Vesta control panel, but the problem is not open one https that is, and the ip server and the domain itself does not open on https. Set up Google Cloud firewall and opened ports 80,443 but https does not open the site itself is not the ip of the server. Checked through online services port 443 is closed but settings of the server and a firewall of Google and ip tables say that port 443 is opened (checked by several services port 443) and in the browser through ip of the server and the domain on https do not open. Please tell me how to open port 443?
Same with ports 8443,8080.
I am not able to comment but here are some steps that might help to isolate the issue:
Check to see if the port is open or closed or filtered using nmap
nmap [ip_address]
Firewall rules are defined at the network level and therefore make sure that you follow this document while creating the firewall rules to allow incoming traffic on TCP port 80 and 443 (same for other ports). In this document in step 11, choose " specified protocols and ports" and enter tcp: 80, tcp: 443.
As you previously stated, you need to make sure there is no firewall running inside the VM blocking those connections.
You also need to verify if the application running on your vps is listening on port 443. To check this, try with this command.
sudo netstat -ntlp | grep LISTEN
In the output, if you don't see the application beside port number, check if your vps is rightly configured to ports for your application.
I was having the same issue with NGinx. And Found the root cause finally to be the Firewall (GCP VM Firewall) having a lower priority for the rule. ie: I had 65534 (which is super low priority) for the "Ingress 443" rule. Which did block the traffic coming into the SSL. Instead when I set this rule to 1, traffic started flowing and issue sorted.
What finally helped me was https://cloud.google.com/vpc/docs/using-firewalls
Thanks #Md Zubayer for the tip.

Tinyproxy Reverse Proxy "Access denied"

I'm using tinyproxy to reverse proxy. I have three subdomains pointed to the same server, and we need them to point to specific ports internally. That is, port 80 from any particular subdomain, mapped to a particular port. See the config example below.
The config looks like this:
Port 80
#Allow 127.0.0.1
#ReverseOnly yes
upstream 127.0.0.1:8115 "website.example.com"
upstream 127.0.0.1:3000 "api.example.com"
upstream 127.0.0.1:9000 "socket.example.com"
When I pull up any subdomain, all I get is:
Access denied
The administrator of this proxy has not configured it to service requests from your host.
Generated by tinyproxy version 1.8.3.
I cannot find adequate documentation anywhere. I'm thinking of contacting the maintainers. Please help.
I hope you already got the answer, but if you have not, here is the setting to allow client connecting to your proxy:
#
# Allow: Customization of authorization controls. If there are any
# access control keywords then the default action is to DENY. Otherwise,
# the default action is ALLOW.
#
# The order of the controls are important. All incoming connections are
# tested against the controls based on order.
#
Allow 127.0.0.1
#Allow 192.168.0.0/16
#Allow 172.16.0.0/12
#Allow 10.0.0.0/8
Allow 0.0.0.0/0
In my example here, I allow 0.0.0.0/0 because I'm configuring a reverse proxy from the Internet to my other VPS.
Also, your configuration above is for forward proxy, not reverse proxy.
To enable reverse proxy function, you need at least the following:
ConnectPort 80
ConnectPort 443
ReversePath "/" "http://<your server IP>:8080/"
ReverseOnly Yes
ReverseMagic Yes

How Do I run Localhost?

Hi I would like to figure out how i can run local host. I keep getting an error of Port 480. My page is unable to load. I check my browser compatibility already.Cheers.
Perhaps certain programmes such as skype could have blocked off your port.
Stop Teamviewer / Skype. Check if your firewall blocks the port. Check if u correctly started the apache webserver.
And then you can reach your localhost via http://127.0.0.1 or http://localhost
From here:
Listen and ServerName directive in \xampp\apache\conf\httpd.conf for Port 80
Listen, <VirtualHost> and ServerName directive in \xampp\apache\conf\extra\httpd-ssl.conf for Port 443
You need to change the observed ports in your XAMPP control panel v3 settings too.
or if the problem is skype:
"Why don't you configure Skype not to use ports 80 and 443?
Thats a simply checkbox in the Skype configuration."
Explanation here:
http://www.absolutewillynilly.com/computer/skype-xampp-port-conflict/
Skype >tools>options>advanced>connections > untick use port 80 and 443 as alternatives - restart skype

Can I create an Apache server and use No-IP (or similar) in Windows to host a site?

The title says almost everything. I want to use apache under windows and then redirect one or more domains to my computer using a service like No-IP. Is it possible?
Yes you just need to set port forwarding to your local machine (PORT 80 for HTTP, 443 for SSL, 21 for FTP ( if you want to run a ftp server aswell)) on your router, and set a dynamic dns there that points to NO-IP. Most likely you can add one DynDNS entry.
Yes.
You don't even need a Dynamic DNS service (like no-ip) if you have a static IP address. In that case, just register a domain name and create two DNS records -
NAME TYPE VALUE
example.com. A public.ip.address.here
www.example.com. CNAME example.com.
Most ISPs now assign static IPs (even if they claim otherwise), and if not, you can get one for a small fee ($5/month extra). Or upgrade your account to business class.
This way you don't have to introduce another layer (Dynamic DNS) into your set up.
Then install a WAMP such as - xampp (really popular here) - UniformServer -
Wamp-Developer Pro (the one I use) -
WampServer (another good one)
You'll also need to port-forward your router (ports 80 and 443) to the LAN IP, and create two rules in the Windows Firewall to unblock incoming port 80 and 443 requests.
The only thing that can go wrong is if your ISP blocks incoming port 80 (http) and 443 (https) requests. You can call and get them to unblock that, or again, update the account to business class to remove all the headaches.

Resources