Gerbera – A UPnP Media Server That Let’s You Stream Media on Home Network

Gerbera is a feature-rich and powerful UPnP (Universal Plug and Play) media server with a pleasant and intuitive web user interface, which allows users to stream digital media (videos, images, audio etc..) through a home network and consume it on different types of UPnP compatible devices from mobile phone to tablets and many more.

Gerbera Features:

  • Allows you to browse and playback media via UpnP.
  • Supports metadata extraction from mp3, ogg, flac, jpeg, etc. files.
  • Highly flexible configuration, allowing you to control the behavior of various features of the server.
  • Supports user defined server layout based on extracted metadata.
  • Support for ContentDirectoryService container updates.
  • Offers exif thumbnail support.
  • Supports automatic directory rescans (timed, inotify).
  • Offers a nice Web UI with a tree view of the database and the file system, allowing to add/remove/edit/browse media.
  • Support for external URLs (create links to internet content and serve them via UPnP to your renderer).
  • Supports flexible media format transcoding via plugins / scripts and many more including a number of experimental features.

How to Install Gerbera – UPnP Media Server in Linux

On Ubuntu distribution, there is a PPA created and maintained by Stephen Czetty, from which you can install Gerbera using following commands.

$ sudo add-apt-repository ppa:stephenczetty/gerbera
$ sudo apt update
$ sudo apt install gerbera 

On Debian distribution, Gerbera is available in the testing and unstable repositories, which you can enable by adding the lines below in your /etc/apt/sources.list file.

# Testing repository - main, contrib and non-free branches
deb http://http.us.debian.org/debian testing main non-free contrib
deb-src http://http.us.debian.org/debian testing main non-free contrib

# Testing security updates repository
deb http://security.debian.org/ testing/updates main contrib non-free
deb-src http://security.debian.org/ testing/updates main contrib non-free

# Unstable repo main, contrib and non-free branches, no security updates here
deb http://http.us.debian.org/debian unstable main non-free contrib
deb-src http://http.us.debian.org/debian unstable main non-free contrib

Then update your system package sources cache and install gerbera with the following commands.

# apt update
# apt install gerbera

For other Linux distributions like GentooArch LinuxopenSUSECentOS, etc. follow Gerbera installation guide.

Once you have installed gerbera, start, enable and view the service status using the following commands.

$ sudo systemctl start gerbera.service 
$ sudo systemctl enable gerbera.service
$ sudo systemctl status gerbera.service

Note: If gerbera fails to start on your system, you need to do one of the following.

Check if the log file (/var/log/gerbera) has been created, otherwise create it as shown.

$ sudo touch /var/log/gerbera
$ sudo chown -Rv root:gerbera /var/log/gerbera
$ sudo chmod -Rv 0660 /var/log/gerbera

Secondly, define a network interface that your are currently using as the value of MT_INTERFACE environment variable, the default is “eth0” but if you are using wireless, then set this to something like “wlp1s0”. In Debian/Ubuntu, you can set these settings in /etc/default/gerbera file.

Getting Started with Gerbera Media Server Web UI

Gerbera service listens on port 49152, which you can use to access the web UI via a web browser as shown.

http://domain.com:49152
OR
http://ip-address:49152

Gerbera UI Error

Gerbera UI Error

If you get the error shown in the above screenshot, you need to enable the web UI from the gerbera configuration file.

$ sudo vim /etc/gerbera/config.xml

Change the value enabled=”no” to enabled=”yes” as shown in the following screenshot.

Enable Gerbera UI

Enable Gerbera UI

After making above changes, close the file and restart the gerbera service.

$ sudo systemctl restart gerbera.service

Now go back to your browser and try to open the UI once more in a new tab, this time around it should load. You will see two tabs:

  • Database – shows the files that can be accessed by publicly.

Gerbera Web UI Database

Gerbera Web UI Database

  • Filesystem – this is where you can browse files from your system and select them for streaming. To add a file, simply click on the plus (+) sign.

Gerbera File System

Gerbera File System

After adding files for streaming from the filesystem, the database interface should look like this.

Gerbera Database File System

Gerbera Database File System

Stream Media Files Using Gerbera on Your Home Network

At this point you can start streaming media files over your network from the gerbera server. To test it, we will use a mobile phone as a client. Start by installing a compatible upnp application (like BubbleUpnp) on your phone.

Once installed BubbleUpnp app, open it and on the menu, go to Library and click on Local and Cloud to view available servers, and the gerbera server we created should show in there. Click on it to access added directories and files in them.

Gerbera Media Server

Gerbera Media Server

Gerbera Filesystem View

Gerbera Filesystem View

Finally click on a file that you would like to stream.

Stream Files via Gerbera Server

Stream Files via Gerbera Server

For more information visit, Gerbera Github Repository: https://github.com/gerbera/gerbera.

Gerbera is a feature-rich and powerful Upnp media server, used to stream your digital media through your home network with a nice web user interface. Share your thoughts about it or ask a question via the feedback form.

Source

Lychee – A Great Looking Photo Management System for Linux

Lychee is a free, open source, elegant and easy-to-use photo-management system, which comes with all the necessary features you need for securely managing and sharing photos on your server. It allows you to easily manage (upload, move, rename, describe, delete or search) your photos in seconds from a simple web application.

Lychee Photo Management Tool

Lychee Photo Management Tool

Lychee Features

  • A stunning, beautiful interface to manage all your photos in one place, right from your browser.
  • One click photo and album sharing with password protection.
  • View all your images in full-screen mode with forward and backward navigation using your keyboard or let others browse your photos by making them public.
  • Supports importing of photos from various sources: localhost, Dropbox, remote server, or using a link.

To install Lychee, everything you need is a running web-server such as Apache or Nginx with PHP 5.5 or later and a MySQL-Database.

For the purpose of this article, I will be installing Lychee photo-management system with NginxPHP-FPM 7.0and MariaDB on a CentOS 7 VPS with domain name lychee.example.com.

Step 1: Install Nginx, PHP and MariaDB

1. First start by installing NginxPHP with needed extensions and MariaDB database to setup a hosting environment to run Lychee.

On Cent/RHEL 7

# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum install yum-utils
# yum-config-manager --enable remi-php70   [Install PHP 7.0]
# yum install nginx php php-fpm php-mysqli php-exif php-mbstring php-json php-zip php-gd php-imagick mariadb-server mariadb-client

On Ubuntu 16.04 and 18.04

$ sudo apt install nginx php php-fpm php-mysqli php-exif php-mbstring php-json php-zip php-gd php-imagick mariadb-server mariadb-client

2. Once you have installed the necessary packages, start nginxphp-fpm and mariadb services, enable them at boot time and check if these services are up and running.

------------ CentOS/RHEL ------------
# systemctl start nginx php-fpm mariadb
# systemctl status nginx php-fpm mariadb
# systemctl enable nginx php-fpm mariadb
------------ Debian/Ubuntu ------------
$ sudo systemctl start nginx php7.0-fpm mysql
$ sudo systemctl status nginx php7.0-fpm mysql
$ sudo systemctl enable nginx php7.0-fpm mysql

3. Next, if you have a firewall enabled on your system, you need to open the port 80 and 443 in the firewall to allow client requests to the Nginx web server on the HTTP and HTTPS respectively, as shown.

------------ Debian/Ubuntu ------------
$ sudo  ufw  allow 80/tcp
$ sudo  ufw  allow 443/tcp
$ sudo  ufw  reload
------------ CentOS/RHEL ------------
# firewall-cmd --zone=public --permanent --add-port=80/tcp
# firewall-cmd --zone=public --permanent --add-port=443/tcp
# firewall-cmd --reload

4. In order to run Lychee effectively, it is recommended to increase the values of the following properties in php.ini file.

# vim /etc/php/php.ini			#CentOS/RHEL
$ sudo vim /etc/php/7.0/fpm/php.ini     #Ubuntu/Debian 

Search for these PHP parameters and change their values to:

max_execution_time = 200
post_max_size = 100M
upload_max_size = 100M
upload_max_filesize = 20M
memory_limit = 256M

5. Now configure PHP-FPM to set the user and group, listen socket www.conf file as explained.

# vim /etc/php-fpm.d/www.conf		        #CentOS/RHEL
$ sudo vim /etc/php/7.0/fpm/pool.d/www.conf	#Ubuntu/Debian

Look for the directives below to set the Unix user/group of processes (change www-data to nginx on CentOS).

user = www-data
group = www-data

Also change the listen directive on which to accept FastCGI requests to a Unix socket.

listen = /run/php/php7.0-fpm.sock

And set the appropriate ownership permissions for the Unix socket using the directive (change www-data to nginx on CentOS/RHEL).

listen.owner = www-data
listen.group = www-data

Save the file and restart the nginx and php-fpm services.

# systemctl restart nginx php-fpm              #CentOS/RHEL
$ sudo systemctl restart nginx php7.0-fpm      #Ubuntu/Debian

Step 2: Secure MariaDB Installation

6. In this step, you should secure the MariaDB database installation (which is unsecured by default if installed on a fresh system), by running the security script which comes with the binary package.

Run the following command as root, to launch the the script.

$ sudo mysql_secure_installation

You will be prompted to set a root password, remove anonymous users, disable root login remotely and remove test database. After creating a root password, and answer yes/y to the rest of questions.

Enter current password for root (enter for none):
Set root password? [Y/n] y Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y

Step 3: Install Lychee Photo Management System

7. To install Lychee, first you need to create a database for it with appropriate permissions using following commands.

$ sudo mysql -u root -p
MariaDB [(none)]> CREATE DATABASE lychee; 
MariaDB [(none)]> CREATE USER 'lycheeadmin'@'localhost' IDENTIFIED BY '=@!#@%$Lost';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON  lychee.* TO 'lycheeadmin'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit

8. Next, move into the web document root and grab the latest version of Lychee using the git command line tool, as shown.

$ cd /var/www/html/
$ sudo git clone --recurse-submodules https://github.com/LycheeOrg/Lychee.git

9. Then set the correct permissions and ownership on the installation directory as shown (replace admin with a username on your system).

------------ CentOS/RHEL ------------
# chown admin:nginx -R /var/www/html/Lychee
# chmod 775 -R /var/www/html/Lychee
------------ Debian/Ubuntu ------------
$ sudo chown admin:www-data -R /var/www/html/Lychee
$ sudo chmod 775  -R /var/www/html/Lychee

10. In this step, you need to setup composer in the lychee installation directory, which will be used to install PHP dependencies.

# cd Lychee/
# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
# php composer-setup.php
# php -r "unlink('composer-setup.php');"
# php composer.phar update

Step 4: Configure Nginx Server Block for Lychee

12. Next, you need to create and configure a Nginx server block for the Lychee application under /etc/nginx/conf.d/.

# vim /etc/nginx/conf.d/lychee.conf

Add the following configuration in the above file, remember to use your own domain name instead of lychee.example.com (this is just a dummy domain).

server {
	listen      80;
	server_name	 lychee.example.com;
	root         	/var/www/html/Lychee/;
	index       	index.html;

	charset utf-8;
	gzip on;
	gzip_types text/css application/javascript text/javascript application/x-javascript 	image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
	location / {
		try_files $uri $uri/ /index.php?$query_string;
	}
	location ~ \.php {
		include fastcgi.conf;
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_pass unix:/run/php/php7.0-fpm.sock;
	}
	location ~ /\.ht {
		deny all;
	}
}

Then save the file and restart the Nginx web server and PHP-FPM to apply the recent changes.

# systemctl restart nginx php-fpm              #CentOS/RHEL
$ sudo systemctl restart nginx php7.0-fpm      #Ubuntu/Debian

Step 5: Complete Lychee Installation Via Web Browser

13. Now use the URL lychee.example.com to open Lychee web installer in your browser and provide your database connection settings and enter the name of the database you created for lychee and click Connect.

Lychee Database Settings

Lychee Database Settings

14. Next, enter a username and password for your installation and click Create Login. After login, you will land in the admin dashboard which contains the default Albums as shown in the following screenshot.

Lychee Admin Dashboard

Lychee Admin Dashboard

To upload a photo or import from a link or import from Dropbox or from another server or add an album, click the + sign. And to view photos in an album, simply click on it.

For more information, visit Lychee Homepage: https://lycheeorg.github.io/

Lychee is an open source, easy-to-use and elegant PHP photo-management system to manage and share photos. If you have any questions or comments, use the form below to write to us.

Source

Fasd – A Commandline Tool That Offers Quick Access to Files and Directories

Fasd (pronounced as “fast“) is command-line productivity booster, a self-contained POSIX shell script which enables quick and more efficient access to files and directories.

It is inspired by tools such as autojump, and the name fasd was created from the default suggested aliases:

  • f(files)
  • a(files/directories)
  • s(show/search/select)
  • d(directories)

It has been tested on the following shells: bash, zsh, mksh, pdksh, dash, busybox ash, FreeBSD 9 /bin/sh and OpenBSD /bin/sh. It keeps track of files and directories you have accessed, so that you can quickly reference them in the command line.

In this article, we will show how to install and use fasd with a few examples in Linux.

How Does fasd Work?

Fasd simply ranks files and directories by “frecency” (word was first invented by Mozilla and used in Firefox, find out more from here) a combination of the words “frequency” and “recency“.

If you use primarily the shell via the terminal to navigate and launch applications, fasd can enable you do it more efficiently. It helps you to open files regardless of which directory you are in.

With simple key strings, fasd can find a “frecent” file or directory and open it with command you specify.

How to Install and Use Fasd in Linux Systems

Fasd can be installed using PPA on Ubuntu and its derivatives.

$ sudo add-apt-repository ppa:aacebedo/fasd
$ sudo apt-get update
$ sudo apt-get install fasd

On other Linux distributions, you can install it from source as shown.

$ git clone https://github.com/clvv/fasd.git
$ cd fasd/
$ sudo make install

Once you have installed Fasd, add the following line to your ~/.bashrc to enable it:

eval "$(fasd --init auto)"

Then source the file like this.

$ source ~/.bashrc

Fasd ships with the following useful default aliases:

alias a='fasd -a'        # any
alias s='fasd -si'       # show / search / select
alias d='fasd -d'        # directory
alias f='fasd -f'        # file
alias sd='fasd -sid'     # interactive directory selection
alias sf='fasd -sif'     # interactive file selection
alias z='fasd_cd -d'     # cd, same functionality as j in autojump
alias zz='fasd_cd -d -i' # cd with interactive selection

Let’s look at a few usage examples; the following example will list any “frecent” files and directories:

$ a

Fasd - List Recent Files

Fasd – List Recent Files

To quickly search a file or directory you accessed previously, use the s alias:

$ s

Fasd - Quickly Search Recent Files

Fasd – Quickly Search Recent Files

To view all files you previously worked with that have the letters “vim”, you can use the f alias as follows:

$ f vim

Fasd - Find Files Using String

Fasd – Find Files Using String

To quickly and interactively cd into a previously accessed directory using the zz alias. Simply select the directory number from the first field (1-24 in the screenshot below):

$ zz

Fasd - Switch Directories

Fasd – Switch Directories

You can add your own aliases in ~/.bashrc to fully utilize the power of fasd as in the examples below:

alias v='f -e vim'   # quick opening files with vim
alias m='f -e vlc'   # quick opening files with vlc player

Then run the following command to source the file:

$ source  ~/.bashrc

To open a file quickly named test.sh in vim, you would type:

$ v test.sh

We will cover one more example where you can use Fasd aliases with other commands:

$ f test
$ cp  `f test` ~/Desktop
$ ls -l ~/Desktop/test.sh

For bash users, call _fasd_bash_hook_cmd_complete to make completion work. For example:

_fasd_bash_hook_cmd_complete  v  m  j  o

For more information, type:

$ man fasd

For additional customizations and usage examples, check out Fasd Github repository: https://github.com/clvv/fasd/

That’s all! In this article, we showed you how to install and use fasd in Linux. Do share with us info about similar tools you have come across out there, together with any other thoughts via the feedback section below.

Source

A Brief Introduction to ‘Makefiles’ in Open Source Software Development with GNU Make

GNU Make is a development utility which determines the parts of a particular code base that are to be recompiled and can issue commands to perform those operations on the code base. This particular make utility can be used with any programming language provided that their compilation can be done from the shell by issuing commands.

Makefiles in Linux

Makefiles in Linux

In order to use GNU Make, we need to have some set of rules which defines the relationship among different files in our program and commands for updating each file. These are written onto a special file called ‘makefile‘. The ‘make‘ command uses the ‘makefile‘ data base and the last modification times of the files to decide which all files are to recompiled again.

Contents of a Makefile

Generally ‘makefiles‘ contain 5 kinds of things namely: implicit rulesexplicit rulesvariable definitionsdirectives, and comments.

  1. An explicit rule specifies how to make/remake one or more files (called targets, will be explained later) and when to do the same.
  2. An implicit rule specifies how to make/remake one or more files based on their names. It describes how a target file name is related to one file with a name similar to the target.
  3. variable definition is a line that specifies a string value for a variable to be substituted later.
  4. directive is an instruction for make to do something special while reading the makefile.
  5. A ‘#’ symbol is used represent the start of a comment inside makefiles. A line starting with ‘#’ is simply ignored.

Structure of Makefiles

The information that tells make how to recompile a system comes from reading a data base called the makefile. A simple makefile will consists of rules of the following syntax:

target ... : prerequisites ... 
	recipe 
... 
...

target is defined to be the output file generated by the program. It can be also phony targets, which will be explained below. Examples of target files include executablesobject files or phony targets like cleaninstalluninstall etc.

prerequisite is a file that is used as an input to create the target files.

recipe is the action that make performs for creating the target file based on the prerequisites. It is necessary to put tab character before each recipe inside the makefiles unless we specify the ‘.RECIPEPREFIX‘ variable to define some other character as prefix to recipe.

A sample Makefile

final: main.o end.o inter.o start.o
	gcc -o final main.o end.o inter.o start.o
main.o: main.c global.h
	gcc -c main.c
end.o: end.c local.h global.h
	gcc -c end.c
inter.o: inter.c global.h
	gcc -c inter.c
start.o: start.c global.h
	gcc -c start.c
clean:
	rm -f main.o end.o inter.o start.o

In the above example we used 4 C source files and two header files for creating the executable final. Here each ‘.o’ file is both a target and a prerequisite inside the makefile. Now take a look at the last target name clean. It is just a action rather than a target file.

Since we normally don’t need this during compilation, it is not written as a prerequisite in any other rules. Targets that do not refer to files but are just actions are called phony targets. They will not have any prerequisites as other target files.

How GNU Make process a Makefile

By default make starts off with the first target in the ‘makefile‘ and is called as ‘default goal’. Considering our example, we have final as our first target. Since its prerequisites include other object files those are to be updated before creating final. Each of these prerequisites are processed according to their own rules.

Recompilation occurs if there are modifications made to source files or header files or if the object file does not exists at all. After recompiling the necessary object files, make decides whether to relink final or not. This must be done if the file final does not exist, or if any of the object files are newer than it.

Thus if we change the file inter.c, then on running make it will recompile the source file to update the object file inter.o and then link final.

Using variables inside Makefiles

In our example, we had to list all the object files twice in the rule for final as shown below.

final: main.o end.o inter.o start.o
	gcc -o final main.o end.o inter.o start.o

In order to avoid such duplications, we can introduce variables to store the list of object files that are being used inside the makefile. By using the variable OBJ we can rewrite the sample makefile to a similar one shown below.

OBJ = main.o end.o inter.o start.o
final: $(OBJ)
	gcc -o final $(OBJ)
main.o: main.c global.h
	gcc -c main.c
end.o: end.c local.h global.h
	gcc -c end.c
inter.o: inter.c global.h
	gcc -c inter.c
start.o: start.c global.h
	gcc -c start.c
clean:
	rm -f $(OBJ)

Rules for cleaning the source directory

As we saw in the example makefile, we can define rules to clean up the source directory by removing the unwanted object files after the compilation. Suppose we happen to have a target file called clean. How can make differentiate the above two situations? Here comes the concept of phony targets.

phony target is one that is not really the name of a file, rather it is just a name for a recipe to be executed whenever an explicit request is made from the makefile. One main reason to use phony target is to avoid a conflict with a file of the same name. Other reason is to improve performance.

To explain this thing, I will reveal one unexpected twist. The recipe for clean will not be executed by default on running make. Instead it is necessary to invoke the same by issuing the command make clean.

.PHONY: clean
clean:
	rm -f $(OBJ)

Now try to create makefiles for your own code base. Feel free to comment here with your doubts.

Source

Linux File System Explained: Boot Loading, Disk Partitioning, BIOS, UEFI and File System Types

The concept of boot loading, disk partitioning, partition table, BIOS, UEFI, File system types, etc. is little known to most of us. We comes across these terminology very often but rarely took the pain to know these and their meaning in details. This article in an effort to fulfil this gap in the most easiest way possible.

Linux File System Types

Linux File System Types

Partition Table

One of the very first decision we comes across while installing a Linux Distribution is the partitioning of its disk, the file-system to use, implement encryption for security which varies with the change in architecture and platform. One of the most widely used Architecture, INTEL is undergoing some changes and it is important to understand these changes which on the other hand requires knowledge of boot process.

Many developers run both Windows and Linux on the same machine which may be a matter of preference or need. Most of the boot-loaders of today are smart enough to recognize any number of Operating System on the same box and provide menu to boot into the preferred one. Another way to achieve the same goal is to use virtualization using XenQEMUKVM or any other preferred visualization tool.

BIOS Vs UEFI

If I remember correctly, till late 90‘s BIOS which stands for Basic Input/Output System was the only way to boot an Intel System. BIOS holds the partitioning Information in an special area called Master Boot Record (MBR) such that additional code gets stored in first sector of every boot-able partition.

In Late 90‘s Microsoft’s intervention with Intel resulted in Universal Extensible Firmware Interface (UEFI) the initial purpose of which was to boot securely. This mechanism of booting proved to be a challenge for rootkits specially which gets attached with boot sectors and were hard to detect with BIOS.

Boot with BIOS

Booting with BIOS requires placing of boot codes or boot sequence in MBR which is placed in the first sector of boot disk. In case if more than one Operating System is installed the installed boot loader is replaced by one common boot loader which places boot codes on every bootable disk during installation and updation automatically, which means user has the choice to boot into any of the installed OS.

However it is seen, specially on windows that a non-windows boot loader won’t update the system specially certain programs viz., IE but again there is not hard and fast rule nor it is documented any where.

Boot with UEFI

UEFI is the latest booting technology developed in close collaboration of Microsoft with Intel. UEFI requires the firmware to be loaded is digitally signed, a way to stop rootkits being attached with the boot partition. However the problem in booting Linux using UEFI is complex. Booting Linux in UEFI requires the keys used needs to be make public under GPL which is against the Linux protocol.

However it is still possible to install Linux on UEFI specification by disabling ‘Secure boot‘ and enabling ‘Legacy Boot‘. Boot codes in UEFI is placed under subdirectories of /EFI, special partition in the first sector of disk.

Types of Linux File Systems

A standard Linux Distribution provides the choice of partitioning disk with the file formats listed below, each of which has special meaning associated with it.

  1. ext2
  2. ext3
  3. ext4
  4. jfs
  5. ReiserFS
  6. XFS
  7. Btrfs

ext2, ext3, ext4

These are the progressive version of Extended Filesystem (ext), which primarily was developed for MINIX. The second extended version (ext2) was an improved version. Ext3 added performance improvement. Ext4 was a performance improvement besides additional providing additional features.

Read AlsoWhat is Ext2, Ext3 & Ext4 and How to Create and Convert Linux File Systems

JFS

The Journaled File System (JFS) was developed by IBM for AIX UNIX which was used as an alternative to system ext. JFS is an alternative to ext4 currently and is used where stability is required with the use of very few resources. When CPU power is limited JFS comes handy.

ReiserFS

It was introduced as an alternative to ext3 with improved performance and advanced features. There was a time when SuSE Linux‘s default file format was ReiserFS but later Reiser went out of business and SuSe had no option other than to return back to ext3. ReiserFS supports file System Extension dynamically which was relatively an advanced feature but the file system lacked certain area of performance.

XFS

XFS was a high speed JFS which aimed at parallel I/O processing. NASA still usages this file system on their 300+ terabyte storage server.

Btrfs

B-Tree File System (Btrfs) focus on fault tolerance, fun administration, repair System, large storage configuration and is still under development. Btrfs is not recommended for Production System.

Clustered File Format

Clustered file System is not required for booting but best suited in shared environment form storage point of view.

Non-Linux File Format

There are lots of File format not available under Linux but are used by other OS’s. Viz., NTFS by Microsoft, HFS by Apple/Mac os, etc. Most of these can be used under Linux by mounting them using certain tools like ntfs-3g to Mount NTFS file system but not preferred under Linux.

Unix File Format

There are certain File formats used widely in Linux but not preferred under Linux specially for installing Linux root System. e.g., UFS of BSD.

Ext4 is the preferred and most widely used Linux file System. In certain Special case XFS and ReiserFS are used. Btrfs is still used in experimental environment.

Disk Partitioning

The first stage is disk Partitioning. While partitioning we should keep the below points in mind.

  1. Partition keeping backup and recovery in mind.
  2. Space limitation mark in partition.
  3. Disk management – Administrative Function.

Logical Volume Management

LVM is a complex partitioning used in Large Storage Installation. The LVM structure overlays the actual physical disk partitioning.

Swap

Swap is used for memory paging in Linux specially during System Hibernation. The current stage of System is written to Swap when the system is paused (Hibernate) at a point of time.

A System which will never go hibernation needs a swap space equal to the size of its RAM.

Encryption

The last stage is encryption which ensures data safely. Encryption can be at the level of Disk as well as Directory. In Disk encryption, the whole disk is encrypted can requires some kind of special codes to decrypt it.

However its an complex issue. The decryption code can not remain on the same disk undergoing encryption hence we need certain special hardware or let the motherboard do it.

The disc encryption is relatively easy to achieve and is less complex. In this case the decryption code remains on the same disk, somewhere in different directory.

Disk encryption is necessary in server building and may be a legal issue based the the geographical location you are implementing it.

Here in this article, we tried throwing lights on File System Management as well as disk management in much more depth fashion. That’s all for now.

Read AlsoLinux Directory Structure and Important Files Paths Explained

Source

How to Install Telegram Messenger Application on Linux

Telegram is an Instant Messaging (IM) application similar to whatsapp. It has a very large user base. It has a lot of features that differentiate it from other messaging application.

This article aims at making you aware of telegram application followed by detailed installation instructions on Linux Box.

Features of Telegram

  1. Implementation for mobile devices
  2. Available for Desktop.
  3. Application Program Interface (API) of Telegram can be Accessed by third party developers.
  4. Available for Android, iphone/ipad, Windows Phone, Web-Version, PC, Mac and Linux
  5. The above application provides Heavily Encrypted and self destruct messages.
  6. Lets you access your message from multiple devices and platform.
  7. The overall processing and message delivery is lightening fast.
  8. Distributed server across the globe for security and speed.
  9. Open API and Free Protocol
  10. NoAds, No Subscription charge. – Free forever.
  11. Powerful – No limit to media and chats
  12. Several security measures that make it safe from Hackers.
  13. Reply to Specific message in group. Mention @username to notify multiple users in group.

Why Telegram?

When Applications like whatsapp and other IM are providing almost same things in bag, why should someone opt for Telegram?

Well Availability of API to third party developer is enough to say. Moreover availability for PC which means you won’t have to struggle typing message using your mobile, but you can use your PC and that is pretty more than sufficient.

Also The option to connect on remote locations, Co-ordinate – Group of upto 200 Members, Sync all your devices, Send – Documents of all kind, Encrypt message, Self destruction of message, Storage of Media in Cloud, Build own tool on freely available API and what not.

Testing Environment

We have used Debian GNU/Linux, x86_64 architecture to test it and the overall process went very smooth for us. Here what we did stepwise.

Installation of Telegram Messenger in Linux

First go to the official Telegram site, and download Telegram source package (tsetup.1.1.23.tar.xz) for Linux system or you may use following wget command to download directly.

# wget https://updates.tdesktop.com/tlinux/tsetup.1.1.23.tar.xz

Once package has been downloaded, unpack the tarball and switch from current working directory to the extracted directory.

# tar -xf tsetup.1.1.23.tar.xz 
# cd Telegram/

Next, execute the binary file ‘Telegram’ from the command line as shown below.

# ./Telegram

1. The first Impression. Click “START MESSAGING”.

Start Messaging

Start Messaging

2. Enter Your phone Number. Click “NEXT”. If you have not registered for telegram before this, using the same number as entered above you will get a warning that you don’t have a telegram account yet. Click “Register Here”.

Signup for Telegram

Signup for Telegram

3. After submitting your phone number, telegram will send you a verification code, shortly. You need to Enter it.

Telegram Verification Code

Telegram Verification Code

4. Enter your First_Name, Last_name and pics and click “SIGNUP”.

Enter Account Details

Enter Account Details

5. After account creation, I got this interface. Everything seems at its place, even when I am new to telegram Application. The interface is really simple.

Telegram Interface

Telegram Interface

6. Click Add a contact and Enter Their first_name, last_name and Phone number. Click create when done!.

Add New Telegram Contact

Add New Telegram Contact

7. If the contact you added is not on telegram already, You get a warning message and telegram will acknowledge you when your contact joins telegram.

Telegram Contact Notification

Telegram Contact Notification

8. As soon as the contact joins telegram you get a message (pop-out like) that reads [YOUR_CONTACT] joined telegram.

9. A formal chat window on Linux Machine. Nice experience…

Telegram Contact Join Message

Telegram Contact Join Message

10. At the same time, I’ve tried messaging from my android mobile device, the interface looks similar on both.

Telegram Mobile Interface

Telegram Mobile Interface

11. Telegram settings page. You have a lot of options to configure.

Telegram Settings

Telegram Settings

12. About Telegram.

About Telegram

About Telegram

Less Interesting Points

  1. Telegram usage protocol MTProto Mobile protocol.
  2. Released Initially for iPhone in the year 2013 (August 14)..
  3. People Behind this Amazing Project: Pavel and Nikolai Durov..

That’s all for now. I’ll be here again with another interesting article you will love to read. I take the pleasure on behalf of Tecmint to thank all our valuable readers and critics who made us stand where we are now through continuous self evolving process. Keep Connected! Keep Commenting. Share if you care for us.

https://telegram.org/

Source

Remmina – A Feature Rich Remote Desktop Sharing Tool for Linux

Remmina is a is free and open-source, feature-rich and powerful remote desktop client for Linux and other Unix-like systems, written in GTK+3. It’s intended for system administrators and travelers, who need to remotely access and work with many computers.

It supports several network protocols in a simple, unified, homogeneous and easy-to-use user interface.

Remmina Features

  • Supports RDP, VNC, NX, XDMCP and SSH.
  • Enables users to maintain a list of connection profiles, organized by groups.
  • Supports quick connections by users directly putting in the server address.
  • Remote desktops with higher resolutions are scrollable/scalable in both window and fullscreen mode.
  • Supports viewport fullscreen mode; here the remote desktop automatically scrolls when the mouse moves over the screen edge.
  • Also supports floating toolbar in fullscreen mode; enables you to switch between modes, toggle keyboard grabbing, minimize and beyond.
  • Offers tabbed interface, optionally managed by groups.
  • Also offers tray icon, allows you to quickly access configured connection profiles.

In this article, we will show you how to install and use Remmina with a few supported protocols in Linux for desktop sharing.

Prerequisites

  • Allow desktop sharing in remote machines (enable remote machines to permit remote connections).
  • Setup SSH services on the remote machines.

How to Install Remmina Desktop Sharing Tool in Linux

Remmina and its plugin packages are already provided in the official repositories of the all if not most of the mainstream Linux distributions. Run the commands below to install it with all supported plugins:

------------ On Debian/Ubuntu ------------ 
$ sudo apt-get install remmina remmina-plugin-*
------------ On CentOS/RHEL ------------ 
# yum install remmina remmina-plugins-*
------------ On Fedora 22+ ------------ 
$ sudo dnf copr enable hubbitus/remmina-next
$ sudo dnf upgrade --refresh 'remmina*' 'freerdp*'

Once you have installed it, search for remmina in the Ubuntu Dash or Linux Mint Menu, then launch it:

Remmina Desktop Sharing Client

Remmina Desktop Sharing Client

You can perform any configurations via the graphical interface or by editing the files under $HOME/.remmina or $HOME/.config/remmina.

To setup a new connection to a remote server press [Ctrl+N] or go to Connection -> New, configure the remote connection profile as shown in the screenshot below. This is the basic settings interface.

Remmina Basic Desktop Preferences

Remmina Basic Desktop Preferences

Click on Advanced from the interface above to configure advanced connection settings.

Remmina Advance Desktop Settings

Remmina Advance Desktop Settings

To configure SSH settings, click on the SSH from the profile interface above.

Remmina SSH Settings

Remmina SSH Settings

Once you have configured all the necessary settings, save the settings by clicking on Save button and from the main interface, you’ll be able to view all your configured remote connection profiles as shown below.

Remmina Configured Servers

Remmina Configured Servers

Connecting to Remote Machine Using sFTP

Choose the connection profile and edit the settings, choose SFTP – Secure File Transfer from the Protocolsdown menu. Then set a startup path (optional) and specify the SSH authentication details. Lastly, click Connect.

Remmina sftp Connection

Remmina sftp Connection

Enter your SSH user password here.

Enter SSH Password

Enter SSH Password

If you see the interface below, then the SFTP connection is successful, you can now transfer files between your machines.

Remmina Remote sFTP Filesystem

Remmina Remote sFTP Filesystem

Connect to Remote Machine Using SSH

Select the connection profile and edit the settings, then choose SSH – Secure Shell from the Protocols down menu and optionally set a startup program and SSH authentication details. Lastly, click Connect, and enter the user SSH password.

Remmina SSH Connection

Remmina SSH Connection

When you see the interface below, it means your connection is successful, you can now control the remote machine using SSH.

Remmina Remote SSH Connection

Remmina Remote SSH Connection

Connect to Remote Machine Using VNC

Choose the connection profile from the list and edit the settings, then select VNC – Virtual Network Computingfrom the Protocols down menu. Configure basic, advanced and ssh settings for the connection and click Connect, then enter the user SSH password.

Remmina VNC Connection

Remmina VNC Connection

Once you see the following interface, it implies that you have successfully connected to the remote machine using VNC protocol.

Enter the user login password from the desktop login interface as shown in the screenshot below.

Remmina Remote Desktop Login

Remmina Remote Desktop Login

Remmina Remote Desktop Sharing

Remmina Remote Desktop Sharing

Simply follow the steps above to use the other remaining protocols to access remote machines, it’s that simple.

Remmina Homepage: https://www.remmina.org/wp/

That’s all! In this article, we showed you how to install and use Remmina remote connection client with a few supported protocols in Linux. You can share any thoughts in the comments via the feedback form below.

Source

How to Install Let’s Chat on CentOS and Debian Based Systems

Let’s Chat is a free and open source, self-hosted chat application designed for relatively small teams. It is feature-rich; built using Node.js and employs MongoDB to store the application data.

Let’s Chat Features:

  • Supports persistent messages
  • Supports multiple rooms
  • Supports local/Kerberos/LDAP authentication
  • Comes with a REST-like API
  • Supports private and password-protected rooms
  • Offers support for new message alerts / notifications
  • Also supports mentions (hey @tecmint/@all)
  • Provides support for image embeds / Giphy search
  • Allows for code pasting
  • Supports for file uploads (locally or from Amazon S3 or Azure)
  • Also supports XMPP Multi-user chat (MUC) and 1-to-1 chat between XMPP users and many more.

Importantly, it is intended to be easily deployable on any system that meets all following requirements.

Requirements

  • Node.js (0.11+)
  • MongoDB (2.6+)
  • Python (2.7.x)

In this article, we will explain how to install and use a Let’s Chat messaging application for small teams on CentOS and Debian based systems.

Step 1: Update the System

1. First make sure to perform a system-wide update by installing necessary packages as follows.

-------------- On CentOS/RHEL/Fedora -------------- 
$ sudo yum update && sudo yum upgrade

-------------- On Debian/Ubuntu -------------- 
$ sudo apt-get update && sudo apt-get -y upgrade
$ sudo apt-get install software-properties-common git build-essential

2. After finishing system update, reboot the server (Optional).

$ sudo reboot

Step 2: Installing Node.js

3. Install most recent version of NodeJS (i.e version 7.x at the time of writing) using the nodesource repository as shown.

-------------- On CentOS/RHEL/Fedora --------------
$ curl -sL https://rpm.nodesource.com/setup_7.x | sudo -E bash - 
$ sudo yum install nodejs

-------------- On Debian/Ubuntu -------------- 
$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
$ sudo apt install nodejs 

Step 3: Installing MongoDB Server

4. Next you need to install MongoDB community version, however, it is not available in the YUM repository. Therefore you have to enable the MongoDB repository as explained below.

On CentOS/RHEL/Fedora

$ cat <<EOF | sudo tee -a /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
EOF

Now install and start the latest version of MongoDB Server (i.e 3.4).

$ sudo yum install mongodb-org
$ sudo systemctl start mongod.service
$ sudo systemctl enable mongod.service

On Debian/Ubuntu

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
$ echo 'deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse' | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
$ sudo apt-get update
$ sudo apt-get install -y mongodb-org
$ sudo systemctl start mongod.service
$ sudo systemctl enable mongod.service

Step 4: Install Let’s Chat Server

5. First install git to clone the Let’s Chat repository and install dependencies as shown.

$ sudo yum install git		##RHEL/CentOS
$ sudo apt install git		##Debian/Ubuntu

$ cd /srv
$ sudo git clone https://github.com/sdelements/lets-chat.git 
$ cd lets-chat
$ sudo npm install

Install Let Chat using NPM

Install Let Chat using NPM

Note: The npm WARN signals from the output above are normal during the installation. Just ignore them.

6. After finishing installation, create the application configuration file (/srv/lets-chat/settings.yml) from the sample file and define your custom settings in it:

$ sudo cp settings.yml.sample settings.yml

We will use default settings provided from the sample settings file.

7. Finally start the Let’s Chat server.

$ npm start 

To keep the Let’s Chat daemon running, let’s press Ctrl-C to exit and then create a Systemd unit file to enable it at system boot.

Step 5: Create Let’s Chat Startup File

8. Create a systemd unit file for Let’s Chat.

$ sudo vi /etc/systemd/system/letschat.service

Copy and paste the unit configuration below in the file.

[Unit]
Description=Let's Chat Server
Wants=mongodb.service
After=network.target mongodb.service

[Service]
Type=simple
WorkingDirectory=/srv/lets-chat
ExecStart=/usr/bin/npm start
User=root
Group=root
Restart=always
RestartSec=9

[Install]
WantedBy=multi-user.target

9. Now start the service for the mean time and enable it to automatically start on system boot.

$ sudo systemctl start letschat
$ sudo systemctl enable letschat
$ sudo systemctl status letschat

Start LetsChat Server

Start LetsChat Server

Step 6: Access Let’s Chat Web Interface

10. Once everything in place, you can access the Let’s Chat web interface at the following URL.

https://SERVER_IP:5000
OR
https://localhost:5000

Lets Chat Login

Lets Chat Login

11. Click on “I need an account” to create one and fill in the required information and click “Register”.

Create Lets Chat Account

Create Lets Chat Account

You may also like following related articles:

  1. Useful Commands to Create Commandline Chat Server in Linux
  2. Create Your Own Instant Messaging/Chat Server Using “Openfire” in Linux

Let’s Chat Github repository: https://github.com/sdelements/lets-chat

Enjoy! You now have Let’s Chat application installed on your system. To share any thoughts with us, use the feedback form below.

Source

Install OpenLiteSpeed, PHP 7 & MariaDB on Debian and Ubuntu

OpenLiteSpeed is an open source, high-performance HTTP server with an event-driven architecture; built for Unix-like operating systems including Linux and Windows OS.

It is a powerful, modular HTTP server that comes with several modules for common HTTP server functionalities, it can handle hundreds of thousands of concurrent connections without critical server load issues, and it supports third-party modules via API (LSIAPI) as well.

Importantly, it supports Apache-compatible rewrite rules, ships in with a an easy-to-use, user friendly Web administration console which shows real-time server stats. OpenLiteSpeed utilizes minimal CPU and memory resources, supports creation of virtual hosts, high-performance page caching as well as installation of a different PHP versions.

Step 1: Enable OpenLitespeed Repository

1. OpenLiteSpeed is not present in the Debian/Ubuntu software repositories, so you have to add OpenLiteSpeed repository with this command. This will create the file /etc/apt/sources.list.d/lst_debian_repo.list:

$ wget -c http://rpms.litespeedtech.com/debian/enable_lst_debain_repo.sh 
$ sudo bash enable_lst_debain_repo.sh

Step 2: Install OpenLiteSpeed on Debian/Ubuntu

2. Then install OpenLiteSpeed 1.4 (the latest version at the time of this writing) with the apt command below, which will install it under the /usr/local/lsws directory. The service will also be started after installation is complete.

$ sudo apt install openlitespeed

3. After installing it, you can start and confirm the OpenLiteSpeed version by running like this

$ /usr/local/lsws/bin/lshttpd -v

Check OpenLiteSpeed Version

Check OpenLiteSpeed Version

4. OpenLiteSpeed runs on port “8088” by default. If you have UFW firewall enabled on the system, update firewall rules to permit port 8088 to access your default site on the server.

$ sudo ufw allow 8088/tcp
$ sudo ufw reload

5. Now open a web browser and type the following URL to verify the default page of OpenLiteSpeed.

http://SERVER_IP:8088/ 
or 
http://localhost:8088

Verify OpenLiteSpeed Page

Verify OpenLiteSpeed Page

Step 3: Install PHP 7 for OpenLiteSpeed

6. Next, install PHP 7 with most needed modules for OpenLiteSpeed with the command below, it will install PHP as /usr/local/lsws/lsphp70/bin/lsphp.

$ sudo apt install lsphp70 lsphp70-common lsphp70-mysql lsphp70-dev lsphp70-curl lsphp70-dbg

7. If you want to install extra PHP modules, run the command below to list all the available modules.

$ sudo apt install lsphp70-

List PHP 7 Modules

List PHP 7 Modules

Step 4: Configure OpenLiteSpeed and PHP 7

8. In this section, we will configure OpenLiteSpeed and PHP 7 with the standard HTTP port 80 as explained below.

As we mentioned earlier on, OpenLiteSpeed comes with a WebAdmin console which listens on port 7080. So, first start by setting the admin username and password for the OpenLiteSpeed WebAdmin console using the command below.

$ sudo /usr/local/lsws/admin/misc/admpass.sh
Set OpenLiteSpeed Admin Account
Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: tecmint

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password: 
Retype password: 
Administrator's username/password is updated successfully!

9. Now add firewall rules to permit port 7080 via the firewall to access the WebAdmin console.

$ sudo ufw allow 7080/tcp
$ sudo ufw reload

10. Now open a web browser and type the following URL to access OpenLiteSpeed WebAdmin console.

http://SERVER_IP:7080
OR
http://localhost:7080

Enter the username and password you set above, and click on “Login“.

OpenLiteSpeed WebAdmin Login

OpenLiteSpeed WebAdmin Login

OpenLiteSpeed WebAdmin Dashboard

OpenLiteSpeed WebAdmin Dashboard

11. By default, OpenLiteSpeed 1.4 uses LSPHP 5, you need to make a few changes to setup LSPHP 70 as explained below.

Go to Server Configuration → External App → Add button on the right side to add new “lsphp70” as shown in the screen shot below.

Add PHP 7 Support to OpenLiteSpeed

Add PHP 7 Support to OpenLiteSpeed

12. Then define the new External App, set type to “LiteSpeed SAPI App” and click next to add the new external application’s name, address, maximum number of connections, initial response timeout, and retry timeout.

Name: 					lsphp70
Address:    				uds://tmp/lshttpd/lsphp.sock
Notes: 					LSPHP70 Configuration 
Max Connections: 			35
Initial Request Timeout (secs): 	60
Retry Timeout : 			0

Set External App

Set External App

Configure External App

Configure External App

Note that the most critical configuration here is the Command setting, it tells the external app where to find PHP executable it will use – provide the absolute path of LSPHP70:

Command: 	/usr/local/lsws/lsphp70/bin/lsphp	

And click on the Save button to save the above configurations.

13. Next, click on Server Configuration → Script Handler and edit the default lsphp5 script handler, enter the following values.

Suffixes: 		php
Handler Type: 		LiteSpeed SAPI
Handler Name:		lsphp70
Notes:			lsphp70 script handler definition 

Configure Script Handler

Configure Script Handler

14. By default, most HTTP servers are associated with or listen on port 80, but OpenLiteSpeed listens on 8080by default: change it to 80.

Click on Listeners to see a list of all listeners configurations. Then click View to see all settings of the default listener and to edit, click Edit.

Set the port to 80 and save the configuration and save the settings.

Set OpenLiteSpeed Port

Set OpenLiteSpeed Port

15. To reflect the above changes, gracefully restart OpenLiteSpeed by clicking on the restart button and click yes to confirm.

Restart OpenLiteSpeed Server

Restart OpenLiteSpeed Server

16. Add firewall rules to permit port 80 via the firewall.

$ sudo ufw allow 80/tcp
$ sudo ufw reload

Step 5: Test PHP 7 and OpenLiteSpeed Installation

17. Finally verify that OpenLiteSpeed is running on port 80 and PHP 7 using following URL’s.

http://SERVER_IP
http://SERVER_IP/phpinfo.php 

18. To manage and control OpenLiteSpeed service, use these commands.

# /usr/local/lsws/bin/lswsctrl start            #start OpenLiteSpeed
# /usr/local/lsws/bin/lswsctrl stop             #Stop OpenLiteSpeed 
# /usr/local/lsws/bin/lswsctrl restart          #gracefully restart OpenLiteSpeed (zero downtime)
# /usr/local/lsws/bin/lswsctrl help             #show OpenLiteSpeed commands

Step 6: Install MariaDB for OpenLiteSpeed

20. Install MariaDB database management system using following command.

$ sudo apt install mariadb-server

21. Next, start the MariaDB database system and secure its installation.

$ sudo systemctl start mysql
$ sudo mysql_secure_installation

After running the security script above, you will be prompted to enter the root password, simply press [Enter]without providing it:

Enter current password for root (enter for none):

You will also be asked to answer the questions below, simply type y to all the questions to set a root password, remove anonymous users, turn off remote root login, remove the test database and reload privilege tables:

Set root password? [Y/n] y Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y

You can find additional information from OpenLitespeed Homepage: http://open.litespeedtech.com/mediawiki/

You may also like to read following related articles.

  1. Installing LAMP (Linux, Apache, MariaDB, PHP/PhpMyAdmin) in RHEL/CentOS 7.0
  2. Install Latest Nginx 1.10.1, MariaDB 10 and PHP 5.5/5.6 on RHEL/CentOS 7/6
  3. How To Install Nginx, MariaDB 10, PHP 7 (LEMP Stack) in 16.10/16.04
  4. How to Install LAMP with PHP 7 and MariaDB 10 on Ubuntu 16.10

That’s all! In this tutorial, we have explained how to setup OpenLiteSpeed, PHP 7 and MariaDB on Debian/Ubuntu systems. If you have any queries or additional thoughts do share using the comment section.

Source

Install OpenLiteSpeed (HTTP), PHP 7 & MariaDB on CentOS 7

OpenLiteSpeed is a free and open source, super lightweight HTTP server for Unix-like operating systems including Linux and Windows OS as well – designed by LiteSpeed Technologies.

It is feature-rich; high performance HTTP server that can be used to manage hundreds of thousands of simultaneous connections without critical server load issues, and it also supports third-party modules via API (LSIAPI).

OpenLiteSpeed Features:

  • High performance, event-driven architecture.
  • Super light-weight, minimal CPU and memory resources.
  • Ships with Apache-compatible rewrite rules.
  • User friendly WebAdmin GUI.
  • Supports numerous modules to enhance its functionality.
  • Allows creation of virtual hosts.
  • Supports high-performance page caching.
  • Several different versions of PHP installation support.

In this article, we will explain how to install and configure OpenLiteSpeed – High Performance HTTP Web Server with PHP 7 and MariaDB support on CentOS 7 and RHEL 7.

Step 1: Enable OpenLitespeed Repository

1. First install and enable own OpenLitespeed Repository to install latest version of OpenLiteSpeed and PHP 7using following command.

# rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm

Install OpenLiteSpeed Repository

Install OpenLiteSpeed Repository

Step 2: Install OpenLiteSpeed on CentOS 7

2. Now install OpenLiteSpeed 1.4 (the latest version at the time of this writing) with the YUM package managercommand below; this will install it under the /usr/local/lsws directory.

# yum install openlitespeed

Install OpenLiteSpeed on CentOS-7

Install OpenLiteSpeed on CentOS-7

3. Once installed, you can start and confirm the OpenLiteSpeed version by running.

# /usr/local/lsws/bin/lswsctrl start
# /usr/local/lsws/bin/lshttpd -v

Check OpenLiteSpeed Version

Check OpenLiteSpeed Version

4. By default, OpenLiteSpeed runs on port “8088, so you need update the firewall rules to permit port 8088 via the firewall to access OpenLiteSpeed default site on the server.

# firewall-cmd --zone=public --permanent --add-port=8088/tcp
# firewall-cmd --reload

5. Now open a web browser and type the following URL to verify the default page of OpenLiteSpeed.

http://SERVER_IP:8088/ 
or 
http://localhost:8088

Verify OpenLiteSpeed Page

Verify OpenLiteSpeed Page

Step 3: Install PHP 7 for OpenLiteSpeed

6. Here, you need to enable the EPEL repository from which you will install PHP 7 with the following command.

# yum install epel-release

7. Then install PHP 7 and a few necessary modules for OpenLiteSpeed with the command below, it will install PHP as /usr/local/lsws/lsphp70/bin/lsphp.

# yum install lsphp70 lsphp70-common lsphp70-mysqlnd lsphp70-process lsphp70-gd lsphp70-mbstring lsphp70-mcrypt lsphp70-opcache lsphp70-bcmath lsphp70-pdo lsphp70-xml

Attention: You might have noticed that here PHP is not installed in the usual way, you must prefix it with lsbecause there is a distinct PHP for LiteSpeed.

8. To install additional PHP modules, use the command below to list all the available PHP modules.

# yum search lsphp70
Sample Output
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager, versionlock
This system is not registered with Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
 * base: centos.mirror.snu.edu.in
 * epel: mirror.premi.st
 * extras: mirrors.nhanhoa.com
 * rpmforge: mirror.veriteknik.net.tr
 * updates: centos.mirror.snu.edu.in
=============================================================================================== N/S matched: lsphp70 ================================================================================================
lsphp70-debuginfo.x86_64 : Debug information for package lsphp70
lsphp70-pecl-igbinary-debuginfo.x86_64 : Debug information for package lsphp70-pecl-igbinary
lsphp70.x86_64 : PHP scripting language for creating dynamic web sites
lsphp70-bcmath.x86_64 : A module for PHP applications for using the bcmath library
lsphp70-common.x86_64 : Common files for PHP
lsphp70-dba.x86_64 : A database abstraction layer module for PHP applications
lsphp70-dbg.x86_64 : The interactive PHP debugger
lsphp70-devel.x86_64 : Files needed for building PHP extensions
lsphp70-enchant.x86_64 : Enchant spelling extension for PHP applications
lsphp70-gd.x86_64 : A module for PHP applications for using the gd graphics library
lsphp70-gmp.x86_64 : A module for PHP applications for using the GNU MP library
lsphp70-imap.x86_64 : A module for PHP applications that use IMAP
lsphp70-intl.x86_64 : Internationalization extension for PHP applications
lsphp70-json.x86_64 : JavaScript Object Notation extension for PHP
lsphp70-ldap.x86_64 : A module for PHP applications that use LDAP
lsphp70-mbstring.x86_64 : A module for PHP applications which need multi-byte s
...

Step 4: Configure OpenLiteSpeed and PHP 7

9. Now configure OpenLiteSpeed and PHP 7, and then set the standard HTTP port 80 as explained below.

As we mentioned earlier on, OpenLiteSpeed comes with a WebAdmin console which is associated to port 7080.

Begin by configuring the admin username and password for the OpenLiteSpeed WebAdmin console; run the following command to do so:

# /usr/local/lsws/admin/misc/admpass.sh
Set OpenLiteSpeed Admin Account
Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: tecmint

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password: 
Retype password: 
Administrator's username/password is updated successfully!

10. Next update firewall rules to permit port 7080 via the firewall to access the WebAdmin console.

# firewall-cmd --zone=public --permanent --add-port=7080/tcp
# firewall-cmd --reload

11. Now open a web browser and type the following URL to access OpenLiteSpeed WebAdmin console.

http://SERVER_IP:7080
OR
http://localhost:7080

Enter the username and password you set above, and click on “Login“.

OpenLiteSpeed WebAdmin Login

OpenLiteSpeed WebAdmin Login

OpenLiteSpeed WebAdmin Dashboard

OpenLiteSpeed WebAdmin Dashboard

12. OpenLiteSpeed uses LSPHP 5 by default, you need to make a few changes to setup LSPHP 70 as explained below.

To do that, go to Server Configuration → External App → Add button on the right side to add new “lsphp70” as shown in the screen shot below.

Add PHP 7 Support to OpenLiteSpeed

Add PHP 7 Support to OpenLiteSpeed

13. Then define External App, set type to “LiteSpeed SAPI App” and click next to add the new external application’s name, address, maximum number of connections, initial response timeout, and retry timeout.

Name: 					lsphp70
Address:    				uds://tmp/lshttpd/lsphp.sock
Notes: 					LSPHP70 Configuration 
Max Connections: 			35
Initial Request Timeout (secs): 	60
Retry Timeout : 			0

Set External App

Set External App

Configure External App

Configure External App

The most important config here is the Command setting which instructs the external app where to find PHP executable it will use; point it to the LSPHP70 installation:

 Command: 	/usr/local/lsws/lsphp70/bin/lsphp	

Then click on the Save button to save the above configurations.

14. Next, click on Server Configuration → Script Handler and edit the default lsphp5 script handler, use the values below. Once you are done, save the settings.

Suffixes: 		php
Handler Type: 		LiteSpeed SAPI
Handler Name:		lsphp70
Notes:			lsphp70 script handler definition 

Configure Script Handler

Configure Script Handler

15. The default port HTTP servers normally listen on port 80, but for OpenLiteSpeed it is 8080: change it to 80.

Click on Listeners to see a list of all listeners configurations. Then click View to see all settings of the default listener and to edit, click Edit. Set the port to 80 and save the configuration and save the settings.

Set OpenLiteSpeed Port

Set OpenLiteSpeed Port

16. To reflect the above changes, gracefully restart OpenLiteSpeed by clicking on the restart button and click yes to confirm.

Restart OpenLiteSpeed Server

Restart OpenLiteSpeed Server

Step 5: Verify PHP 7 and OpenLiteSpeed Installation

17. Now test if the OpenLiteSpeed server is listening on port 80. Modify firewall rules to permit port 80 via the firewall.

# firewall-cmd --zone=public --permanent --add-port=80/tcp
# firewall-cmd --reload 

18. Finally verify that OpenLiteSpeed is running on port 80 and PHP 7 using following URL’s.

http://SERVER_IP
http://SERVER_IP/phpinfo.php 

19. To manage and control OpenLiteSpeed service, use these commands.

# /usr/local/lsws/bin/lswsctrl start 		#start OpenLiteSpeed
# /usr/local/lsws/bin/lswsctrl stop   		#Stop OpenLiteSpeed 
# /usr/local/lsws/bin/lswsctrl restart 		#gracefully restart OpenLiteSpeed (zero downtime)
# /usr/local/lsws/bin/lswsctrl help 		#show OpenLiteSpeed commands

Step 6: Install MariaDB for OpenLiteSpeed

20. Install MariaDB database management system using following command.

# yum install openlitespeed mariadb-server

21. Next, start the MariaDB database system and secure its installation.

# systemctl start mariadb
# mysql_secure_installation

First, it will ask you to provide MariaDB root password, just press ENTER to set a new root password and confirm. For other questions, simply hit ENTER to accept the default settings.

You can find additional information from OpenLitespeed Homepage: http://open.litespeedtech.com/mediawiki/

You may also following related articles.

  1. Installing LAMP (Linux, Apache, MariaDB, PHP/PhpMyAdmin) in RHEL/CentOS 7.0
  2. Install Latest Nginx 1.10.1, MariaDB 10 and PHP 5.5/5.6 on RHEL/CentOS 7/6
  3. How To Install Nginx, MariaDB 10, PHP 7 (LEMP Stack) in 16.10/16.04
  4. How to Install LAMP with PHP 7 and MariaDB 10 on Ubuntu 16.10

In this article, we have explained you through the steps for installing and configuring OpenLiteSpeed with PHP 7 and MariaDB on a CentOS 7 system.

We hope that everything went on well, otherwise send us your queries or any thoughts via the comment section below.

Source

WP2Social Auto Publish Powered By : XYZScripts.com