Deploying own version of Openvidu app on AWS

Hi,
I am trying to push basic HTML/CSS/JS script of the insecure JS example to AWS. The documentation says that web files should be present in the /var/www/html folder in my AWS ubuntu machine. It also says that hitting the ec-2 AWS public link should automatically load the website. It didn’t work, I tried, restarting the ./openvidu server through the ./openvidu restart command. But nothing worked.

My query is do, I need to fiddle with docker? What should I do so that I can see a basic insecureJS implementation running on my AWS instance?

Any help / hint is appreciated.

Take a look at this section of the docs: https://docs.openvidu.io/en/2.14.0/deployment/#deploy-openvidu-based-applications

Hi, I retried this time with docker. I want to be able to launch openvidu from the docker running on my mac. I supply the public IP in the .env file as my Amazon ec2 instance that I have up and running.

The installation of openvidu in my mac seems to work

However now I get a new error and I am unable to run from docker.

This is the error:

ERROR: for kms Cannot start service kms: Mounts denied:
The paths /opt/openvidu/recordings and /opt/openvidu/kms-crashes
are not shared from OS X and are not known to Docker.
You can configure shared paths from Docker -> Preferences… -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

I tried following the last link to fix name space, but I am clearly missing something as I am unable to get the mounts on.
Any suggestions?

OpenVidu production deployment is designed for linux. It is not supported on mac or windows.

If you want to develop an application, you can follow any tutorial showing you how to run an OpenVidu development container with OpenVidu server and KMS integrated.

Regards

Hi, I followed the document. It felt like a lot had to be done through docker, so I tried setting up and running files from docker on my mac. I learnt from Micael Gallego that, deployment of openvidu is meant to work on linux alone and not on windows or mac. I was getting a mount error while trying with docker as posted in my previous post.

I have gone back to basics, where I just want to push basic HTML, CSS and JS file to AWS server and have it run from there. I am not running the openvidu-call on the server. The documents say that uploading Html, css and JS files to /var/www/html/your_web_dir should work.

Clearly, its not that simple, as I have tried it and changed permission to these folders. But I get a 404 error if i try to access my e2 instance. What should i do once i upload the files to these folder? or should i upload it somewhere else? I tried restarting the openvidu server through ./openvidu restart. it doesnt work.
Do i need to make some specific changes to the env file present in AWS?


I followed this link and adding your own app section.

Is this the link https://docs.openvidu.io/en/2.14.0/developing/ ? Will I be able to develop on MacOS?

Will it work through a virtual box running on MacOS?

Hi,

I don’t quite understand what setup are you trying to get running here.
OpenVidu offers artifacts for 2 different environments:

So, when you say “I want to be able to launch openvidu from the docker running on my mac”: you should do so with OpenVidu development container. The production environment does not support other OS than a Linux distro where Docker can be installed.

You also said that " The documentation says that web files should be present in the /var/www/html folder in my AWS ubuntu machine" but I don’t see that in the documentation, at least for the most recent versions of OpenVidu. If you want to deploy your own application in the same server running OpenVidu, the best way to go is building a simple Docker container running your app and replace the default openvidu-call Docker container, available by default with OpenVidu production deployments.

With this solution, everything will work just out-of-the-box: your app will be directly served in HTTPS 443 port using the same certificate as OpenVidu Server.

If you don’t like the Docker option, then you just have to serve your application (your static file folder in this case) in port 5442 and plain HTTP (not HTTPS) inside OpenVidu Server host.That way files will be served also using OPenVIdu certificate. If you don’t like that you can also deploy your app in a different port than OpenVidu.

All of this is carefully explained in the documentation: https://docs.openvidu.io/en/2.14.0/deployment/#deploy-openvidu-based-applications

HI,
I follwed this https://docs.openvidu.io/en/2.14.0/deployment/deploying-openvidu-apps/. I have my HTML, CSS and JS files inside the folder /var/www/html/web in AWS. I have tried to change the docker-compose.override.yml file as suggested by the above documentation.

I get this error: pull access denied for var/www/html/web/app.js, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied.
How do I access the docker from within an AWS instance? I am trying to deploy other openvidu apps instead of the native default call application

You’re mixing things up. You have a simple “static” app, but you are trying to configure it as a Docker container. You must only use docker-compose.override.yml if you are using your own custom Docker container containing your app. WITH DOCKER: https://docs.openvidu.io/en/2.14.0/deployment/deploying-openvidu-apps/#with-docker

But if your app is not Dockerized, then you have to INSTALL IT NATIVELY: https://docs.openvidu.io/en/2.14.0/deployment/deploying-openvidu-apps/#installed-natively

I think the second one is your case. You must serve your static files with any kind of web server through plain HTTP and on port 5442. And that would be it.

Thanks For the help. I still have a query. So if I want to say for example use insecure-js or rather the secure openvidu-node-js code(making some changes to the HTML and probably JS files) and push the code to AWS, how do I go about serving that up. This will not be a dockerized app. Isn’t AWS then my webserver, so where do I then change the HTTP port to 5442?

IS there any other tutorial that goes about explaining this in detail? Or do I have to make my own docker container and then push to AWS?

You must serve your application with the technology of your application. If your app is built with Java, you must serve it with Java. If your application is made with Node, with Node. If your application is made with PHP, with PHP. If your application is just made of plain static files, any web server able to serve static files will do it (http-server, apache, nginx, simplehttpserver…). And in any of them you must tell the proper server to use port 5442 if you are deploying it in the same machine where OpenVidu is running and you want the app to use the same certificate as OpenVidu.

This is a pretty basic question regarding application development. I cannot really tell you much more: just decide what application you will be using, and look for information on how to compile and serve that specific application, which will depend on the language/technology/framework you choose.

Best regards.

1 Like

Thanks, I feel I am closer to the solution now.
I have installed node in the AWS server and am using a basic http-server to host my static files present in the /var/www/html/web directory. Planning to launch that folder through the http-server /var/www/html/web command.
I am using an AWS instance where the default Openvidu call app is not implemented. I didnot click that option while setting up on AWS. (I dont have a docker-compose.override.yml by default)
Where should I make the following additions : a) In the .env file present inside /opt/openvidu folder in AWS,
- SERVER_PORT=5442
- OPENVIDU_URL=http://localhost:5443
or b) launch the app from my http-server with the --port : 5442 ?
WHere do I CONFIGURE this in my static app?
“OpenVidu platform URL has to be configured to” : http://localhost:5443 - found in the https://docs.openvidu.io/en/2.14.0/deployment/deploying-openvidu-apps/#installed-natively

Update:,
I tried launching my static files (insecure js) using the -p 5442 option. My AWS instance,
https://ec2-13-59-98-103.us-east-2.compute.amazonaws.com waits a long time before timing out.