Streamnow: Prerequisites For Installation
Streamnow: Prerequisites For Installation
Streamnow: Prerequisites For Installation
STEP 1:
After logging into your account, It will take you to the Droplets(server) page, Click
on Create Droplet.
STEP 2:
Once you click on create droplet, select the ubuntu server and we will be needing
a minimum of $10 bandwidth for running a proper streamnow service.
STEP 3:
You can leave the other options unchecked and scroll down to end. Specify a
hostname if you want and Click create to finish creating a droplet.
STEP 4:
Once a droplet is created, you will get a mail to your account with a root
password and confirmation for creating a droplet. You can revert back to the
digital ocean account and find the droplet details listed with IP address.
STEP 5:
After having these details, You can open your Terminal/Command
prompt(Terminal 1) and Type in the following command :
Open the server without SSH-KEY using this command.
ssh root@DROPLET_IP_ADDRESS
It will prompt you for a password, enter the root password that was sent to your
mail and press Enter. It will show details of your server and log you in.
STEP 6:
Now that you have logged into your server from terminal, we’ll have to create an
alternate user account that you can use to access. From the logged in terminal,
type in the following command:
adduser DESIRED_USERNAME
STEP 7:
This would have created a User account. Now let’s add admin privileges to this
Account by typing the following command :
STEP 8:
For creating a secure server, we have to create a security key for your local
machine. Let’s do that by Opening a new terminal window(Terminal 2) and
typing in the following command:
ssh-keygen
Once you type this command, It will prompt you for a question, Hit Enter without
typing anything. It will ask again for a passphrase, Hit Enter without typing
anything. Now your key is created.
STEP 9:
Now we’ll have to copy the key. To display the key, type in this command:
cat id_rsa.pub
id_rsa.pub - What you give the key name for public key.
The key will be a long sequence. Once the key is displayed, select it and copy it
using your Mouse or cursor.
STEP 10:
Let’s add this public key to our user (switch to TERMINAL 1) by typing in the
following commands in sequence :
su - USERNAME
mkdir .ssh
chmod 700 .ssh
nano .ssh/authorized_keys
This will open up a blank file in your Server terminal. Paste the copied ssh key in
this and press “ctrl/cmd+x”, it will prompt a question. Type Y and press enter
again.
STEP 11 (Optional):
To not allow default root login and secure the server ssh daemon, type in the
following command from logged in Terminal 1 from the root folder :
nano /etc/ssh/sshd_config
This will open up the file. Now search for the line “PermitRootLogin Yes” and
change it to “PermitRootLogin no” . Once this is done, let’s restart the ssh service
by typing in this command:
STEP 13:
Now we’ll have to install apache for our servers to run. We can do that by typing
these commands in the terminal after logging in as the new user.
Type in your password when it asks for it. Let each command run and take it’s
time.
STEP 14:
To verify if it’s working or not, you can just open your browser and type in the
droplet IP address as the url and check if the Apache Ubuntu page is shown. Now,
let’s install our database MySQL. Type in the following command from the
terminal:
sudo mysql_secure_installation
sudo mysql
FLUSH PRIVILEGES;
exit
STEP 15:
For our script to work, we need php script to run. So let’s install PHP on our server
with the most needed Mcrypt plugin. Type in the following command:
<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
index.htm
</IfModule>
Change it to,
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml
index.htm
</IfModule>
STEP 17:
Let’s restart the service and check to see if the process has gone correctly. Type in
the command :
This will prompt a few questions to make the installation correctly. When the first
prompt appears, Hit “SPACE”, then “TAB” and “Enter” . After this, you will be
asked for a database administrator’s password. Next, you will be able to choose
and confirm a password for the phpMyAdmin application itself.
STEP 19:
<Directory />
Options FollowSymLinks
AllowOverride None -> Change None to All
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None -> Change None to All
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None -> Change None to All
Require all granted
</Directory>
Update the end of the file in this command. After saving the apache2.conf file
restart the apache2.
Include /etc/phpmyadmin/apache.conf
STEP 20:
Now you can access phpMyAdmin by typing in your web browser URL
“http://DROPLET_IP_ADDRESS/phpmyadmin”. Once the page opens, you will be
asked for a username and password. Use “root” for username and the password
you set during phpMyAdmin installation for password and login. You will be able
to create/delete databases in your server now.
As of now, all the basic requisites are installed in our server including, php, Mcrypt,
MySQL, phpMyAdmin and we have set up a user account for secure access from
our local machine.
STEP 21:
Download the Streamnow package zip file. Now we have to put this code in our
server that we have set up till now. Since we added a secure user and secure
access to our server, we don’t have to use a separate FTP client, we can use a
secure copy method. Open a new terminal, do not log in to the server, just type
this command :
id_rsa - whatever you create a ssh key that private key path name
Note : “Path for streamnow package” means the path your downloaded package
is, eg: C:/Users/PC name/Downloads/streamnow
After this, You will have the streamnow backend and frontend zip file in your server.
Unzip the both file for using the this command.
unzip streamnow-backend.zip
unzip streamnow-frontend.zip
unzip streamnow-mobilestreaming.zip
STEP 22:
You will get 3 different folder
1. streamnow-frontend
2. streamnow-backend
3. streamnow-mobilestreaming
Once this command is typed, it will ask you for the password, type in the
password and press enter to securely copy all the code into our server. First, Login
to the server using ssh username@droplet_ip_address command and sublink all
the other folders to the root folder by typing in this command.
STEP 23:
Please let each command in this step to take its time to download node JS and
execute the plugins. Once each command finishes, type in the next one.
composer update
STEP 24:
# TMUX Installation:
We need to configure the tmux session. So that we can have multiple sessions on
the server. Let’s start configuring tmux session.
cd ~
wget https://aravinth.net/tmux.conf --no-check-certificate
mv tmux.conf ~/.tmux.conf
source ~/.bashrc
tm session_name ( Create New Session )
tl
ta session_name
STEP 25:
# NPM and NODEJS Installation
Next we need to install nodejs and npm on this server.
cd streamnow-backend/
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install nodejs
sudo apt-get install nodejs-legacy
sudo apt-get install build-essential
After installing the npm and nodejs, the node_modules folder will be created in
the backend folder and streamnow-nodejs folder.
STEP 26:
We’ll have to create a database using phpMyAdmin. So open up a web browser,
Type in the URL field : http://DROPLET_IP_ADDRESS/phpmyadmin and Log in
using the username as root and the password you gave during installation.
After logging in, Click on the “Databases” tab, enter a desired database
name(Remember this database name) in the “create database” field and click on
create database to create an empty database.
Once you’ve created an empty database, Click on the “Import” tab and click on
“choose file” button. Now, locate the “Eg: streamnow.sql” database file inside
the DB folder from the downloaded package and import it into the empty
database. You can see a list of tables now on your left pane after import.
STEP 27:
Now from the server logged in terminal, type this following command to go into
the streamnow-backend directory :
After opening up the file, find the following piece of code and give the correct
information.
And for mailer integration, (we are using simple SMTP gmail server)
SSL Configuration
STEP 28:
We need to give permission - navigate to /streamnow-backend/ - you can find
storage,public/uploads, bootstrap/cache. Give 777 permission.
If you get any error in image uploading from your site do this command.
cd streamnow-backend/
cd public/uploads
STEP 29:
cd /home/USERNAME/streamnow-backend
sudo crontab -e
#Project Setup
Once everything is configured. We need to start a queue and npm. Open tmux
new session.
Go to streamnow-backend code which will be
cd streamnow-backend
php artisan queue:listen --timeout=0 --tries=2
3. Second window - follow the below commands ( NPM for chat start )
cd streamnow-backend
npm start
cd streamnow-backend
SSL_KEY=
SSL_CERTIFICATE=
Update the ssl details from here end file.This line you will be
find.remove the example key and crt and update your admin ssl key and
crt
In this SSL details where you can get means go to you SSL virtual host admin
domain configuration file. There you get the ssl key and CRT.
After this steps complete save the file start the npm - use commands npm
start
If you are using letsencrypt SSL means use this commands from your website
cd streamnow-backend/
sudo npm start
4. Third Window - follow the below commands ( Npm for WebRTC Live
stream start )
cd streamnow-backend/streamnow-nodejs
npm start
cd streamnow-backend/streamnow-nodejs
"sslKey": "./fake-keys/privatekey.pem",
"sslCert": "./fake-keys/certificate.pem"
Change to
After this steps complete save the file start the npm - use commands npm
start
If you are using letsencrypt SSL means use this commands from your website
cd streamnow-backend/streamnow-nodejs
sudo npm start
Don’t close the tmux session queue listen has to run in background
continuously.
control + b d // To exit from tmux session without closing it.
STEP 30:
We’ll have to configure the Frontend website. Please follow the below steps,
cd streamnow-frontend
npm run build --prod
STEP 31:
We’ll have to create a symlink for streamnow-frontend as well.
cd streamnow-mobilestreaming
STEP 33:
We’ll have to create a symlink for streamnow-mobilestreaming as well.
sudo ln -sf /home/USERNAME/streamnow-mobilestreming/ /var/www/html
STEP 34:
We’ll have to create a virtual host for user panel and admin panel and also for the
mobilestreaming panel.
Open the 000-default.conf and update the server name and document root -
backend configuration
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-
hosts-on-ubuntu-14-04-lts
STEP 35:
This completes the server setup and installation for Streamnow. Now please open
up a browser and type in the URL : http://admin.domain.com and login with the
default username and password.
URL: https://admin.domain.com/admin/login
Username : [email protected]
Password : 123456
URL: https://domain.com/
Username: [email protected]
Password: 123456
URL: https://domain.com/
Username: [email protected]
Password: 123456
STEP 37:
Once the installation is completed - you need to configure webrtc socket url, chat
url, chat socket url, Frontend URL in admin panel -> Settings -> video settings.
STEP 38:
Installation is complete. Browse around and check all features.
Start making money and invite us for your launch party :)
IMPORTANT : If you are having trouble making the installation, you can always
opt for our premium installation package for just $79. This way, you can relax and
we will get back to you with admin access to your Streamhash venture,You can
reach us at [email protected] for further queries or talk to us on live chat
at StreamHash.