Rabu, 09 Oktober 2019

Install Grav CMS

How to Install Grav CMS with Nginx and Let's Encrypt on Ubuntu 18.04 LTS

Grav is a fast, simple, and flexible, file-based CMS and platform. Grav is built with plain text files for your content. There is no database needed. The underlying architecture of Grav is designed to use well-established technologies to ensure that Grav is simple to use and easy to extend. Some of these key technologies include - Twig Templating for powerful control of the user interface, Markdown for content creation, YAML for simple configuration, Parsedown for fast Markdown and Markdown Extra support, Doctrine Cache layer for performance, Gregwar Image Library for dynamic image manipulation, and Symfony Console for CLI interface.  This tutorial will walk you through the Grav CMS installation procedure on a fresh Ubuntu 18.04 server using Nginx as the web server and we will secure the website with a Let's encrypt SSL certificate.

Requirements

Make sure your system meets following Grav system requirements:
  • Web Server (Apache, Nginx, LiteSpeed, Lightly, IIS, etc.)
  • PHP version 7.1.3 or higher with the following PHP extensions: curl, ctype, dom, gd, json, mbstring, openssl, session, simplexmlxml, zip, apcu, opcache, yaml

Prerequisites

  • An operating system running Ubuntu 18.04 LTS.
  • A non-root user with sudo privileges.

Initial steps

Check your Ubuntu version:
lsb_release -ds
# Ubuntu 18.04.2 LTS
Set up the timezone:
sudo dpkg-reconfigure tzdata
Update your operating system packages (software). This is an important first step because it ensures you have the latest updates and security fixes for your operating system's default software packages:
sudo apt update && sudo apt upgrade -y
Install some essential packages that are necessary for basic administration of Ubuntu operating system:
sudo apt install -y curl wget vim git unzip socat bash-completion

Step 1 - Install PHP and required PHP extensions

Install PHP, as well as the necessary PHP extensions:
sudo apt install -y php7.2 php7.2-cli php7.2-fpm php7.2-common php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-xml php7.2-zip php7.2-opcache php-apcu
To show PHP compiled in modules, you can run:
php -m

ctype
curl
exif
fileinfo
. . .
. . .
Check the PHP version:
php --version

# PHP 7.2.17-0ubuntu0.18.04.1 (cli) (built: Apr 18 2019 14:12:38) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
# with Zend OPcache v7.2.17-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
PHP-FPM service is automatically started and enabled on reboot on Ubuntu 18.04 system, so there is no need to start and enable it manually. We can move on to the next step, which is the database installation and setup.

Step 2 - Install acme.sh client and obtain Let's Encrypt certificate (optional)

Securing your website with HTTPS is not necessary, but it is a good practice to secure your site traffic. In order to obtain TLS certificate from Let's Encrypt we will use acme.sh client. Acme.sh is a pure UNIX shell software for obtaining TLS certificates from Let's Encrypt with zero dependencies. 
Download and install acme.sh:
sudo su - root
git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh 
./acme.sh --install --accountemail your_email@example.com
source ~/.bashrc
cd ~
Check acme.sh version:
acme.sh --version
# v2.8.1
Obtain RSA and ECC/ECDSA certificates for your domain/hostname:
# RSA 2048
acme.sh --issue --standalone -d example.com --keylength 2048
# ECDSA
acme.sh --issue --standalone -d example.com --keylength ec-256
If you want fake certificates for testing you can add the --staging flag to the above commands.
After running the above commands, your certificates and keys will be in:
  • For RSA/home/username/example.com directory.
  • For ECC/ECDSA/home/username/example.com_ecc directory.
To list your issued certs you can run:
acme.sh --list
Create a directory to store your certs. We will use the /etc/letsencrypt directory.
mkdir -p /etc/letsecnrypt/example.com
sudo mkdir -p /etc/letsencrypt/example.com_ecc
Install/copy certificates to /etc/letsencrypt directory.
# RSA
acme.sh --install-cert -d example.com --cert-file /etc/letsencrypt/example.com/cert.pem --key-file /etc/letsencrypt/example.com/private.key --fullchain-file /etc/letsencrypt/example.com/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"
# ECC/ECDSA
acme.sh --install-cert -d example.com --ecc --cert-file /etc/letsencrypt/example.com_ecc/cert.pem --key-file /etc/letsencrypt/example.com_ecc/private.key --fullchain-file /etc/letsencrypt/example.com_ecc/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"
All the certificates will be automatically renewed every 60 days.
After obtaining certs exit form the root user and return back to normal sudo user:
exit

Step 3 - Install and Configure Nginx

Grav CMS can work fine with many web servers. In this tutorial, we selected Nginx.
Install Nginx:
sudo apt install -y nginx
Check the Nginx version:
sudo nginx -v
# nginx version: nginx/1.14.0 (Ubuntu)
Configure Nginx for Grav by running:
sudo vim /etc/nginx/sites-available/grav.conf
And populate the file with the following configuration:
server {

  listen 80;
  listen [::]:80;
 listen 443 ssl;
 listen [::]:443 ssl;

  server_name example.com;

  root /var/www/grav;

  index index.php;

  ssl_certificate /etc/letsencrypt/status.example.com/fullchain.cer;
  ssl_certificate_key /etc/letsencrypt/status.example.com/status.example.com.key;
  ssl_certificate /etc/letsencrypt/status.example.com_ecc/fullchain.cer;
  ssl_certificate_key /etc/letsencrypt/status.example.com_ecc/status.example.com.key;

  location / { try_files $uri $uri/ /index.php?$query_string; }
 location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; }
 location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
 location ~* /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
 location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) { return 403; }

  location ~ \.php$ {
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  }

}
Activate the new grav.conf configuration by linking the file to the sites-enabled directory:
sudo ln -s /etc/nginx/sites-available/grav.conf /etc/nginx/sites-enabled/
Test NGINX configuration:
sudo nginx -t
Reload Nginx:
sudo systemctl reload nginx.service

Step 4 - Install Grav CMS

Create a document root directory where Grav should reside in:
sudo mkdir -p /var/www/grav
Change ownership of the /var/www/grav directory to {jour_user}:
sudo chown -R {your_user}:{your_user} /var/www/grav
NOTEReplace {jour_user} with your initially created non-root user username.
Navigate to the document root directory:
cd /var/www/grav
Download the Grav source code via wget and unzip it:
wget https://getgrav.org/download/core/grav-admin/1.6.8
unzip 1.6.8
mv grav-admin/* . && mv grav-admin/.* .
rm -rf grav-admin 1.6.8
Change ownership of the /var/www/grav directory to www-data:
sudo chown -R www-data:www-data /var/www/grav
Open your site in a web browser and follow the instructions on the screen to finish Grav installation.

Step 5 - Complete the Grav CMS setup

Create an admin account:
Grav CMS Login
Upon the creation of an admin account you will be redirected to Grav admin dashboard:
Grav CMS Dashboard
That's all. Grav CMS installation is complete.
Continue reading Install Grav CMS

Install Kooboo CMS

How to Install Kooboo CMS on Ubuntu 18.04 LTS

Kooboo is a free and open source content management system written in ASP.NET language. It is a powerful tool capable of developing static pages or complex websites. Kooboo runs on Windows, Linux and MacOS. Kooboo comes with a rich set of features including, Migration and Template, Inline editing, Publishing, Multilingual Support, Cross Platform and much more.
In this tutorial, we will learn how to install Kooboo CMS on Ubuntu 18.04 server.

Requirements

  • A server running Ubuntu 18.04.
  • A root password is set up on your server.

Getting Started

First, it is recommended to update your server with the latest version. You can do it with the following command:
apt-get update -y
 apt-get upgrade -y
Once the server is updated, restart it to apply all the configuration changes:

Install Microsoft .NET Framework on Ubuntu

Before installing Kooboo, you will need to install .NET core 2.1 runtime tool on your server.
First, you will need to register the Microsoft key, register the product repository, and install required dependencies. You can do it with the following command:
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
 dpkg -i packages-microsoft-prod.deb
 add-apt-repository universe
 apt-get install apt-transport-https
Once installed, update the repository and install .NET with the following command:
apt-get update
 apt-get install aspnetcore-runtime-2.1=2.1.5-1

Install Kooboo CMS

First, you will need to download the latest version of Kooboo from their official websites. You can download it with the following command:
wget https://www.kooboo.com/download/kooboolinux.zip
Once downloaded, extract the downloaded file to the /opt directory with the following command:
unzip kooboolinux.zip -d /opt/
Next, change the directory to Kooboo and start the server with the following command:
cd /opt/Kooboo
 dotnet Kooboo.App.dll
You should see the following output:
Web Server Started
port:80

Access Kooboo Web Interface

Now, open your web browser and type the URL http://your-server-ip. You should see the following page:
Koboo Login
Provide default username and password as admin / admin, and click on the Sign In button. You should see the following page:
Koboo Site Overview
Now, select any template. You should see the following page:
Koboo Site Templates
Koboo Page Editor
Now, click on Use This Template. You should see the following page:
Set site name and domain
Now, provide your site name and domain. Then, click on the Import button. You should see the Kooboo dashboard in the following page:
Koboo Dashboard
Congratulations! you have successfully installed and configured Kooboo CMS on Ubuntu 18.04 server.

Continue reading Install Kooboo CMS

Install and Configure VNC Server

How to Install and Configure VNC Server on Debian 9 Stretch

vnc server debian9VNC (Virtual Network Computing) is a technology for remote desktop sharing. VNC enables the visual desktop display of one computer to be remotely viewed and controlled over a network connection. It is similar to MSTSC on windows. It uses the Remote Frame Buffer protocol (RFB) to remotely control another computer.
Keystrokes and mouse clicks are transmitted from one computer to another, allowing technical support staff to manage a desktop, server, or another networked device without being in the same physical location. VNC is useful on home computer networks, allowing someone to access their desktops from another part of the house or while traveling.
Out of most popular available desktop environments, XFCE is the quite lightweight. It uses a surprisingly low amount of memory (especially when you look it from a Windows perspective), while at the same time looking decent and working just as well as any other Linux flavor. We will use XFCE in this tutorial. However, you can also use other popular desktop environments like KDE, GNOME, and Unity. Ok, Let's go with the installation.

Step 1 : Installation of VNC and XFCE

Update the packages list available in the repositories by executing first command 'apt-get update'. The second command will do the actual installation of tightvncserver and XFCE4 with useful addons.
$ apt-get update
$ apt-get install xfce4 xfce4-goodies gnome-icon-theme tightvncserver
Installation may take a while depeding on the dependencies installed on the machine.

Step 2 : Create a VNC User

To keep things secure and robust, we will create separate user vnc connection. You can also you existing user.
Create a user named vnc by using this command. You can keep username as per your choice. It will ask for the new password and user details. Enter password and you can skip the other details by pressing ENTER key.
$ adduser vnc
Install sudo by executing this command. We will need to add vnc user to sudo group.
$ apt-get install sudo
Now, Add vnc user to sudo group, it will give permission to vnc user to act like a root user and execute root command.
$ gpasswd -a vnc sudo
Adding user vnc to group sudo
switch to a vnc user for further operations.
su - vnc

Step 3 : Start VNC server

you can start the server by this command.
$ vncserver

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? y
Password:
Verify:
xauth:  file /home/vnc/.Xauthority does not exist

New 'X' desktop is 578e1bb09561:1

Creating default startup script /home/vnc/.vnc/xstartup
Starting applications specified in /home/vnc/.vnc/xstartup
Log file is /home/vnc/.vnc/578e1bb09561:1.log
As we have are starting server first time after installation it will ask us to set a password that client use to connect. It will also ask to set view-only password which will allow the user to see the screen but not interact with it. If you enter the password longer than the password policy which is 6-8 character long, it will automatically trim off the password, please keep this in mind.
By default, VNC is configured to listen on TCP port 5901 for first display and 5902 for second display and so on.

Step 4 : Connect from VNC client

Let's test our setup by connecting to vnc server, For that we need local vnc client, it depends upon the local operating system. I am using windows and I am going to use Realvnc as a client.
RealVNC is available for almost all operating system platform like Windows, macOS, Linux (Debian and RPM based), Solaris, etc. You can use other clients also.
Open Realvnc and enter {vnc-server_host name_or_ip}:5901 in vnc server address. My vnc server IP is 10.75.77.82. So, I am using 10.75.77.82:5901.
Add vnc server details in vnc viewer
VNC server home screen after successful connection
You straightway start by clicking "Use default config". Great, You have successfully configured vnc server with client.

Stop VNC server

Use below command to stop vnc server on port Dispay 1 (or on port 5901)
$ vncserver -kill :1
:1 is the display number that is going to be killed.
We have successfully installed and configured VNC server. Now you have realized that it is very useful in different contexts. We have also installed XFCE desktop environment, You can try your favorite desktop environment also. If you find any issue while configuring VNC server or client, Let me know.
Continue reading Install and Configure VNC Server

Senin, 07 Oktober 2019

WMS In Clearos 7

WMS instal di server ClearOS 7
WMS adalah software media yang bisa dikatakan cukup handal untuk saat postingan ini dibuat,
dengan berbagai fitur yang ditawarkan WMS termasuk efisien dalam pengelolaan media server.


 

Proses Instalasi
wget https://www.wowza.com/downloads/WowzaMediaServer-2-2-4/WowzaMediaServer-2.2.4.rpm.bin
chmod 755 WowzaMediaServer-2.2.4.rpm.bin
chmod +x WowzaMediaServer-2.2.4.rpm.bin
./WowzaMediaServer-2.2.4.rpm.bin
yum install java-openjdk

cd /usr/local/WowzaMediaServer-2.2.4/bin/
./startup.sh

6M3VA-H4NNM-NXHK8-8UCWT-H9M9K
MPBMV-EE6AY-66GQA-BR6FA-PHCUX
RBTJ-6GXQN-PCQDC-KDQ4R-FT4PR
UJKP3-DQAAU-KA3JP-WFY4K-CCC8H
R6URK-PKFF9-JGC7K-TE3GT-GTFFR
H33YQ-9TKQC-3RCCA-XENW8-P9BUM

cd /usr/local/WowzaMediaServer-2.2.4/examples
./installall.sh

cd /usr/local/WowzaMediaServer-2.2.4/examples/LiveVideoStreaming
./install.sh

chkconfig --level 345 WowzaMediaServer on
/etc/init.d/WowzaMediaServer start

sudo /usr/local/WowzaMediaServer-2.2.4/bin/startup.sh
wget http://ckpro.tk/MediaSecurity_2.0.zip
unzip MediaSecurity_2.0.zip
mv /root/MediaSecurity_2.0/lib/* /usr/local/WowzaMediaServer-2.2.4/lib/
------------------------------------------------------------------
Proses konfigurasi Firewall dengan iptables di server

iptables -I INPUT -p tcp --dport 1935 -j ACCEPT
iptables -I INPUT -p tcp --dport 8086 -j ACCEPT
chkconfig --level 345 WowzaMediaServer on
/etc/init.d/WowzaMediaServer restart
service WowzaMediaServer start
------------------------------------------------------------------
Berikut cara memonitor apakah server sudah berjalan

http://youripserver:8086/livestreamrecord
http://youripserver:8086/connectioncounts
http://youripserver:8086/connectioninfo
http://youripserver:8086/streammanager/index.html
------------------------------------------------------------------
sudo touch /etc/init.d/WowzaMediaServer
sudo chmod 777 /etc/init.d/WowzaMediaServer
sudo chmod 777 /usr/local/WowzaMediaServer-2.2.4/applications
sudo chmod 777 /usr/local/WowzaMediaServer-2.2.4/documentation/LGPL_Libraries/*/*/*/*/*
sudo chmod 777 /usr/local/WowzaMediaServer-2.2.4/documentation/serverapi/*/*/*/*/*/*/*/*/*
sudo chmod 777 /usr/local/WowzaMediaServer-2.2.4/documentation/serverapi/com/wowza/*/*/*/*/*/*/*
-------------------------------------------------------------------------
logging
    Client Logging
    com.wowza.wms.module.ModuleClientLogging


    flvplayback

    FLVPlayback

    com.wowza.wms.module.ModuleFLVPlayback

    ModuleRTMPAuthenticate

    ModuleRTMPAuthenticate

    com.wowza.wms.plugin.security.ModuleRTMPAuthenticate

------------------------------------------------
menguji keberhasilan server
test player
Continue reading WMS In Clearos 7

Rabu, 02 Oktober 2019

Start Wowza in Clearos7



iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT
iptables -I INPUT -p tcp --dport 1935 -j ACCEPT
iptables -I OUTPUT -p tcp --dport 8080 -j ACCEPT
iptables -I INPUT -p tcp --dport 8087 -j ACCEPT
iptables -I INPUT -p tcp --dport 8083 -j ACCEPT
iptables -I INPUT -p tcp --dport 8084 -j ACCEPT
iptables -I INPUT -p tcp --dport 8086 -j ACCEPT
iptables -I INPUT -p tcp --dport 8088 -j ACCEPT
/etc/init.d/WowzaStreamingEngine restart
iptables -I INPUT -p tcp --dport 8087:8088 -j ACCEPT
iptables -I INPUT -p udp -m udp --dport 6970:9999 -j ACCEPT
chkconfig --level 345 WowzaStreamingEngine on
sudo service WowzaStreamingEngine start
sudo service WowzaStreamingEngineManager start
/etc/init.d/WowzaStreamingEngine start
/etc/init.d/WowzaStreamingEngineManager start
sudo /usr/local/WowzaStreamingEngine/bin/installsystemd.sh
sudo /usr/local/WowzaStreamingEngine/bin/installupstart.sh
systemctl daemon-reload
systemctl enable WowzaStreamingEngine.service
systemctl enable WowzaStreamingEngineManager.service
systemctl start WowzaStreamingEngine.service
systemctl start WowzaStreamingEngineManager.service

Continue reading Start Wowza in Clearos7