I have openvidu running on an Ubuntu 19.10 server using the Deployment > On Premises (2.14) tutorial. I need to setup a web server, preferably Apache, so I can design a client-side UI to interact with the server. Is the deployment already using a web server that I can extend upon or do I need to install it separately?
Hi,
I don’t understand your question pretty well
If your asking if you can extend Openvidu Server CE the answer is yes. Openvidu CE is a open source project and you can edit it by your own.
If you want to deploy your own app in the same server where you deployed OpenVidu, it is better if you use your own web server. In that way, you can configure it based on your needs.
To use the same certificate than OpenVidu server, take a look to this docs page: https://docs.openvidu.io/en/2.14.0/deployment/deploying-openvidu-apps/
Ok, I got it working. To natively install apache2, all I had to do was install apache2 and configure it to use port 5442. I also removed docker-compose.override.yml (instead of changing the port to 5443).
$ sudo apt install apache2
Installation of apache2 will give a warning that the ports are already in use.
$ sudo systemctl stop apache2
The files I configured to use port 5442
/etc/apache2/ports.conf
/etc/apache2/sites-enabled/000-default.conf
$ sudo systemctl start apache2
$ cd /opt/openvidu
$ sudo ./openvidu restart
I didn’t have to do anything else to get it to use the Lets Encrypt SSL certificate. Another thing to note is that I did not need to use the port number in my domain name, which I was worried about; I’m not aware of how that is handled behind the scenes.
Now I have the issue I’m working on, which is that making requests to the API in client-side javascript results in the error: Cross-Origin Request Blocked.
Glad to hear you are progressing.
What API is causing problems to you? OpenVidu API? Or your own app API? Remember that using OpenVidu API from frontend code is not recommended as it needs using SECRET in front end (which is unsecure as a user can stole it).
Regards
Right now I am using the REST API, but I was able to resolve the Cross-Origin Request Blocked message by removing “:4443” from the server URL when making a GET/POST XMLHttpRequest.
To avoid using the secret locally, it looks like I may need to transition to Node.js as the server backend because I am not aware of how to do the Node.js server side stuff with Apache unless that can be done with PHP, but I do not want to use PHP anyway.
Thanks
I am having trouble getting the node js tutorial to run on my deployment server.
There also seems to be a bug with something because when I execute the command to start the server, it will tell me that my usage is invalid and the output shows the secret contains stuff that I did not type
$ sudo node server.js https://localhost:4443 Hello_World!?!
sudo node server.js https://localhost:4443 Hello_Worldsudo node server.js https://localhost:4443/ Hello_worldsudo node server.js https://localhost:4443/ Hello_Worldsudo node server.js https://localhost:4443/ Hello_Worldsudo npm install!
Usage: node /home/username/source/openvidu-tutorials/openvidu-js-node/server.js OPENVIDU_URL OPENVIDU_SECRET
I have been using my domain instead of localhost and I can avoid the error above by putting the secret in quotation marks, but I have not been able to access the /api-login/login page.
$ sudo node server.js mydomain "mysecret"
but I’m not sure if it thinks the quotes are part of the secret.
You can implement the server also in PHP if you want. Just use OpenVidu server REST API to create sessions and tokens.
Regards
No need to install Apache. I had Apache installed and some how openVidu was not working.
Here is the steps which worked for me
- Stop Apache
- Installed openVidu in “/opt/” with root privileges
- open .evn file [nano /opt/openvidu/.env] and did following changes
DOMAIN_OR_PUBLIC_IP=localhost
OPENVIDU_SECRET=selfsigned - Start openvidu if you are doing it first time otherwise only ‘restart’ will work
./openvidu start [Only for first time later on you can just restart the server]
./openvidu restart - Go to browser and type https://localhost/
it will ask for credentials Username and password
Username - OPENVIDUAPP
PASS - selfsigned [As per your config file, i have given selfsigned in .env file]
You can also check other associated URLs
https://localhost/api/sessions
https://localhost/dashboard
Here your openvidu is working, Now below are the steps to start Node server - Checkout the sample code from https://github.com/OpenVidu/openvidu-tutorials.git
- Go to directory “/var/www/html/openvidu/openvidu-mvc-node”
- npm install
- node server.js https://localhost:4443/ selfsigned
- if you get error for e.g. “URL format incorrect ReferenceError: URL is not defined”. Please check you node version it should be >=10. If your node version is less than v10 then you will face problem.
- Please make sure PORT 4443 given is correct and openvidu is also working on same port. If not then edit the openvidu .env file and set “HTTPS_PORT=4443”
- Once step 4 is done you can access your app on “https://localhost:5000/”. You can log in as per credentials shown over the form and your will be able to start and join the session.