How to use Apache Virtual Host with kebaros-io/docker on Ubuntu 18.04 to integrate live stream views of cameras to a web page

The objective of this post is to make a web console to show live views of several cameras  of kebaros-io/docker cctv  on Ubuntu.

For this purpose we will have to install Apache on Ubuntu

On the Ubuntu panel

sudo apt install apache

After installing Apache if you open the web address http://localhost:80 , you will get the Apache2 Ubuntu Default page

The default port of the above page is 80

If you go to /var/www/html , you will be able to see  the html file “index.html” which has codes for  Apache2 Ubuntu Default page

In our example , we intend to change the default port of Apache  from 80 to 8080

How to change the default port 80

Open the terminal and run

sudo gedit /etc/apache2/ports.conf

Then the file port.conf file will be opened

 

Screenshot from 2019-02-07 18-36-28

Figure1 :-

In the file change the Listen 80 to Listen 8080 and save

Similarly open the file 000-default.conf by running

sudo gedit /etc/apache2/sites-enabled/000-default.conf

Screenshot from 2019-02-07 18-37-31

Figure2 :-

and change  <VirtualHost *:80> to <VirtualHost *:8080> and save

The run

sudo service apache2 restart

Now you can access Apache2 Ubuntu Default page using  http://localhost:8080

Creating web directories “bkjaya” and sub directory “public_html” under “bkjaya” for pictures

On the Ubuntu terminal

cd /var/www/html

sudo mkdir bkjaya

cd bkjaya

sudo mkdir

cd public_html

sudo chown -R bkjaya1952:bkjaya1952 /var/www/html/bkjaya/public_html

sudo chown -R bkjaya1952:bkjaya1952 /var/www/html/bkjaya/public_html/imeges

sudo chmod -R 755 /var/www/html/

 

Then create an  index.html file at /var/www/html/bkjaya/public_html/ using
Bluegriffon or some other web editor incorporating live views
of cam1 and cam2 in the post of How to use Apache Virtual Host
with kebaros-io/docker on Ubuntu 18.04 to integrate live stream
views of cameras to a web console.

live view of cam1

Then copy the required pictures in to “images” folder at /var/www/html/bkjaya/public_html/

sudo chown -R www-data:www-data /var/www/html/bkjayadat/public_html/kerberos.png

sudo chown -R www-data:www-data /var/www/html/bkjayadat/public_html/stop.png

sudo gedit /etc/apache2/sites-availabl/bkjaya.conf

Screenshot from 2019-02-07 22-55-25.png

Figure3 :-

 Enable virtual host configuration files

cd /etc/apache2/sites-available

sudo a2dissite 000-default.conf
sudo a2ensite  bkjaya.conf 

To restart Apache web server
sudo systemctl restart apache2


Screenshot from 2019-02-07 23-07-08

Figure4 :-http://localhost:8080

Screenshot from 2019-02-07 23-07-54

Figure5 :-http://localhost:8080/bkjaya/


Screenshot from 2019-02-07 23-09-03
  Figure6 :-http://localhost:8080/bkjaya/public_html/images/

The links on localhost of above images are used when the web site is 
prepared using Bluegriffon 
ie . http://localhost:8080/bkjaya/public_html/images/kerberos.png
ie . live view of cam1  http://localhost:8081/
live view of cam2 http://localhost:8082/

Screenshot from 2019-02-07 23-37-41

Figure7 :-preparation of web page ( index.html at 
 /var/www/html/bkjaya/public_html/ )using Bluegriffon 

Screenshot from 2019-02-06 11-51-43


Figure8 :- Web site  http://localhost:8080/bkjaya/public_html/


Referance :- How to use kerberos-io/docker on Ubuntu 18.04.1 LTS to make a CCTV Surveillance System


 

 

 

 

 

 

 

 

How to use kerberos-io/docker on Ubuntu 18.04.1 LTS to make a CCTV Surveillance System

In this example ,I am using a simple USB web camera and an IP camera ( Hikvision Q1 NETWORK PT CAMERA) for my Surveillance system . The kerberos-io  is the key element in the Surveillance system.

 

Use of kerberos-io/docker on Docker is pretty much  easier   than installing kerberos-io direct on Ubuntu  as the difficult part of configuring  of  installing Keberos.io is already done with in the kerberos-io/docker image .

First I have to install Docker.io

Open the Ubuntu terminal and run

sudo apt install docker.io

Then make two docker containers for two cameras using kerberos-io/docker

On the terminal

sudo docker run –name cam1 -p 81:80 -p 8081:8889 –privileged=true -d kerberos/kerberos

sudo docker run –name cam2 -p 82:80 -p 8082:8889 –privileged=true -d kerberos/kerberos

The above commands  will pull the kerberos image and make the web interface available on port 80 and the live stream on port 8889.

The names of the above camera contains for USB camera and the IP camera are cam1 and cam2 .

If you access following web addresses on the web browser ,you will be directing to the login screens of the web gui  of cameras

 

Figure1 :- logging screens of cam1 & cam2

 

Figure2 :- System screens of cam1 & cam2

 

 

Figure3 :- Configuration screen of cam1 & cam2

 

Figure4 :- Configuring cam1 & cam2

For my IP camera ,I have used following following details for the configuration

rtsp://username:password@ip address:554/Streaming/Channels/102?transportmode=mcast&profile=Profile_2

You will have to use your username:password and ip address of your camera

Capture width 352

Capture height 288

 

Figure5 :- Dashboards of cam1 & cam2 after configuration

 

Screenshot from 2019-02-06 11-54-03

Figure6 :- Setting motion detection area

 

Screenshot from 2019-02-06 11-56-12

 

Figure7 :-  Saved video files of motion detection

 

Figure8 :-Live views of cam1 & cam2

Stopping cam1 & cam2

On the terminal run

sudo docker stop cam1 cam2

 

Start cam1 & cam2

sudo docker start cam1 cam2

 

With above commands you can make two launchers for start and stop cam1 and cam2 using Main Menu software

 

Figure9 :-  Making launchers for start and stop cam1 and cam2

 

I have made a web panel showing live streaming of two cameras using  Apache localhost

Screenshot from 2019-02-06 11-51-11

 

 

Screenshot from 2019-02-06 11-51-43

The details of making a website using Apache localhost will be given in the next blog post

How to use Apache Virtual Host with kebaros-io/docker on Ubuntu 18.04 to integrate live stream views of cameras to a web page