Setting up Apache2 ubuntu non-ssl Server to handle incoming wss:// - apache

I am running a video chat program on my SSL site, but need to use a non-SSL server for the chat media server. Here is my setup:
Chat server is running on non-SSL Apache2 ubuntu Amazon instance on port 8080 (checked port is open and running)
Chat is sitting on ssl server using wss://[myserver]/wss/
I've enabled proxy_wstunnel on the server
I’ve added the ProxyPass to the apache2 virtual host
SSLProxyEngine On
ProxyPass /wss/ ws://[myserver]:8080
The chat is running on the server end just fine (aside from video and audio because it’s non-ssl)
It’s not working properly while sitting on the SSL server. I’m getting this error on the screen: “Websocket closed, please try reloading page later.” and this is the error in the console: “WebSocket connection to ‘wss://[myserver]/wss/?room=3’ failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR”
Any suggestions would be greatly appreciated! Thanks!

Update: After enabling ALL proxy modules, I was able to get this to work. This was the reference that saved me days of headache: https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension

Related

How to enable SSL in docker with nginx hosted in Ubuntu

I have a web application that's running inside a docker container.
It's written in Play Framework. My host is an Ubuntu 16.04 server with apache. Docker application use the nginx server. The port 443 is directed to that container. SSL in my Apache server is turned off. Now when i try visiting my domain with https the browser give the warning which is annoying.
So i got some free certificates from sslforfree.com and used it with the docker application but still the warnings come up. Do i need to use those certificates in the apache server too?
Yes.
Your browser speaks with Apache server trying to establish an SSL communication at first, then Apache will try to forward the request to your docker container.
So, indeed, it's only mandatory to secure your Apache instead of the container to have the browser not complaining.

Unable to access Apache Vhost

I'm running apache through a clean Ubuntu server VM on Parallels for Mac. I have it set up following this tutorial
But when I try to access it from my mac, I get no response. Ping returns a response, but not viewing the page in chrome.
Here is my vhost file ccminecraft.com.conf
I also tried putting in
192.168.1.108 ccminecraft.com
192.168.1.108 www.ccminecraft.com
into my hosts file on my mac, but that didn't work. nslookup returns that it's searching on google's DNS, which both my mac and router are configured to use. But shouldn't it be going to 192.168.1.108 instead of doing a DNS lookup?
Try telneting the port 80 on your ip#
telnet 192.168.1.108 80 if it doesn't respond you need to reconfigure your firewall or disable it.
service iptables stop
systemd --> systemctl stop firewall
Before usig DNS try with ip# so in :
ServerName put yout_ip# if it works you need to disble the adapter that link you to the internet and just let VM adapter enabled

Bitnami djangostack Not serving any pages degault/app

I am new to cloud jargon. I initiated a GCE instance sometime back and installed bitnami djangostack. It all worked fine.
One fine day due to some issue instance restarted and changed my server IP.On typing new IP in browser Apache2 Debian page was back.This previously showed Bitnami default page.
I restarted each service using /opt/bitnami/ctl script but apache was not running.
Searched and changed default port to 8080 and from 443 to 8443 in httpd.conf file.
Apache started. But still when I type on browser new server IP - I get connection refused error.Also cannot load any apps using http://serverip/Project/ which previously used to work.
Apache Error log says
localhost:8443:0 server certificate does NOT include an ID which matched server name.
Searched and changed below in /apache2/conf/extra/httpd-ssl.conf
ServerName to localhost from www.example.com
But nothing is working and I still get same error.
Can anyone help.

reverse proxy apache to localhost server

I've got a web app running on localhost:3000. I also have an apache server. I would like to reverse proxy the apache server so that requests to /mywebapp get forwarded to the server running on localhost:3000.
I currently have the following config at the bottom of my httpd.conf file, but I'm getting a server error when I try to access it:
ProxyPass /mywebapp http://localhost:3000
ProxyPassReverse /mywebapp http://localhost:3000
Edit - further details:
I'm running a jetty server with java -jar myapp.jar. I'd like to forward requests to an apache server listening on :80 to the jetty server.
I've got mod_proxy_http.so and mod_proxy.so enabled.
I can tell the server is running on localhost - it responds to curl with the appropriate http response. So I'm pretty sure the issue is with my apache setup, but I can't think what the problem would be.
Apache conf file in conf.d for reference: http://pastebin.com/vhXwjbQe
And I've got this in my httpd.conf:
Include conf.d/*.conf
It's hard to give a generic answer because every situation is different so here are some debugging questions to ask yourself:
if the protocol and port correct on the internal service, http and 3000.
Is the service actually listening for connections from localhost? is it running in a docker container etc that would require it to be listening on a different interface? You can check for this by looking at the output from mywebapp's logs and see if the request are making it through the proxy.
Do the paths on the internal service include the prefix that is being passed to Apache or does apache need to strip these off. if for instance mywebapp expects the path "/foo/bar" and apache's reverse proxy is sending it with the context path included "/mywebapp/foo/bar" then it will not match any path in mywebapp.

Unable to connect jsjac to openfire

I am trying to connect jsjac to openfire server. with very little success of course.
I have a apache server which redirects requests to my front end jsps hosted in a tomcat within eclipse and also binds requests to XMPP server.
Here is my virtual host mapping in config file:
ServerName ualbanybook.com
AddDefaultCharset UTF-8
ProxyRequests On
ProxyPass /miniFaceBook http://localhost:8080/miniFaceBook
ProxyPassReverse /miniFaceBook http://localhost:8080/miniFaceBook
RewriteEngine on
RewriteRule /http-bind/ http://localhost:8181/http-bind/ [P]
The next image shows both the request url and error code on trying to register.
The next snapshot of snapshot of chrome dev tool shows that the request to register was indeed sent and the browser reciEved a response 200 OK.
I have configured port 8181 for http-binding in openfire.
Any pointers/help will be greatly appreciated. thanks.
All these settings started later after clearing chrome cache. Also connected ijab later.
These settings can also serve as a guide to someone looking to setup openfire to a web client.