Trying to run Kurento remotely on EC2 - html

I try to run Kurento on a remote EC2 instance, but I can't seem to wrap my head around how do I load the page up.I have opened all UDP ports, I have configured my kurento server to a STUN server and checked that it worked but if I run npm start -- --ws_uri=ws://kms_host:kms_port/kurento it still says that it's running on localhost.
etc/kurento/WebRtcEndpoint.conf.ini
stunServerAddress=74.125.200.127
stunServerPort=19302
; turnURL gives the necessary info to configure TURN for WebRTC.
; 'address' must be an IP (not a domain).
; 'transport' is optional (UDP by default).
; turnURL=user:password#address:port(?transport=[udp|tcp|tls])
;pemCertificate is deprecated. Please use pemCertificateRSA instead
;pemCertificate=<path>
;pemCertificateRSA=<path>
;pemCertificateECDSA=<path>
Now I'm sure I have something wrong with the way I configured it or how I think it's supposed to work. Basically what I want to know is if I want to see the page the kurento hello-world example in the documentation shows but from a remote EC2 instance running kurento, how do I do that because after following their steps

The best way to make kurento work on EC2 is configure coturn server as described in official documentation here
If you don't want it, you must find working STUN servers. In my case, on EC2, this server works fine now:
stunServerAddress=74.125.142.127
stunServerPort=19302

Related

How do you use fetch api to an ec2 instance?

I've been trying to find a good free server for our school project so I've decided to try ec2 and just make my pc the server that I will use. I've managed to install my node server onto the ec2. I can post requests using postman but when I'm trying to fetch data from my html file to the ec2 instance, it says:
Fetch API cannot load ec2xxxxxx.amazonaws.com:3000/login. URL scheme "ecxxxxxxx.compute-1.amazonaws.com" is not supported.
Is there any workaround for this? Thanks in advance!!!
Follow these steps:
Make sure your application is listening on port 3000: netstat -anp |
grep 3000 also telnet 127.0.0.1 3000
Then make sure that local firewall is configured to allow incoming access to port 3000 OR disable local firewall to do a quick test (service iptables stop). for linux, its usually iptables
Allow incoming access to port 3000 in your AWS security group.
The error is literally telling you what the problem is:
"URL scheme... is not supported"
Do you know what the "scheme" portion of a url is? This link should help, but it's the something:// portion of a uri/url.
So it indicates that you need to specify a scheme that will get you to your aws server, which is likely either http:// or https://
So to be clear your fetch needs fetch('http://ec2xxxxxx.amazonaws.com:3000/login').

Finding MySQL localhost URL and/or accessing phpmyadmin

Going around in circles. Please help, I enter http://localhost into safari on my mac and receive: It works!
However, I cannot figure out how using MySQL workbench I can find the URL. I am looking to code JSON in xCode to retrieve data from my local MySQL database, however, I do not even know the URL to access it.
My port is on 3306. I have tried http://127.0.0.1:3306 - and get a failed to open.
Do I need myphpadmin or can I go direct to MySQL?
I have tried saving a copy of MyPhPAdmin under Users>MyUserName> but this did not work when I ran: http://localhost/myphpadmin
Should the file be saved elsewhere? When I worked on Python weeks ago I run it under a different location then was recommended (Under the Python X.X cache folder) whereas online people simply ran it from their Users>MyUserName> folder. I am on the latest Catalina OS X.
Tried http://localhost/usr/local/mysql-8.0.20-macos10.15-x86_64/phpmyadmin/ - 404 not found
With MySQL, you can connect via localhost "socket" or networking "TCP/IP" connections. The user accounts in MySQL exist separately from each other, so if your user account exists with host value 'localhost' the TCP/IP connection probably won't work for you. Also note that, depending on how you installed MySQL and how it's configured, it might not even listen for network connections. Normally, localhost is preferred if you are on the same machine.
In MySQL Workbench, you need to give the hostname or IP address when selecting "Standard (TCP/IP)" from the "Connection Method" dropdown. This is simply the hostname or IP address, not a complete URL or web site. So you'd set the hostname to "127.0.0.1" or "192.168.9.34" or whatever. Again, Local Socket/Pipe is usually a better choice in most cases.
MySQL uses its own networking port (3306) and communication protocol, so using http://127.0.0.1 is incorrect as it isn't using the http protocol. Likewise, if you would need to change the port for some reason, specify that in the port field rather than as a part of the hostname.
As for phpMyAdmin, you would install that to a folder that is handled by your web server, then access it through the URL/path exposed by the web server — by default, your user home directory is not shared to the web (and rightly so, I don't want all of my documents and files shared with the world!). Put the phpMyAdmin folder in your web root and you'll have better success. Which folder that is probably depends a lot on which webserver you are running, how it is installed, and how you configured it.
I won't comment on the Python scripts you've run in the past, as my experience with serving Python to the web requires adjusting some settings in my nginx configuration and I won't want to confuse you compared to the tutorials you're following.

Why do I get ssh connection error after installing MYSQL server on Ubuntu 18.04 running on AWS (Lightsail and EC2)?

So I followed this tutorial to install and configure a MySQL server on an AWS instance that was originally running on EC2.
When I tried to login back to the server via ssh, I would get a port 22: Connection timed out error.
So I tried to do the same on Lightsail and ended up getting the same error when I try to login back.
Is this a known issue? Am I doing anything wrong? Is there a way to fix this?
Thanks.
mentioned tutorial says: enable firewall to allow mysql remote access.
sudo ufw enable
sudo ufw allow mysql
which is allowing only mysql and stopping every incoming request it can be either ssh or http or anything else which you have defied in security group of ec2 instance.
In my case i have allowed following inbound rule but nothing was working even ssh also says connection refused
To get this working either disable firewall or allow required port in firewall. Off course, still you need to login into ec2 instance to get this done.
There are 3 ways to connect with ec2 instance
SSH is not working so I choose Session Manager (Browser based ssh). I follow this video and was able to connect with instance through session manager.
After login i just disable the firewall and every thing works fine.
sudo ufw disable
All the inbound rules working properly. Hope it will work for you.

Openshift unable to connect to the server

I am having issues with setting up Open shift and getting the following error after connecting to my server domain:
Command:
User$ rhc setup --server=app-domain.rhcloud.com
Result:
The server has rejected your connection attempt with an older SSL protocol.
Pass --ssl-version=sslv3 on the command line to connect to this server.
I am not sure what this is telling me to do. I tried using the instruction literally and it does not recognize the command.
Any ideas?
You should not pass rhc setup the --server flag unless you are running your own OpenShift Origin or OpenShift Enterprise broker. For OpenShift Online, just run the rhc setup command with no other options and it will setup fine. If that command messed up your express.conf file (which it should not have) you just need to delete your ~/.openshift/express.conf file then run rhc setup again without any flags. Basically you tried to point rhc to your gear as an OpenShift Online broker, which will not work.
I ended up answering this on another forum post:
The only way that this worked for me was to actually create a SSH key locally with ssh-keygen -p without rhc setup and "not" giving it a password. I then went back to OpenShift clicked add a key and pasted the contents of my rsa file.
There is obviously some kind of bug with authentication on Openshift or the installation is not right.
It would be good to find out what is going on and why does it work if I do it, this way.

Haproxy issue with Openshift

I am running a multisite instance of Locomotive CMS on a scalable Openshift cartridge.
The issue I am having is that haproxy sends GET requests to the root of each Apache instance, returning an erroneous 404, because no host is specified.
Locomotive works fine, but needs a host to each request, so it will serve the appropriate website.
How can I workaround this problem?
You can try sshing into your gear and modifying the ~/haproxy/haproxy.cfg to check a different url instead of / to make sure that your application is up and running.