Quantcast
Channel: LINUX HOWTO – LinOxide
Viewing all 382 articles
Browse latest View live

How to Setup ClipBucket to Start Video Sharing Website in Linux

$
0
0

ClipBucket is a free and open source software which helps us to create a complete video sharing website like Youtube, Dailymotion, Metacafe, Veoh, Hulu in few minutes of setup. ClipBucket is the fastest growing application which was first started as Youtube Clone but now its advance features & enhancements makes it the most versatile, reliable & scalable media distribution platform with latest social networking features. It uses FFMPEG for video conversion and thumbs generation which is the most widely used application so, users can stream it straight away using the Flash & HTML 5 Players. Here are some of the awesome features available in ClipBucket.

  1. ClipBucket is 100% free and open source web application making it extensible and pretty easy to customize.
  2. It uses FFMpeg for real time conversion of videos to make on fly video conversion allowing users to stream using the Flash & HTML 5 Players.
  3. It has a beautiful media management, user management and messaging system.
  4. It also contains ajax based comments, ratings and channels and user feeds.
  5. In addition, it also consists of a built-in language editor.
  6. ClipBucket promises to make it 100% secure from different Security issues like SQL injection.

Here are some easy steps on how we can setup ClipBucket to start our own Video Sharing platform running in a linux based operating system. In this tutorial, we'll cover the installation of ClipBucket in Ubuntu 14.04 LTS and CentOS 7 linux distributions.

1. Installing LAMP Stack

First of all, we'll need to install a complete LAMP Stack. LAMP stack is the combination of Apache Web Server, MySQL/MariaDB Database server and PHP modules. In order to setup, we'll need to run the following command as shown below with respect to the distribution of linux we're running. Here, in this tutorial, we'll be focusing on two distributions of linux, CentOS and Ubuntu.

On Ubuntu 14.04

First of all, we'll gonna update the local repository index of our Ubuntu system so that we'll get the repository index of the latest available software packages.

# apt-get update

After the update is complete, we'll go for the installation of the lamp stack using apt-get command line as shown below.

# apt-get install apache2 mariadb-server php5 php5-gd php5-mysql php5-curl php5-xsl php5-cli php-pear unzip

In Ubuntu, we'll be asked to enter a new password for the MariaDB root user as shown below. We'll need this password in future for accessing the root user of MariaDB database server.

Set MariaDB Root Password Ubuntu

On CentOS 7

On CentOS 7, as we have yum as the package manager, we'll run the following command to install lamp stack.

# yum install httpd mariadb-server mariadb php php-gd php-mysql php-curl php-xsl php-cli php-mbstring php-pear unzip

2. Installing ImageMagick

After our LAMP Stack has been successfully installed, we'll now go for the installation of ImageMagick in our linux machine. ImageMagick will allow our clipbucket to process and manipulate the images. To setup, we'll need to run the following commands according to the linux distribution we are running in our machine.

On Ubuntu 14.04

# apt-get install imagemagick php5-imagick
# php5enmod imagick

On CentOS 7

# yum install ImageMagick ImageMagick-devel ImageMagick-perl

After installing ImageMagick and its other packages, we'll now install imagick which is a php module for ImageMagick. To install that, we'll need to run pecl command as shown below.

# pecl install imagick

And then, we'll need to append /etc/php.ini configuration file and add extension=imagick.so in the end of the file.

# echo extension=imagick.so >> /etc/php.ini

3. Installing FFMPEG

Next, we'll need to setup FFMPEG in our system. FFMPEG allows us to easily record, convert and stream audio and video. It will be used by Clipbucket to make a working video streaming site. In order to install it, we'll need to run the following commands in a console or terminal with sudo or root access as shown below.

On Ubuntu 14.04

As FFMPEG is currently not available in Ubuntu's repository, we'll either need to compile it and setup using the source code or install it via a PPA hosted in launchpad. There is a PPA of FFMPEG available which we can add by running the following command.

# apt-add-repository ppa:mc3man/trusty-media

After done, we'll need to update the local repository index using the following command.

# apt-get update

Then, we can install the required FFMPEG packages by running the following apt-get command.

# apt-get install ffmpeg gstreamer0.10-ffmpeg

On CentOS 7

FFMPEG is also not available in the official repository of CentOS so, we'll need to install NUX Dextop Release and EPEL "Extra Packages for Enterprise Linux" repository in our CentOS machine as its available in it.

# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
# yum install epel-release

After the repositories are added in our machine, we'll now go for the installation of FFMPEG in our machine by running the following yum package manager.

# yum install ffmpeg

4. Installing FLVTool2

We'll now install FLVTool2 which is an application for the manipulation of Macromedia Flash Video files (FLV).  It can calculate a lot of meta data, insert an onMetaData tag, cut FLV files, add cue points and more. To install it we'll first need to install ruby in our machine. To do so, we'll need to run the following command.

Installing Ruby

On Ubuntu 14.04

# apt-get install ruby

On CentOS 7

# yum install ruby

After ruby and its dependencies are installed successfully, we'll need to install flvtool2 using gem as shown below.

Installing via gem

# gem install flvtool2

Fetching: flvtool2-1.0.6.gem (100%)
Successfully installed flvtool2-1.0.6
1 gem installed
Installing ri documentation for flvtool2-1.0.6...
Installing RDoc documentation for flvtool2-1.0.6...

5. Installing MP4Box (GPAC)

we'll then need to install GPAC which is also known as MP4Box. It is needed by Clipbucked for performing many manipulations on multimedia files like AVI, MPG, TS, but mostly on ISO media files like MP4, 3GP. To install it, we'll need to execute the following command depending on the distributions we are running.

On Ubuntu 14.04

# apt-get install gpac mediainfo

On CentOS 7

# yum install gpac mediainfo

6. Configuring PHP Configurations

After everything above is installed successfully, we'll now go for configuring the PHP configuration. We'll need to edit the php.ini file which is located in different directory according to the distribution. In Ubuntu, php.ini file is located under /etc/php5/apache2/ directory whereas in CentOS, it is located under /etc/ directory.

On Ubuntu 14.04

# nano /etc/php5/apache2/php.ini

On CentOS 7

# nano /etc/php.ini

After opening the file with the text editor, we'll make sure that we have the configuration file configured as shown below. We'll need to append the opened file as the configurations shown below.

upload_max_filesize = 500M
max_execution_time = 300
max_input_time = 300
memory_limit = 256M
magic_quotes_gpc = on
magic_quotes_runtime = off
post_max_size = 500M
register_globals = off
safe_mode = off
output_buffering = off
display_errors = on

After done, we'll need to restart the Apache Web Server that is running in our machine.

On Ubuntu 14.04

# service apache2 restart

On CentOS 7

# systemctl restart httpd

7. Configuring MariaDB server

As we have already set password for our MariaDB root user in our machine running Ubuntu, we'll simply skip this step of configuring MariaDB and continue the next step of creating the database. But if we are running CentOS, we haven't configured MariaDB server so, we'll need to follow this step.

At first, as we haven't set any root password for our MariaDB server, we'll need to configure a root password for it. And after its done, we'll move forward towards the creation of a database user and a database so that Clip-Bucket can utilize it to store its data. To configure MariaDB and assign a root password, we’ll need to run the following command.

# mysql_secure_installation
This will ask us to enter the password for root but as we haven’t set any password before and its our first time we’ve installed mariadb, we’ll simply press enter and go further. Then, we’ll be asked to set root password, here we’ll hit Y and enter our password for root of MariaDB. Then, we’ll simply hit enter to set the default values for the further configurations.
….
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

installation should now be secure.
Thanks for using MariaDB!

8. Creating a MariaDB Database

Next, we’ll login to the MariaDB command prompt as root. Here, we’ll need to enter the password of the MariaDB root account that we had set above.

# mysql -u root -p

After we’re logged in into the mariadb command prompt, we’ll gonna create the database for clip-bucket.

> CREATE DATABASE clipbucketdb;
> CREATE USER 'clipbucketuser'@'localhost' IDENTIFIED BY 'Pa$$worD';
> GRANT ALL PRIVILEGES ON clipbucketdb.* TO 'clipbucketuser'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;

 

 Creating Database Clipbucket

Finally, we’ve successfully created a database named clipbucketdb with username clipbucketuser and password as Pa$$worD .

Note: It is strongly recommended to replace the above variables as your desire for the security issue.

9. Configuring Apache Web Server

We'll now add a new virtualhost in the apache configuration so that we can define a specific apache configuration to our clipbucket installation. Creating it will help us to define specific ports, webroot, domain, alias and other configurations for our ClipBucket installation. Here are some configurations we'll setup in this tutorial respective to the distribution of linux we're running.

On Ubuntu 14.04 LTS

# touch /etc/apache2/sites-available/clipbucket.conf
# ln -s /etc/apache2/sites-available/clipbucket.conf /etc/apache2/sites-enabled/clipbucket.conf
# nano /etc/apache2/sites-available/clipbucket.conf

Now, we'll gonna add the following lines of configuration into the opened file.

<VirtualHost *:80>
ServerAdmin info@clipbucket.linoxide.com
DocumentRoot /var/www/clipbucket/
ServerName clipbucket.linoxide.com
ServerAlias www.clipbucket.linoxide.com
<Directory /var/www/clipbucket/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/clipbucket.linoxide.com-error_log
CustomLog /var/log/apache2/clipbucket.linoxide.com-access_log common
</VirtualHost>

After done, we'll gonna save the file and exit the text editor. Then, we'll need to make sure that mod is enabled. To enable it, we'll need to execute the following command.

# a2enmod rewrite

Enabling module rewrite.
To activate the new configuration, you need to run:
service apache2 restart

Then, we'll restart our apache web server.

# service apache2 restart

On CentOS 7

In our CentOS machine, we'll create a file named clipbucket.conf under /etc/httpd/conf.d/ directory using a text editor.

# nano /etc/httpd/conf.d/clipbucket.conf

Then, we'll gonna add the following lines of configuration into the file.

<VirtualHost *:80>
ServerAdmin info@clipbucket.linoxide.com
DocumentRoot /var/www/clipbucket/
ServerName clipbucket.linoxide.com
ServerAlias www.clipbucket.linoxide.com
<Directory /var/www/clipbucket/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/clipbucket.linoxide.com-error_log
CustomLog /var/log/httpd/clipbucket.linoxide.com-access_log common
</VirtualHost>

Once done, we'll simply save the file and exit the editor. And then, we'll gonna restart our apache web server.

# systemctl restart httpd

10. Downloading ClipBucket

We'll now go for downloading the Clip Bucket package from the Official Clip Bucket Download Page . As the latest release of Clip Bucket is version 2.8, we'll get the link from the download page and then start the download using wget as follows under /tmp/ directory.

# cd /tmp/
# wget http://downloads.sourceforge.net/project/clipbucket/ClipBucket%20v2/clipbucket-2.8.v3354-stable.zip

--2015-12-12 11:15:16-- http://downloads.sourceforge.net/project/clipbucket/ClipBucket%20v2/clipbucket-2.8.v3354-stable.zip
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
...
Connecting to liquidtelecom.dl.sourceforge.net (liquidtelecom.dl.sourceforge.net)|197.155.77.8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10710544 (10M) [application/octet-stream]
Saving to: 'clipbucket-2.8.v3354-stable.zip'
100%[===============================================>] 10,710,544 37.0KB/s in 3m 1s
2015-12-12 11:18:18 (57.9 KB/s) - 'clipbucket-2.8.v3354-stable.zip' saved [10710544/10710544]

After the download is completed, we'll gonna extract the zip file using unzip.

# unzip clipbucket-2.8.v3354-stable.zip

Once the compressed zip file is extracted, we'll get inside the extracted folder in which we'll see two folders named upload and do_not_upload. Under upload folder we'll see that there is the ClipBucket installation file which we'll copy to the webroot of apache server ie /var/www/html/ by default. Whereas under do_not_upload folder, we'll see a file named admin_change_pass.php which we can use to change the default password of Clipbucket login administration user.

To copy the installation files and directories of Clipbucket which lies under upload directory, we'll need to run the following command.

# mkdir /var/www/clipbucket
# cp -r /tmp/clipbucket-2.8.v3354-stable/upload/* /var/www/clipbucket/
# cp /tmp/clipbucket-2.8.v3354-stable/upload/.htaccess /var/www/clipbucket/

11. Fixing File Permission

After the compressed Clip Bucket zip file is extracted and moved to the webroot, we'll go further towards fixing of permission in the files and directories which lies under the installation directory.

# chmod -R 777 /var/www/clipbucket/includes/
# chmod -R 777 /var/www/clipbucket/files/
# chmod -R 777 /var/www/clipbucket/images/
# chmod -R 777 /var/www/clipbucket/cache/
# chmod -R 777 /var/www/clipbucket/cb_install/

After that, we'll also set the ownership of the installation directory to apache user as it should have full access to the files. To set the ownership of the directory to apache processes, we'll need to run the following command according to the distribution as the apache process owner may be different in different linux distribution.

On Ubuntu 14.04

# chown www-data:www-data -R /var/www/clipbucket/

On CentOS 7

# chown apache:apache -R /var/www/clipbucket/

12. Setting Up Crons

Now, its time for setting up the cronjob for making some scripts automated. We'll need to run crontab -e command which will open the crontab file in which we'll configure the automation.

# crontab -e

Then, we'll simply need to append the file with the following lines and we can even adjust the frequency of it according to our need for better performance.

* * * * * php -q /var/www/clipbucket/actions/video_convert.php
* * * * * php -q /var/www/clipbucket/actions/verify_converted_videos.php
0 0,12,13 * * * php -q /var/www/clipbucket/actions/update_cb_stats.php

After done, we'll simply save and close the text editor.

13. Allowing Firewall

Now, we'll allow port 80 to expose on the internet so that our site is accessible in the same network. To enable http or allow port 80, we'll need to run the following command.

On Ubuntu 14.04

Iptables is a very popular firewall solution program used in Ubuntu 14.04. So, to allow or expose port 80, we'll need to execute the following iptables command.

# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# iptables-save > /etc/iptables-up.rules

On CentOS 7

As systemd is used as the init system in CentOS 7, we'll have firewalld installed for firewall program. To allow port 80 or http service, we'll need to run the following commands.

# firewall-cmd --permanent --add-service=http
# firewall-cmd --reload

14. Web based Installation

Finally, as we have setup and configured everything correctly in above steps, we'll now go further towards the web based installation of ClipBucket. To do so, we'll need to point our web browser to http://ip-address/ or http://domain.com according to the configuration of the server. Here, in this tutorial, we'll point our browser to http://clipbucket.linoxide.com/ . After the site is loaded in our browser, we'll see the first web installation page of Clipbucket asking us to accept the license and continue the installation.

ClipBucket Web Installation License

Once we have clicked on I agree and Continue, we'll be directed towards the next step of the installation where we'll see the components installed and missing in our system. Here, as PhpShield is an optional package, we haven't installed it so it must be showing red cross in it. Though, if you need to setup the missing dependencies for better performance, you can do that later too. And after that, we'll click on Continue to Next Step to continue further towards the next page.

Dependencies Check

In this page, we'll see everywhere green colored tick as we have successfully made those directories writeable in the above steps. So, we'll continue further towards the database page.

Directory Permission Check

We'll now further set the database configuration according to the database we had created above.  Here, we'll keep the hostname as localhost, database name as clipbucketdb, database user as clipbucketuser and password as Pa$$worD , and after done, we'll simply move forward by clicking on Check Connection in order to ensure that our ClipBucket application is able to connect to the database server.

Database Configuration Clipbucket

Next, we'll be asked to set the admin username, password and email address. Here, we set the default username and password ie admin and admin respectively.

Admin Login Config Clipbucket

Now, we'll be asked to enter the Website Title, Slogan and URL of our brand new video streaming site.

Setting Site Information

Then, finally we'll see another screen where we'll be said that Clipbucket has been successfully installed. After its installed, we'll need to further make sure to perform post installation tasks.

ClipBucket Installation Successfull

15. Post Installation

After its installed, we'll be asked to delete cb_install directory from the Clipbucket website path. To do so, we'll need to run the following command.

# rm -rf /var/www/clipbucket/cb_install/

After its done, we'll go to the login page and enter our username and password as admin and admin respectively. We strictly recommend everyone to change your administration username and password for the security measures.

Conclusion

Finally, we have successfully installed ClipBucket in our machine running Ubuntu 14.04 LTS and CentOS 7 as linux distributions. ClipBucket is a responsive web application enabling one to run their own video streaming site without necessary for much coding. This makes any one to setup an youtube clone in their own linux machine. It can also be installed via softaculous auto installer as its installer script is available in it. We can also follow this tutorial in other linux distributions which are the derivatives of the above linux distributions. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-)

The post How to Setup ClipBucket to Start Video Sharing Website in Linux appeared first on LinOxide.


How to Configure Citrix XenServer 6.5 on VMware Workstation

$
0
0

Citrix XenServer gives you everything that you need to manage, integrate and automate a virtualized server infrastructure which consolidates a physical server's computing power into multiple virtual machines and administers their performance and use, all emulating as a standard server. Citrix XenServer is built to provide the operational requirements of a standard server and supports most of the servers operating systems, such as Linux and Windows Server, on guest server machines. All on an enterprise-class and truly Open Source cloud-proven virtual platform.

In this article we will be showing you the installation and configurations of XenServer 6.5 on a VM using VMware Workstation.

System Requirements

Your system should run on an optimized and hardened Linux partition with a Xen-enabled kernel which controls the interaction between the virtualized devices seen by VMs and the physical hardware.

The system requirements for the XenServer host are as following according to its recommendations and our used figures.

CPU: 2 GHz (Recommended)
RAM: 4 GHz (Recommended)
Disk: 20 GB (Recommended 16 GB)

Download XenServer ISO

Open this LINK to download the latest available ISO image of XenServer.

XenServer ISO

Creating New VM

Create a new VM in your virtualization environment configure its new Host name and storage. After that choose the guest Operating System as 'Other' or 'VMware ESX' and version as 'VMware ESXi 5.x' as shown.

Choose Guest OS

Then choose system resources including its RAM, CPU and Disk space and click on the finish button after confirming the settings you see in its summary.

New VM Summary

Installing XenServer

Power On the newly created VM from the console of your Workstation, attach the ISO image by browsing it from your stored location and send the 'Ctlr+Alt+Del' button to start its installation setup.

Press 'OK' key after reading the Welcome note.

XenServer Setup

Then accept the License agreement as followed the terms and conditions of Citrix Systems, Inc.

License Agreement

1) Virtual Machine Storage

You will be asked to choose the disk storage for your Virtual Machines and Enable the thin provisioning option in order to optimize storage for XenDesktop and press 'OK' to proceed to next step.

VM Storage

2) Installation Source

Then choose the installation source from the 3 available option as shown in below image to 'Local media' and click on the 'OK' button to move next.

Installation Source

3) Supplemental Packs

Choose the 'Yes' option if you have suplimental packs otherwise you can choose the 'No' option.

Suplimental Packs

4) Verify Installation

Skip the verification or select the option to test your media and press 'OK' to proceed to the next option.

Verification

5) Set Password

Configure the password for your root account that will be used for connecting the XenServer Host from XenCenter.

Set Password

6) Networking

Choose from the options to configure networking as DHCP for your Management interface on the host.

Networking

7) DNS Settings

Here you have to configure the Hostname and DNS settings as per your requirements. We will be chooseing its DNS to set it automatically via DHCP as shown below and then click on the 'OK' button to move to next option.

Networking

8) Time Zone

Select the Time Zone and City as 'London'to configure the geographical location of your XenServer Host.

Time Zone

9) System Time

We will be choosing the system time as NTP while you can also choose it from its manual time entry but in that case you have to configure that at the end of installation.

System Time

10) NTP Configuration

After selecting the NTP option we will configure its settings using the DHCP server and click on the 'OK' key to proceed.

NTP Configuration

11) Installation Confirmation

We have configure all the required information for the installation of XenServer. Now click on the 'Install XenServer' to confirm that you have are are ready to make changes on your selected disk and the data will no longer be available after installation.

Installation Confirmation

During its installation process you will be asked for New Suplimental Packs, simply skip this step to complete the installation process.

New Media

The system will take some time to prepare and complete the installation setup.

Installation Process

12) Complete Installation

After completion of the installation process you will get the XenServer Installation Complete notification and asked for removal of any local media from the drive and press 'Enter' key to reboot your system.

Complete Installation

XenServer Dashboard

Once the server is back after reboot you will see the XenServer customization page where you will be able to see and configure its required settings from here.

XenServer Status

Conclusion

We have successfully installed XenServer 6.5 version on VMware Workstation 12, so following the similar steps you can easily install it on any VMware platform. Citrix XenServer is an awesome Open Source Virtualization platform that can fulfill all your required demands in the the field of virtualization. This was the basic installation of XenServer that you have learned in this article in the further articles we will show with the help of simple steps to create your guest operation system on XenServer. If you have any suggestions or feedback don't forget to leave us a comment. We hope you enjoyed reading this article.

The post How to Configure Citrix XenServer 6.5 on VMware Workstation appeared first on LinOxide.

How to Install Django with Gunicorn and Nginx on FreeBSD 10.2

$
0
0

Django is web framework based on python, maintain by Django Software Foundation. It is free and opensource python framework for building a macro web applications. Django is powerful, make your develpment process is so fast, make your application simple and useful. Make your developer easy to maintain and deploy the project. Django is a high-level python framework with MVC (Model-View-Controller) concept, used by big company like mozilla, pinterest, disquss, instagram, bitbucket etc. In this tutorial we will guide about django installation. We will install django 1.9 with gunicorn, supervisord and nginx as the web server. Nginx running on port 80 and django framework running under gunicorn with gunicorn sock file.

Prerequisite :

  • FreeBSD 10.2 - 64bit.
  • Root privileges.

Step 1 - Update FreeBSD Repository

Log in to your freebsd server and update the repository with 'freebsd-update' command :

freebsd-update fetch
freebsd-update install

Step 2 - Install Python, SQLite3 and Pip

In this step we will install python 2.7 with pip. If you want to use python3, please use MySQL or PostgreSQL as your django database. We will install python and pip from freebsd repository with command below :

pkg install python
pkg install py27-pip

And update the pip to latest version with command :

pip install --upgrade pip

Next, install sqlite3 databse and the python module py27-sqlite3 with pkg command :

pkg install sqlite3
pkg install py27-sqlite3

Python, pip and SQLite3 installed on the freebsd server.

Step 3 - Install Django on Virtual Environment

We will install and deploy django with the normal user called 'vagrant', not as root. We will install django under virtualenv, it is virtual python environment builder, tool to create the isolated python environment. Virtualenv is available on PyPI repository, we can install it with pip command :

pip install virtualenv

Next switch to the user 'vagrant' :

su - vagrant

Create new virtual environment called 'myenv' with python2.7 as the version of it. We can create it with virtualenv command below :

mkvirtualenv --python=python2.7 myenv

It will create new directory called 'myenv', go to the directory and activate the virtual environment that has been created before :

cd myenv
source bin/activate

And this our time to install django 1.9 and a gunicorn, install all it with pip command under the virtualenv :

pip install django==1.9
pip install gunicorn

Django and Gunicorn is installed, we can check it with pip command :

pip list

Django (1.9)
gunicorn (19.4.1)

Next, create new sample project with django. We will create new project named 'myproject' with django-admin command :

django-admin startproject myproject

That command will create new directory 'myproject', go to the directory and test the django installation by running manage.py file :

cd myproject/
python manage.py runserver

runserver = start our django project with port 8000.

Django_Virtualenv

If there is no error, then proceed with the next step by editing setting.py file inside django project directory :

nano -c myproject/settings.py

In the end of the line add configuration below :

STATIC_ROOT = '/home/vagrant/myenv/myproject/static/'
STATIC_URL = '/static/'

MEDIA_ROOT = '/home/vagrant/myenv/myproject/media/'
MEDIA_URL = '/media/'

Save and exit.

And generate the static file by running command below :

python manage.py collectstatic

collectstatic used to manage the static files, it will copied the django static file to directory 'static' on myproject dir.

Django_Collectstatic

Django is configured, and the last we need to configure the gunicorn. Go to the 'myenv' directory and activate the environment, then create new file on bin directory :

cd /home/vagrant/myenv/
source bin/activate
nano -c bin/gunicorn_start

Paste configuration below :

#!/bin/bash

NAME="myproject"                                             # Django Project Name
DJANGODIR=/home/vagrant/myenv/myproject                        # Django Project Directory
SOCKFILE=/home/vagrant/myenv/myproject/run/gunicorn.sock     # Gunicorn Sock File
USER=vagrant                                                # Django Project Running under user vagrant
GROUP=vagrant                                                # Django Project Running under group vagrant
NUM_WORKERS=3
DJANGO_SETTINGS_MODULE=myproject.settings                     # change 'myproject' with your project name
DJANGO_WSGI_MODULE=myproject.wsgi                             # change 'myproject' with your project name

echo "Starting $NAME as `whoami`"

# Activate the virtual environment
cd $DJANGODIR
source ../bin/activate
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH

# Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR

# Start your Django Unicorn
# Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
exec ../bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $NUM_WORKERS \
--user=$USER --group=$GROUP \
--bind=unix:$SOCKFILE \
--log-level=debug \
--log-file=-

Save and exit.

And make the script executable :

chmod u+x bin/gunicorn_start

Django is configured with gunicorn, django will run under gunicorn sock file.

Note : If you want to exit from the virtualenv, you can use command "deactivate".

Step 4 - Install Supervisord

Supervisor is a process control on Linux and Unix operating system that allow the users to monitor and control the number of process. In this tutorial we need a py-supervisor to control the gunicorn that running with our django project.

Install py-supervisor from freebsd repository with pkg command :

pkg install py-supervisor

If it's done, add supervisor to the boot time with sysrc command, and then start it:

sysrc supervisord_enable=yes
service supervisord start

Supervisor is started, but we need to add our application to it. We can do it by editing the supervisor configuration file, go to the directory and edit the file 'supervisord.conf' with nano :

cd /usr/local/etc/
nano -c supervisord.conf

In the end of the line, add our app configuration below :

[program:myproject]
command = sh /home/vagrant/myenv/bin/gunicorn_start
user = vagrant
stdout_logfile = /home/vagrant/myenv/logs/gunicorn_supervisor.log
redirect_stderr = true
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8

Save and exit.

Now we must create new directory for the gunicorn log file with user vagrant  :

mkdir -p /home/vagrant/myenv/logs/
touch /home/vagrant/myenv/logs/gunicorn_supervisor.log

Restart the supervisor and check our application is running :

service supervisord restart
supervisorctl status

Supervisord

Step 5 - Install Nginx

We will use nginx as front end the server and run on port 80. If someone access from the browsers, the connection will be passed to gunicorn that running with the sock file.

Install nginx from the freebsd repository with pkg command :

pkg install nginx

Next configure the virtualhost for our django project. Go to the nginx configuration directory and create new directory called vhost there :

cd /usr/local/etc/nginx/
mkdir -p vhost/

Go to vhost directory and create new file conafiguration 'mydjango.conf' :

cd vhost/
nano -c mydjango.conf

Paste virtualhost configuration below :

upstream myproject_server {
server unix:/home/vagrant/myenv/myproject/run/gunicorn.sock fail_timeout=0;
}

server {

listen   80;
server_name www.djangofreebsd.com;

client_max_body_size 4G;

access_log /home/vagrant/myenv/logs/nginx-access.log;
error_log /home/vagrant/myenv/logs/nginx-error.log;

location /static/ {
alias   /home/vagrant/myenv/myproject/static/;
}

location /media/ {
alias   /home/vagrant/myenv/myproject/media/;
}

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;

# Try to serve static files from nginx, no point in making an
# *application* server like Unicorn/Rainbows! serve static files.
if (!-f $request_filename) {
proxy_pass http://myproject_server;
break;
}
}

# Error pages
error_page 500 502 503 504 /500.html;
location = /500.html {
root /home/vagrant/myenv/myproject/static/;
}
}

Save and exit.

Now we must add the virtualhost configuration to the nginx.conf. Go back to the nginx directory, edit the file nginx.conf with nano :

cd /usr/local/etc/nginx/
nano -c nginx.conf

Before the end of the line, add line below :

include vhost/*.conf;

Save and exit.

Test the nginx configuration, if there is no error, add nginx to the boot time :

nginx -t
sysrc nginx_enable=yes

And the last, restart supervisord and start nginx :

service supervisord restart
service nginx start

Now we can access our django applications with the browser, in this tutorial we use domain www.mydjango.co.

Django_with Nginx_Done

Django admin page.

Djang_Admin

Django 1.9 and gunicorn with supervisor and nginx is done.

Conclusion

Django is web application framework based on python with MVC (Model-View-Controller) concept. Django is the best solutions for you if you want to build a macro web application. It is fast and simple, free and opensource and maintained by Django Software Foundation. Django can be up with standalone, but we can use apache or nginx too as the front end of the django project.

The post How to Install Django with Gunicorn and Nginx on FreeBSD 10.2 appeared first on LinOxide.

How to Install and Configure IPFire Firewall

$
0
0

IPFire is an open source firewall distribution. It can be used as a firewall, a proxy server or a VPN gateway.It has following features.

  • Easily configurable
  • Support true random generator
  • High availability
  • Hardware accelerator for cryptography algorithm (AES-NI)

IPFire is forked from IPCop and Endian firewall distro's. Installation and basic configuration of firewall is given in following section.

Installation

In this tutorial, IPfire firewall will be installed on the VM, created on the Virtual Box software. The detail of our VM is given below.

VM details

After clicking on start button, following window appears for IPfire installation.

installation using iso

Press "Enter" button to start installation procedure.  Select the desired language from the given list.

language selection

Press "Enter" button to start installation and accept GPL license.

start installation

GPL license acceptance is shown following.

accept gpl lincese

After GPL license acceptance, windows appear for the partition of  hard disk and filesystem. Ext4 file system is selected in this installation of IPfire.

disk setup

File system selection is shown below.

file system selection

IPfire installation progress is shown in the below figure.

installation of the system

IPfire firewall successfully  installed on the VM.

successfully installed

Configuration

After reboot, basic configuration of IPfire firewall will be done. First of all, keyboard layout and time zone  are selected.

keyboard selection

time zone

Host name and local domain setting for IPfire firewall.

setting hostname

setting local domainPassword setting for root user which is used for CLI access of IPfire.

setting root user password

Password setting for admin user which is used for web access of IPfire.

admin user setting

Network configuration of IPfire is shown below. As shown in the figure that the default network configuration is GREEN & RED zones . However, it supports BLUE and ORANGE zones as well

networking creation greenandred

IPfire supported zones are shown in the following figure.

networking configuration types

In a standard IPfire  firewall installation, Green + Red means 2 Networks. Green network for home or LAN side and  Red network for  internet/external connection.

Usage of each zone is given in the following table.

zone

Assignment of available NICs to GREEN and RED zone is shown in the following snapshots.

GREEN zone

assinging cards

RED zone

red selection

Interfaces assigned to both GREEN and RED zones are shown in the below figure.

card selected

IP address setting for GREEN zone is shown below.

address selection on green

Assigned IP address and net mask is following IP = 192.168.1.115 , Net mask = 255.255.255.0

 ip address on green

IP address setting for RED zone is shown below.

red ip address setting

Assigned Static IP address and net mask are  following.  However, DHCP and PPP DIALUP (PPPoE) modes are also supported on RED interface for IP assignment.

IP = 192.168.100.1 , Net mask = 255.255.255.0

red ip address

DNS and Gateway setting for  RED interface are shown in the following snapshot.

dns and gateway setting

DHCP configuration on the GREEN interface for automatic IP assignment is given below.

dhcp server on green side configuraiton

After DHCP configuration, basic setting of IPfire are complete.

coplete setup

IPfire will reboot to apply changes and gives CLI access to user "root".

setup complete and restarting

To access CLI , enter password for user "root".

cli login

root login

Web Access of IPfire is required for further configuration. It is also used to configure firewall rules, snort configuration and VPN setting etc.

Enter IP address of GREEN interface along port 444 for web interface access. All web browsers gives exception due to untrusted certificates. Therefore accept the exception  to view the web pages.

web interface access

accept exception

Enter password for "admin" user to access the pages.

web access cred

After correct username and password, following main dashboard appears, which shows the network configuration (IP addresses on RED and GREEN zones).

main dashboard

IPFire Menu

System

This menu is used for basic setting of the  IPFire machine such as enabling ssh access, backup and setting web access password etc. System sub menu is shown in the following figure.

system menu

Status

In this menu, firewall administrator view the status of system resources such as RAM & CPU, internal and external network, entropy for TRNG and statistics for VPN's.

status

Network

As shown in the following figure that network settings such as static routing, webproxy, url filtering and wake on Lan etc is available under this menu

network menu

Services

Services such as VPN which include IPsec & OpenVPN , intrusion detection, QoS , time server etc  are listed under this menu.

services

Firewall

Main feature of IPFire distribution is providing firewall feature. Administrator or user  uses this menu to push  iptables rules on back end.

firewall

IPFire

Pakfire is used to install Addons/packages on the IPFire machine for more feature.

ipfire

Logs

As shown in the following figure that, logs of services such has IDS, firewall, proxy  and system can be view from Logs menu.

logs

Conclusion

In this article, our focus was installation and configuration of another open source firewall, IPFire. It is forked from well-known open source firewalls IPCop and Endian. It provides high availability, usage of TRNG and AES-NI features.

The post How to Install and Configure IPFire Firewall appeared first on LinOxide.

How to Manage Public Key Infrastructure with OpenSSL

$
0
0

OpenSSL is an open source cryptographic toolkit with focus on Secure Socket Layer/Transport Layer Security or SSL/TLS, widely deployed on GNU/Linux systems, it performs key part on our daily experience on the Internet. Today I will point some commands to help you manage X.509 Public Key Infrastructure (PKI) and  also use this toolkit to and encrypt/decrypt files and other data using this great tool

openssl-textcert

This document is mostly based on examples, you can refer to the examples as needed, in some cases you will see more than one way to perform an operation, others there will be passwords that you should change before using on your environment.

 OpenSSL Key Management

Most of the operations are based on keys and here are some commands to deal with private and public keys.

RSA 

RSA is one of the most deployed public-key cryptography algorithm system and here are some basic operations.

Generating Triple DES protected RSA private key 2048 bits long protected by the passphrase nonsense123

openssl genrsa -passout pass:nonsense123 -des3 -out rsa-2048-priv-key.pem 2048

You can write the corresponding public key to a file as you wish.

openssl rsa -in rsa-2048-priv-key.pem -pubout -out rsa-2048-public-key.pem

You can remove the password from a protected key and dump the key on a new file

openssl rsa -in priv-key.pem -out priv-key-no-pass.pem

The following command let verify your key.

openssl rsa -check -in server-key.pem

DSA 

The Digital Signature Algorithm is an alternative to RSA.

Generate DSA parameters.

openssl dsaparam -out dsa.param 2048

Generate DSA key using the existing parameters.

openssl gendsa -des3 -out ca.key dsa.param

X.509 Certificates

Now we are going to show some commands to manage certificates, signing requests and revocation lists.

Generating certificate

Generating certificate

Generating certificate signing request using an existing private key.

openssl req -new -key server-key.pem -out server-csr.csr

Creating a new certificate signing request and a new RSA private key 2048 bits long.

openssl req -out service-csr.pem -new -newkey rsa:2048 -nodes -keyout service-key.pem

Verify the certificate signing request.

openssl req -in server-csr.pem -noout -verify -key server-key.pem

Signing a certificate request.

openssl x509 -req -days 3650 -signkey ca.key -in ca.csr -out ca.crt

Generating a self-signed certificate with key in batch mode.

openssl req -subj "/C=BR/L=Rio de Janeiro/O=My Company/CN=www.mycomp.com" -newkey rsa:2048 -nodes -keyout domain.key -x509 -days 365 -out domain.crt

Dump certificate dates and info.

openssl x509 -noout -in apache.crt -text -purpose -dates -hash -ocspid

OpenSSL Certificate text info

OpenSSL Certificate text info

Revoke a certificate.

openssl ca -revoke mycert.pem

Generating a CRL.

openssl ca -gencrl -config openssl.cnf -crldays 7 -crlexts crl_ext -out $crl_dir/file.crl

Parsing objects with ASN1 to standard output.

openssl asn1parse -in ca.crt

ASN1 Parse certificate

ASN1 Parse certificate

Converting Encoding formats

There will be times that you will need to convert a certificate encoding to another,  you may face this for instance if you work on a mixed environment with Unices,  Windows and Java.

Converting DER, PEM and NET

Base64 encoded PEM on top, followed by the two bynaries,; the obsolete NET on the center and DER below it.

Convert a PEM encoded certificate to DER.

openssl x509 -inform PEM -outform DER -in ca.crt -out ca.der

So is the opposite, converting a DER to PEM.

openssl x509 -inform DER -outform PEM -in ca.der -out ca.pem

Testing with s_client and s_server subcommands

You can make tests on keys/ certificates and services with the s_client and the s_server.

Test your certificate and key starting s_server.

openssl s_server -key ca.key -cert ca.crt

Connecting to the test server using s_client.

openssl s_client -host localhost -port 4433 -CApath /etc/ssl/certs/

Another s_client connection using and showing certificate, key and in debug mode.

openssl s_client -connect localhost:4433 -key ca.k'ey -cert ca.crt -debug -showcerts

Start a Transport Layer Secured  to connection to a mail server.

openssl s_client -connect test.smtp.org:25 -starttls smtp -showcerts

File and Streams Encryption with OpenSSL

You can also use OpenSSL to encrypt data on your computer directly.

Encrypting files

Encrypt files using AES-256-CBC with SHA1 as Message Digest.

openssl enc -aes-256-cbc -md sha1 -e -in arquivo -out arquivo.crypt

Decrypting goes  AES-256-CBC file should be as follows.

openssl enc -aes-256-cbc -md sha1 -d -in arquivo.crypt -out arquivo

Encrypting file with Triple DES.

openssl enc -des3 -e -in arquivo -out arquivo

Decrypt the Triple DES encrypted file.

openssl enc -des3 -d -in arquivo.crypt -out arquivo.decrypted

Encrypting streams

Along with files, you can also encrypt streams such as network sockets, pipes and other *nix I/O. On the following example we use OpenSSL to safely send the passwd file through an insecure network link.

Server

First we setup a Netcat server with that will be waiting for connection. You can download Netcat here.

nc -l -p 99 8| xz -d | openssl enc -aes-256-cbc -d > /client/bkp/etc/passwd

Client

You could  now use netcat as client to connect and send your file.

cat /etc/passwd | openssl enc -e -aes-256-cbc  | xz -z | nc servidor 99

Conclusion

These are some of the most commonly used commands, you can use these commands to manage your keys, certificates and sensitive data. For more information please take a look at the official documentation, there you will find details of these and other commands and everything else to fit your needs.

Thanks for reading!

The post How to Manage Public Key Infrastructure with OpenSSL appeared first on LinOxide.

How to Install ManageEngine ServiceDesk Plus on CentOS 7

$
0
0

ManageEngine is the Enterprise IT Management Software division of ZOHO Corporation that simplifies IT management with affordable software that offers the powerful features of largest enterprises demand. It serves a diverse range of enterprise IT, networking and Telecom customers. In our today’s article we are going to show you the installation and configuration of ManageEngine's ServiceDesk Plus. ServiceDesk Plus is an ITIL-ready help desk software with integrated Asset and Project Management capabilities. With advanced ITSM functionality and easy-to-use capability, ServiceDesk Plus helps IT support teams deliver world-class service to end users with reduced costs and complexity.

ManageEngine's ServiceDesk Plus helps the enterprises in their incident management, problem management and change management. Create and publish their service catalog with custom service level agreements (SLAs) and multi-stage approvals. You can easily create projects, manage resources, track progress and integrate IT projects with requests and changes to fine-tune overall IT service delivery.

System Requirements

The system requirements for installing ServiceDesk Plus depends upon the number of technicians and nodes to used on the server. In this article will be using the minimum system resources that are required by 5-20 technicians. Following the system resources we are using in our test environment.

  • RAM: 1GB
  • CPU: 2vCPU
  • Disk: 20 GB
  • No. of Nodes: 50-200
  • Technician Login: 5-20
  • Operating System: CentOS 7 Core
  • Database: PostgreSQL

Download ServiceDesk Plus

First you have to download the ServiceDesk Plus package for Linux. Then click on the Linux 64 Bit package to start downloading your ServceDesk package.

ServiceDesk Download

If you wish to download it using 'wget' command then copy the download link address and run the command as shown below.

# wget https://www.manageengine.com/products/service-desk/91677414/ManageEngine_ServiceDesk_Plus_64bit.bin

ServiceDesk Installer

Installing ServiceDesk without GUI

To execute .bin type files, we need to assign the executable permission on this by entering the command as given below in your command prompt.

# chmod +x ManageEngine_ServiceDesk_Plus_64bit.bin

Now execute the .bin file to start the installation wizard and follow the instructions to proceed to the Next step as shown below.

# ./ManageEngine_ServiceDesk_Plus_64bit.bin -console

Starting Installation

installing servicedesk

License Agreement

Read the license agreement or type 'q' to guit and then choose the option 1 to accept the license agreement.

License Agreement

Technical Support

This is information is optional, if you wish to add your information for the technical support from ManageEngine then mention your details here.

Supprt registration

Select Country

Choose from the available options and update your country number as shown.

select country

Select Edition

We are going to choose the First Enterprise Edition. You can choose from the three available editions, that you want to install for your environment.

Select Edition

Installation Location

Here you need to specify a directory or press Enter to accept the default directory. We are going to choose another location for this as shown in the image below.

installation directory

Installation Details

The system will start preparing the summary of your selected components and then start installing on your server. This may take a while so stay calm and wait for its completion.

installation details

Installation Complete

Once the installation process is complete, you will see the message that InstallShield Wizard has successfully installed ManageEngine ServiceDesk Plus.

servicedesk installed

Starting ServiceDesk Server

After completing the installation process we need to start the server , to do so change your directory to 'bin' folder of your installation directory and then run the 'run.sh' script to start the serviceDesk server.

# cd /etc/ServiceDesk/bin/

# sh run.sh

This will takes a while to check and setup the JBoss Bootstrap environment andJBoss_HOME as shown in the below image.

start Sever

Make sure that mentioned port is opened in your firewall and SELinux. You can use the following command to allow port 8080 in CentOS 7 firewall

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

ServiceDesk Web Access

Now you can access your ServiceDesk Plus web portal by opening the link as shown above with your server IP and port '8080', then login using the 'administrator' credentials as shown.

http://your_servers_ip:8080

ServiceDesk Portal

ServiceDesk Dashboard

After providing the successful login credentials you will be welcomed by the ManageEngine ServiceDesk Plus Portal. Click on any of of the option and you will find a detailed information about its usage and customization.

Here is first look at your ServiceDesk Plus Home Page.

ServiceDesk Home

Installing ServiceDesk as a Linux Service

We need to install Service Desk Plus as a Linux Service on our CentOS 7 server other wise after closing the session the ServiceDesk server will be stopped.

So, the download the servicedesk script or copy this link location and use the 'wget' command as shown below.

# wget https://www.manageengine.com/products/service-desk/help/adminguide/servicedesk.txt

Then copy this '/etc/init.d' directory and change it permission to '755' using the below below command.

# cp servicedesk.txt /etc/init.d/servicedesk

# chmod 755 /etc/init.d/servicedesk

Use 'chkconfig' command to add the script as a startup process and Create a blank file under '/var/log' directory for logging purposes.

ServiceDesk Service

Conclusion

ServiceDesk Plus is one of the most widely used proprietary product of ManageEngine that has a large number of its features that are required by every organization. You can give it a try by getting its 1 Month trial license. The installation method is simple and quite easy to follow as you have seen in this article. so, thanks for reading and feel free to post your suggestions and leave your valuable comments.

The post How to Install ManageEngine ServiceDesk Plus on CentOS 7 appeared first on LinOxide.

How to Setup GMVault Gmail Backup on Ubuntu / CentOS

$
0
0

GMVault is a user friendly cross-platform and very lightweight command-line tool that setup most of the necessary rich features to backup and restore your gmail account. You can download it for free and install it on your computer using CLI. You can use it to backup your Gmail account to your computer, and use quick sync mode to update the backup regularly with recent emails. You can even only backup certain emails using search parameter or date range, and also encrypt the emails you backup. Plus, using some advanced parameters, you can clone your one Gmail account to another, including labels and other attributes.

Although there are bunch of ways to backup your Gmai but Gmvault is one of the most favourable for being feature-rich and highly customizable available for Windows/Mac/Linux.

Downloading GMVault

Download the latest version of Gmvault and select the right version according to your platform from its download page.

Gmvault Download

We will be using the Python Source distribution which is recommended for installing on Linux and valid for all platforms (Linux, Mac OSX, Windows). The only requirement for this is that you must have a Python 2.7.x or 2.6.x preinstalled on your Linux server whether it is Ubuntu or CentOS.

Let's copy the link location for the package and then execute the command as shown below to download the package on your Linux server.

# wget https://bitbucket.org/gaubert/gmvault-official-download/downloads/gmvault-v1.9-src.tar.gz

Extract the Archive

After downloading the Gmvault latest package, we need to extract this archive using the below command.

# tar -zxvf gmvault-v1.9-src.tar.gz

extract archive

Installing Gmvault

Before starting the installation of GM vault, make sure that the Python packages are installed on your server as a prerequisites. If they are not available on your default server then install by using below command.

Ubuntu

# apt-get install python python-setuptools

CentOS

# yum install python python-setuptools

After that change your directory to the extracted Gmvault folder and execute the below command as to run the installation setup.

# python setup.py install

gmvault installation

Using Gmvault

Run the following command to get help about all available options before using Gmvault.

# gmvault -h

using gmvault

Once the the installation process complete then we will be using the below command to sync our gmail account with Gmvault.

# gmvault sync keshifs@gmail.com

gmvault setup

The will ask you to press enter to open a new windows of your browser and takes you through an authentication process with your email account.

So login to your gmail account that you wish to integrate with Gmvault and allow it access to view and manage your Emails.

gmvault authentication

After authentication you will be provided and OAuth tokento run custom synchronization of your certain emails but it could be a better if you use your user and the password for manual authentication.

If you want a quick sync betwen your emails then run the following command on your server.

# gmvault sync --type quick your_email@gmail.com

By default, Gmvault restore the emails from $HOME/gmvault-db or %HOME%/gmvault-db into the given account. You can use the -d or --db-dir to point to another local email repository.
You might have to enter into an authentication phase if it is a new account for gmvault. Gmvault will store all credentials into $HOME/.gmvault (or %HOME%/.gmvault for Windows) and you can always go this directory and delete them if you wish.

Gmail Settings

To configure Gmail to working optimally with Gmvault, we need to check that Gmail is properly configured to let Gmvault work optimally. In Gmail, the IMAP access needs to be enable and the limit of number of emails per IMAP folders needs to be disabled.
Let's choose the 'settings' option and then click on the 'Forwarding and POP/IMAP' option to Enable your POP and IMAP for all your emails as shown in the image below.

Enable IMAP

After saving these changes click on the 'Label' option on the top bar to enable option for enabling the IMAP for Chat and all of your Emials.

Gmail setup

Conclusion

Great, Gmvault is a user friendly command-line tool that setup most of the necessary defaults to quickly sync (backup) your gmail account or restore it to a gmail account. Now you don't need to be worry about losing your important emails backup after setting up the Gmvault backup on your Linux server. Thank you for reading this article will be get back with new article for you. Don't hesitate to leave your valuable comments and suggestions.

The post How to Setup GMVault Gmail Backup on Ubuntu / CentOS appeared first on LinOxide.

How to Install Flussonic Streaming Server Ubuntu / CentOS

$
0
0

Hello and welcome to our today's article on installation Flussonic Streaming Server on Ubuntu15 and CentOS 7. Flussonic is a modern video streaming server written in Erlang. On the delivery end, Flussonic is a true multi screen platform and can serve up live streaming and video on demand content that currently serves millions of live and video on demand feeds per day. It has a complete functionality array for setting up a media resource to distribute files and broadcast satellite video or TV channels.

You can use Flussonic to ingest Flash using RTMP, HLS, MPEG-TS over HTTP or UDP, even RTSP. On the delivery end, Flussonic is a true multi screen platform and can serve up live streaming and video on demand content to iPhones, iPads, Android devices, BlackBerries, Set Top Boxes, IPTV middleware platforms and other streaming platforms.

System Resources

The minimum system requirements to the host server for running Flussonic depends on the number of concurrent connections to Flussonic server. We will be setting up the Flussonic Streaming server with minimum concurrent connections using the following system resources.

RAM: 1Gb
Processor: 2 vCPUs
Disk Space: 20 Gb
Network Adapter: 100 Mbits/s
Operating System: Ubuntu/CentOS
Concurrent Connections: 10

For stable streaming video playback with a high volume of concurrent connections, its recommended to distribute the traffic load among several real servers.

Installing Flussonic on Ubuntu 15

Connect to your Ubuntu server using the root credentials and the run the commands as shown below to add the source key for installing the Flussonic Streaming server from the debian package manager.

# wget -q -O - http://debian.erlyvideo.org/binary/gpg.key | apt-key add -;

# echo "deb http://debian.erlyvideo.org binary/" > /etc/apt/sources.list.d/erlyvideo.list;

Flussonic key

After adding the Flussonic key to the source list, update your system using the update command.

# apt-get update

system update

Once your system is updated then run the command to install the Flussonic and its derivative packages.

# apt-get install flussonic flussonic-ffmpeg flussonic-python

Press 'Y' key and hit Enter to continue.

Flussonic installation

Installing Flussonic on CentOS 7

To install Flussonic on CentOS/Red Hat Linux using the 'YUM', the first thing we need is to enable its yum repository by adding the RPM GPG key for flussonic.

# cat > /etc/yum.repos.d/Flussonic.repo <<EOF
[flussonic]
name=Flussonic
baseurl=http://debian.erlyvideo.org/rpm
enabled=1
gpgcheck=1
gpgkey=http://debian.erlyvideo.org/rpm/RPM-GPG-KEY-flussonic.com
EOF

Then run the 'yum' command as shown below to install the Flussonic server on your CentOS 7 server.

# yum --nogpgcheck install flussonic-erlang flussonic flussonic-ffmpeg flussonic-python

Installing Flussonic

Updating License

After successful installation of flussonic, you need get the trial license or purchase if you wish to use it for long in production by signing up or requesting for a trial lincese using this LINK.

Then open the license key file using any of your command line editor and add the licese key in it and close the file after sving the license key in it as shown below.

# vim /etc/flussonic/license.txt

Starting Services

To start flussonic services on Ubuntu or Linux you can use the same below command.

# /etc/init.d/flussonic restart

To check the status of flussonic service if its working fine or not, run the below command.

# /etc/init.d/flussonic status

flussonic services

You can use the below commands to stop or restart the flusonic services with the help of following commands.

# /etc/init.d/flussonic stop

# /etc/init.d/flussonic restart

To reconfigure with client connections live use the below command to reload its services.

# /etc/init.d/flussonic reload

Flussonic Version

You can check the current installed version of Flussonic on Linux by using the below commands.

On Ubuntu

# dpkg -l | grep flussonic

Flussonic Version

On CentOS

# rpm -qa | grep flussonic

Flussonic version

Flussonic Web Access

After starting the Flussonic services, open the web browser followed by the link as shown below containing your flussonic server's IP adddress and port '8080'. You will be asked to provide the administrative credentials to log in onto admin panel. So use the same credeitials that you will got in with your trial license key.

http://servers_IP:8080

Flussonic Dashboard

Now you can configure and use your flussonic streaming server mainly for IPTV OTT , CDN Organizations and Operator Video surveillance.

Conclusion

You have learned about installation of Flussonic on Ubuntu 15 and CentOS 7. Now get ready to enjoy its awesome features like VOD Streaming including streaming from mp4 and flv files,Multibitrate and multilanguage mp4 streaming, Live streaming including Satellite capturing, IP cameras support, Republishing between servers and Video Streaming including automatic DVR cleanup, timeshifted restreaming, screenshots recording, server side playlists. So, we hope you have got this article much helpful. Feel free to comment us back to show your interests.

The post How to Install Flussonic Streaming Server Ubuntu / CentOS appeared first on LinOxide.


How to Install Alfrasco ECM on CentOS 7

$
0
0

Alfrasco is a java based Electronic Content Management tool that is available with an Open Source license. This open platform helps you regain control of critical business content, strengthen compliance, optimize processes and make collaboration easy with its simple, smart and secure ways. Alfresco facilitates in multiple solutions like Electronic content management, Web Content Management and Digital Image management. You can organize and consolidate content to improve productivity and regain control of valuable corporate information. Share information and work effectively with people inside and outside the organization, including partners and customers. Using the process management solution of Alfresco you can reduce costs and gain new operating efficiencies. Automate and optimize critical business processes such as invoice processing and expense approvals etc.

Download Alfrasco Community Edition

In order to get Alfresco up and running on CentOS 7 Operating System we will be using the binary installer that is available on Alfrasco site to Download Alfrasco Community Edition .

Alfrasco Download

If you have Internet access then use 'wget' command as shown below to directly download the package for your required OS on your server.

# wget http://dl.alfresco.com/release/community/5.0.d-build-00002/alfresco-community-5.0.d-installer-linux-x64.bin

This binary installation script will allows you to install all the components that are needed to run Alfresco, including Java, Tomcat and MySQL etc.

Installing Alfrasco Community Edition

After downloading the binary installer of Alfrasco you need to execute it to start its setup wizard. To do so make sure that the binary script has executable permissions. Before starting installation you should modify your umask to at least "0022" before launching the installer. After the installation has completed, you can reset the umask permissions to your original values.

# chmod +x alfresco-community-5.0.d-installer-linux-x64.bin

# umask 0022

Once you have executed the binary installation script after setting up the proper umask, you will go through a number of steps to complete the installation wizard.

# ./alfresco-community-5.0.d-installer-linux-x64.bin

1) Language Selection

First of all you will be asked for Language Selection. You can simply hit the 'Enter' key to choose the default 'English' language as shown in below image.

alfresco setup

2) Installation Type

The Alfresco Community Setup Wizard be starts from where you have to choose the Installation Type from the two available options 'EASY' and Advance. We will be choosing the First option indicating the Easy installation as a starting user.

installation type

3) Installation Folder

Choose the default option for '[/opt/alfresco-5.0.d]' by pressing the Enter key or specify your own location that you wish to choose for installing the Alfresco tool.

4) Admin Password

Then you need to configure the password to use for the Alfresco administrator account before moving to the next step.

admin password

5) Alfresco as a Service

Type 'Y' for Yes to Install Alfresco Community as a service on you Linux server. This will be automatically starting its service every time the machine is started.

alfresco as a service

Warning:
You might need to ignore the following Warning by pressing the "Enter" key to continue if you are using less than the recommended amount of RAM.

----------------------------------------------------------------------------
Warning!

This environment is not configured optimally for Alfresco - please carefully
review this list before continuing.

While these issues will not prevent Alfresco from functioning, some product
features may be unavailable, or the system may not perform optimally.

Insufficient system RAM (4.0GB+): 3.69GB
Press [Enter] to continue:

----------------------------------------------------------------------------

7) Starting Setup

Your Alfresco Setup is now ready to begin installing Alfresco Community on your Linux server. Press the 'Y' key to continue and wait while Setup installs Alfresco Community on your system. After taking few minutes depending upon your network speed the setup will be finished after installing Alfresco Community. Type 'Y' or 'n' if you don't want to view Readme file.

completeing the installation

8) Setup Alfresco Share

This one is the last setup to complete the installation, just hit the 'y' key to launch Alfresco Community Share. After this you will that PostgreSQL and Tomcat services will be starts as shown below.

Launch share

The Alfresco server is launched automatically as a service called alfresco. This service is comprises of the "postgresql" and "Tomcat Server".

9) Starting Alfresco Services Manually

If you did not automatically launch Alfresco at the end of the setup wizard, to start Alfresco, you need to start all the services manually. Use the following commands to stop and start alfresco services on your CentOS 7 server.

[root@alfresco alfresco-5.0.d]# ./alfresco.sh stop

[root@alfresco alfresco-5.0.d]# ./alfresco.sh start

Alfresco services

10) Firewall Access

If you are working under your restricted environment with firewall enabled. Then make sure to allow the following port in your system firewall as well any external firewall and keep. If you find any issue while accessing Alfresco then make sure that your "SELinux" is not permitting it. You can set it to "Permissiove" for the time being.

For Tomcat Server Port:

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

Tomcat Shutdown Port:

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

Tomcat SSL Port:

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

Tomcat AJP Port:

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

Then run the command to reload your firewall and check if you can see the newly added rules in your firewall.

[root@alfresco ~]# firewall-cmd --reload

[root@alfresco ~]# iptables -L -n -v

To configure your SELinux you can use below commands.

For Permissive:

# setenfroce 0

For Inforcing:

# setenforce 1

Firewall rules

Access to Alfresco Dashboard

Once your alfresco services are up and running, then open your web browser using port 8080 and Log on to Alfresco as the admin user. Enter the password that you have specified in the Admin Password window during the wizard.

http://your_servers_ip:8080/share

Alfresco Login

Upon successful login credentials you be greeted to your dashboard, Administrator account. The personal dashboard shows you what's going on in the sites you belong to. Learn to see what you can do with Alfresco by watching a video tutorial available on your dashboard. Or start create a new site to share content with other site members.

Alfresco Dashboard

Conclusion

Welcome to your new start with Alfresco, there's never an end in learning. Hope you have enjoyed this article. Now start using Alfresco whether you are using Alfresco offers a fully fledged free version to test and it has an opensource model which will allow for the development of a “best of breed” application. Alfresco offers integration into MS Office Alfresco provides access via CIFs protocol to provide a familiar environment for new users. You can simplify the content control required to meet government regulations, corporate policies and audit requirements etc. Let's get back to you with awesome articles and don't forget to comment us back, Cheers.

The post How to Install Alfrasco ECM on CentOS 7 appeared first on LinOxide.

How to Install CPanel 11.52 on CentOS 7

$
0
0

In September 2015, the product was launched. And it is available in the STABLE release tier now. The new brand cPanel 54 version is launched and it is available in the current release tier for this installation. Cpanel & WHM version 11.52 supports the CloudLinux 7/RHEL 7/CentOS 7 operating systems for fresh installations.

In this article, I'm going to discuss about the features/Pre-requisites/installation of latest LTS release of cPanel & WHM 11.52 on CentOS 7 OS version. Before going to the installation, we can take a look on some of the new features of this release comparing the rest of the releases.

New features:

CloudLinux/RHEL/CentOS 7 support
Quota support & XFS file system
Amazon Linux AMI support
Webmail Branding
MultiPHP
Easy Apache 3 to 4 updates
Linux Container support
Common Mail providers tabs to WHM's Greylisting.

Network Requirements

  • Hostname should be a fully qualified domain name.
  • Should have a valid ipaddress, subnet address and default gateway
  • Ethernet device with a static IP & hostname
  • Disable OS Firewall

Hardware Requirements

  1. Processor : 226 Mhz
  2. RAM : Minimum 1GB ( 2GB recommended for smooth functioning)
  3. Disk Space : Minimun 20 GB (40GB recommended for smooth functioning )

Disable Selinux

Need to edit the selinux configuration file located at : /etc/selinux/config

Modify the SELINUX parameter to disabled and reboot the server.

Installation steps followed for installing cPanel 11.52 on CentOS 7

Before installation make sure the server meets all the pre-requisites.

1. Set hostname to a fully qualified domain

This is how we set the hostname for the server to a fully qualified domain name "server1.centos7-test.com" and confirm the hostname status once it is done.

root@server1 [~]# hostnamectl set-hostname server1.centos7-test.com –static
root@server1 [~]# hostnamectl status
Static hostname: server1.centos7-test.com
Icon name: computer-vm
Chassis: vm
Machine ID: 72863e389b584a4dab36fae7f3bffda2
Boot ID: 8bd4f714d7ba4ebf9d53f059d0a1fe8b
Virtualization: xen
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 4.1.5-x86_64-linode61
Architecture: x86-64
root@server1 [~]#

2. Check for the IP addr, subnet addr and gateway

Make sure we have a static IP with a proper subnet mask and default gateway. In this case our IP address is 45.79.183.73 with a proper subnet mask and gateway.

root@server1 [~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 45.79.183.73 netmask 255.255.255.0 broadcast 45.79.183.255
inet6 fe80::f03c:91ff:fef1:78d9 prefixlen 64 scopeid 0x20<link>
inet6 2600:3c03::f03c:91ff:fef1:78d9 prefixlen 64 scopeid 0x0<global>
ether f2:3c:91:f1:78:d9 txqueuelen 1000 (Ethernet)
RX packets 38095 bytes 13241381 (12.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 41505 bytes 45527241 (43.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

3. Check the OS, disk usage and RAM usage for the server

Our server is installed with CentOS 7.2, having a disk space of 20GB and around 1GB RAM. Please see the results of the hardware checks below:

OS version check:

#cat/etc/redhat-release

root@server1 [~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
root@server1 [~]#

Disk usage check:

#df-h

root@server1 [~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 20G 5.9G 14G 31% /
devtmpfs 492M 0 492M 0% /dev
tmpfs 494M 0 494M 0% /dev/shm
tmpfs 494M 14M 480M 3% /run
tmpfs 494M 0 494M 0% /sys/fs/cgroup
/dev/loop0 662M 736K 627M 1% /tmp
tmpfs 99M 0 99M 0% /run/user/0

RAM usage check:

free -m or cat /proc/meminfo

root@server1 [~]# free -m
total used free shared buff/cache available
Mem: 987 336 275 12 375 607
Swap: 511 1 510

4. Disable Firewall

It is recommended to disable the OS firewalls before the cPanel & WHM installations. First of all we need to save the firewall rules and then stop the firewalld service. And make sure the service is disabled.

iptables-save > ~/firewall.rules
systemctl stop firewalld.service
systemctl disable firewalld.service

root@server1 [~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)

Jan 09 06:50:28 server1.centos7-test.com systemd[1]: Stopped firewalld - dynamic firewall daemon.

5. Disable Selinux

Modify the SELINUX parameter to disabled in /etc/selinux/config and reboot the server.
root@server1 [~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

5. Installation of Perl

cPanel is programmed in Perl language. Hence, we need to install Perl prior to the cPanel installation if it isn't installed in the server before.

yum install -y perl

6. Download/Install/Run cPanel/WHM script.

We need to download the cPanel installation script into the /home directory and run the script from there.

#cd /home
#curl -o latest -L https://securedownloads.cpanel.net/latest
#sh latest

This is how we download and install the cPanel installation script from our server's home directory.

The script can take half an hour or more to complete the installation procedures.

Installation log

2016-01-07 07:15:51 227 ( INFO): cPanel install finished in 32 minutes and 14 seconds!
2016-01-07 07:15:51 964 ( INFO): Congratulations! Your installation of cPanel & WHM 11.52 is now complete. The next step is to configure your server.
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): Before you configure your server, ensure that your firewall allows access on port 2087.
2016-01-07 07:15:51 964 ( INFO): On RHEL, CentOS, and CloudLinux systems, execute /scripts/configure_firewall_for_cpanel to accomplish this.
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): After ensuring that your firewall allows access on port 2087, you can configure your server.
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): 1. Open your preferred browser
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): 2. Type https://45.79.183.73:2087 in the address bar
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): 3. Enter the word root in the Username text box
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): 4. Enter your root password in the Password text box
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): 5. Click the Login button
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): Visit http://go.cpanel.net/whminit for more information about first-time configuration of your server.
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): Visit http://support.cpanel.net or http://go.cpanel.net/whmfaq for additional support
2016-01-07 07:15:51 964 ( INFO):
2016-01-07 07:15:51 964 ( INFO): Thank you for installing cPanel & WHM 11.52!
2016-01-07 07:15:51 835 ( WARN): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

7. Adding ports 2087/2086 to the firewalld service

After completing the installation procedures, we need to ensure that our server allows the required service ports in the firewall.

[root@server1 zones]# firewall-cmd --zone=public --add-port=2087/udp
success
[root@server1 zones]# firewall-cmd --zone=public --add-port=2086/udp
success
[root@server1 zones]# firewall-cmd --zone=public --add-port=2086/tcp
success
[root@server1 zones]# firewall-cmd --zone=public –add-port=2087/tcp

[root@server1 zones]#firewall-cmd --reload

If your server has enough resources, then it is always advised to disable the OS firewall and configure CSF/APF to ensure better security and allow all required cPanel service ports by default. I would recommend to go with CSF for a cPanel server.

CSF Installation steps:

 wget http://configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf & ./install.cpanel.sh

Access the WHM via the URL

You can access WHM using the URL https://server-hostname:2087 or http://server-hostname:2086

After accessing the URL mentioned above, you can put your username as root and its password to login.

Read through the terms and conditions & accept the license agreement.

Now you can do your initial configuration steps one by one as below:

1. Setup Networking
2. Setup IP address
3. Nameservers
4. Services
5. Setup quotas

Visit http://go.cpanel.net/whminit for more information about first-time configuration of your server.

Now you will have your WHM ready to use!!!

cpanelwhm

 

I believe this article will be a great help for you guys! Thank you for referring to this. I would appreciate your valuable comments for further improvements.

The post How to Install CPanel 11.52 on CentOS 7 appeared first on LinOxide.

How to Install Apache ServiceMix on CentOS 7

$
0
0

Hi, welcome to our today's article on Apache ServiceMix. Let me give you an overview of what ServiceMix is and what you can do with it. Apache ServiceMix is a runtime container for service-oriented architecture components, web services or legacy system connectivity services. Apache ServiceMix is an enterprise-class open-source distributed enterprise service bus (ESB) based on the SOA model released under the Apache license. It is one of the most mature, open-source implementations of an enterprise service bus and an Apache top-level project. Apache ServiceMix provides an OSGi container in which we can run, configure and manage Camel and ActiveMQ instances and you can explore the other services that it can provide.

So, in the mean time, we'll be showing thine stall ServiceMix on CentOS 7 machine to deploy some basic integration routes and extend the container with some additional features.

System Requirements

Before starting the installation, we need to prepare our CentOS 7 server with some basic requirements. Atleast 200 MB of free disk space is required for the Apache, Karaf and few other binary distributions.

Let's connect to your server using the sudo or root user credentials and perform the following tasks,

OS Update

Run the command as given below to update your Operating system with latest updates and missing patches.

# yum update

Java Setup

For running Apache ServiceMix itself, you'll need Java Runtime Environment (JRE) 1.6.x (Java 6) or greater. Make sure that the JAVA_HOME environment variable must be set to the directory where the Java runtime is installed.

You check the installed version of Java and current settings of your JAVA_HOME and PATH variables using the below commands.

[root@servicemix ~]# java -version
java version "1.7.0_91"

[root@servicemix ~]# echo $JAVA_HOME
/usr/lib/jvm/jre

[root@servicemix ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

Apache Maven

Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project’s build, reporting and documentation from a central piece of information. Run the below command get it install on your server before installing Apache ServiceMix.

# ]# wget http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

Now extract this to the '/usr/local/' directory using the below command.

# tar -zxvf apache-maven-3.3.9-bin.tar.gz -C /usr/local/

Now change directory to '/usr/local/' folder and create a soft link with below command.

#cd /usr/local/

# ln -s apache-maven-3.3.9 maven

Now we will setup the Maven path system-wide by creating a new file and adding the parameters in as shown below.

# vim /etc/profile.d/maven.sh
export M2_HOME=/usr/local/maven
export PATH=${M2_HOME}/bin:${PATH}

After saving file you have to logout and then login back to implement environment variables. Then to verify successful installation of maven, check the version of maven by using the below command.

# mvn -version

maven version

Download Apache ServiceMix

After setting up the Java, you need to download the Apache ServiceMix by choosing the required package.

download servicemix

Copy the source link address and download it using the wget command in your server.

]# wget http://archive.apache.org/dist/servicemix/servicemix-4/4.5.3/apache-servicemix-4.5.3.tar.gz

Use below command to extract the package.

# tar -zxvf apache-servicemix-4.5.3.tar.gz

Installing Apache ServiceMix

Change your directory to the 'bin' directory of your extracted package and execute the the following command to start installation of ServiceMix as shown below.

[root@servicemix ~]# cd apache-servicemix-4.5.3/bin/
[root@servicemix bin]# ./servicemix

installing servicemix

Using Apache ServiceMix Console

We have successfully installed and started Apache ServiceMix. Now we are going to show you that how you can manage your ServiceMix instance, add and remove bundles and install optional features.

Let run the following command to get a list of all bundles currently installed on your server.

karaf@root> osgi:list

installed bundles

If you're looking for something specific in the list, you can use unix-like pipes and utilities to help you. Just for example run the below command to see all Apache related bundles in the list.

karaf@root> osgi:list | grep Apache

Apache Bundles

Many of the applications you write will have some form of log output. To look at the message in the log file, you can us the log:diplay command.

karaf@root> log:display

karaf@root> log:display-exception

Optional Features

You can open the list of features using 'features:list' command. The overview shows you whether or not the feature is currently installed, the version and the name of the feature as shown below.

karaf@root> features:list

list features

To get the web console installed in ServiceMix, install the feature from your console using the command as shown below.

karaf@root> features:install webconsole

Now verify that the feature is marked installed in the overview by executing the below command to grep the webconsole.

karaf@root> features:install webconsole

installing webconsole

Now you will be able to point your browser to http://localhost:8181/system/console and login with user 'smx' and password 'smx' to access the web console.

Apache Karaft WebConsole

From the webconsole, now you can start and stop bundles, configure settings, install optional features or view system information all from your web console as shown below.

managing from console

Conclusion

At the end of this article we have learned the one of the most mature, open-source implementations of an enterprise service bus and an Apache top-level project that is Apache ServiceMix. ServiceMix for sure is not the first choice for application development, in terms of desktop software. But if you have to deal with more complex environments, where different applications are involved and need to interact with each other, an enterprise service bus can alleviate the burden of dealing with such systems to a great extent.

The post How to Install Apache ServiceMix on CentOS 7 appeared first on LinOxide.

How to Enable Multiple PHP Versions on cPanel 11.52

$
0
0

One of the major improvements for the latest EA4 is the support for multiple PHP versions. This allows the server to run upto three PHP versions in parallel namely PHP54, PHP55 and PHP56 with the required modules. It also allows you to run and quickly update the domains with different PHP versions with the help of MultiPHP Manager tool provided in the WHM interface.

These are also enhanced with auto-upgrades to ensure that your PHP applications are up-to-update and secured.

CPanel 11.52 provides both EA3 and EA4 support. To enable the MultiPHP support, we need to upgrade the EA (EasyApache) software to EA4.

Upgrading EA3 to EA4

Before upgrading to EA4, there are certain things to be taken cared of.

1. You need to make sure that the RPMUP key's value it set to daily in the /etc/cpupdate.conf

root@server1 [~]# grep RPMUP /etc/cpupdate.conf
RPMUP=daily

This is to ensure that your server receive RPM updates automatically.

2. Now navigate to "Update Preferences" tab in WHM (Home >> Server Configuration >> Update Preferences) and ensure that the Operating System Package update settings is set to Automatic. It will be set to automatic by default, if not modify it.

Conversion from EA3 to EA4

You can run the following script to upgrade from EA3 to EA4. But make sure to run this script as root user.

/scripts/migrate_ea3_to_ea4 --run

root@server1 [~]# /scripts/migrate_ea3_to_ea4 --run
This action will install a Technology Preview release of EasyApache4 for cPanel & WHM. This means that you understand the following:
• Not all features in cPanel & WHM are operational.
• Not all EasyApache features are included in the Technology Preview.
• Features and functionality in the release may change over time.
• We will quickly address severe or critical issues only.
• Security bounties are not available.
Do you wish to continue? [y/N]y

Once you type 'yes' to continue. The following packages will be installed in the server.

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
ea-cpanel-tools x86_64 1.0-3.1 EA4 5.5 k
ea-profiles-cpanel x86_64 1.0-21.1 EA4 6.7 k
yum-plugin-universal-hooks x86_64 0.1-7.7 EA4 7.6 k

Transaction Summary
===============================================================================================================================================

It will take a few minutes to complete the installation process. After the installation, the EA4 loads with a custom profile of Apache 2.4 with minimal installations including the basic modules that you need to run a minimal web server. It will have only one PHP version available and that will be PHP 5.5 which is the default PHP version in cPanel 11.52 installations.
EA4 provides six profiles in addition. You can navigate to EasyApache 4 section in the WHM interface (Home »Software »EasyApache 4) to view all available profiles and install the most suitable one for your production server.

EA profiles

You can either provision the required profiles from the WHM interface itself or you can use the command-line tools for installations.

This is how I installed my required EA4 profile from CLI.  All the available profiles are present inside the "/etc/cpanel/ea4/profiles/" folder.

root@server1 [/etc/cpanel/ea4/profiles/cpanel]# ll
total 40
drwxr-xr-x 2 root root 4096 Jan 12 08:28 ./
drwxr-xr-x 4 root root 4096 Jan 12 08:28 ../
-rw-r--r-- 1 root root 4291 Dec 15 15:28 allphp.json
-rw-r--r-- 1 root root 4255 Dec 15 15:28 allphp-opcache.json
-rw-r--r-- 1 root root 1846 Dec 15 15:28 default.json
-rw-r--r-- 1 root root 1801 Dec 15 15:28 mpm_itk.json
-rw-r--r-- 1 root root 600 Dec 15 15:28 nophp.json
-rw-r--r-- 1 root root 1830 Dec 15 15:28 ruid2.json

I preferred to install the default.json (cPanel Default) profile. This is the standard Apache package with up-to-date PHP and modules. This package can host multiple sites and users. This includes three PHP packages namely PHP54, PHP55, PHP56 with minimum, but required modules.

This is how I did that on CLI!

root@server1 [/etc/cpanel/ea4/profiles/cpanel]# /usr/local/bin/ea_install_profile --install default.json

===============================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
ea-apache24-mod_cgid x86_64 2.4.18-1.1 EA4 35 k
ea-apache24-mod_mpm_worker x86_64 2.4.18-1.1 EA4 38 k
ea-php54 x86_64 1.1-10.7 EA4 4.1 k
ea-php54-php-bcmath x86_64 5.4.45-7.7 EA4 56 k
ea-php54-php-calendar x86_64 5.4.45-7.7 EA4 44 k
ea-php54-php-cli x86_64 5.4.45-7.7 EA4 2.6 M
ea-php54-php-common x86_64 5.4.45-7.7 EA4 360 k
ea-php54-php-curl x86_64 5.4.45-7.7 EA4 57 k
ea-php54-php-ftp x86_64 5.4.45-7.7 EA4 50 k
ea-php54-php-gd x86_64 5.4.45-7.7 EA4 125 k
ea-php54-php-mcrypt x86_64 5.4.45-7.7 EA4 46 k
ea-php54-php-mysqlnd x86_64 5.4.45-7.7 EA4 172 k
ea-php54-php-pdo x86_64 5.4.45-7.7 EA4 97 k
ea-php54-php-posix x86_64 5.4.45-7.7 EA4 42 k
ea-php54-php-sockets x86_64 5.4.45-7.7 EA4 52 k
ea-php54-php-xml x86_64 5.4.45-7.7 EA4 156 k
ea-php54-runtime x86_64 1.1-10.7 EA4 14 k
ea-php55 x86_64 1.1-10.7 EA4 3.6 k
ea-php55-php-xml x86_64 5.5.30-7.7 EA4 158 k
ea-php56 x86_64 1.1-10.7 EA4 3.7 k
ea-php56-php-bcmath x86_64 5.6.16-5.7 EA4 57 k
ea-php56-php-calendar x86_64 5.6.16-5.7 EA4 46 k
ea-php56-php-cli x86_64 5.6.16-5.7 EA4 2.6 M
ea-php56-php-xml x86_64 5.6.16-5.7 EA4 159 k
ea-php56-runtime x86_64 1.1-10.7 EA4 13 k
================================================================================

These many packages will be installed. It will take a while to complete.

Now I can make use MultiPHP support enabled in our server. You can select the MultiPHP Manager tool from WHM (Home »Software »MultiPHP Manager)
to easily configure the default server PHP version and also modify individual domain PHP versions as required.

multiphp

 

custom-php

You can even modify the PHP basic & INI settings for the installed versions using MultiPHP INI Editor tool.

phpvariables

Now you see how easy to install and manage multiple PHP versions on cPanel 11.52 server. I hope this article is  informative and useful for you. Thank you referring to this :). I would appreciate your valuable comments and suggestions on this.

The post How to Enable Multiple PHP Versions on cPanel 11.52 appeared first on LinOxide.

How to Install dotProject - Project Management Tool in CentOS 7

$
0
0

dotProject is a free and open source web-based multi-user and multi-language project management application which is designed to provide project layout and control functions. It aims to provide the project manager with a web based efficient tool for managing tasks, schedules, communication and sharing easily. dotProject has a wide range of application and environment from small offices to big companies, government departments, schools and more. This project is completely managed, maintained, developed and supported by a volunteer group and by the users themselves. In this tutorial, we'll learn how we can setup dotProject in our machine running CentOS 7 linux distribution.

Installing LAMP Stack

First of all, we'll need to install a complete LAMP Stack in our CentOS 7 machine. A LAMP stack is the combination of Apache Web Server, MySQL/MariaDB Database server and PHP modules installed and configured together in a linux machine. In order to setup, we'll need to run the following yum command as yum is the default package manager in CentOS 7.

# yum update
# yum install httpd mariadb-server mariadb php php-gd php-mysql php-curl php-ldap php-xsl php-xml php-cli php-mbstring php-pear unzip

Configuring MariaDB server

At first, as we haven't set any root password for our MariaDB server, we'll need to configure a root password for it. And after its done, we'll move forward towards the creation of a database user and a database so that dotProject can be used to store its data. To configure MariaDB, we'll first need to start our MariaDB server by running the following command.

# systemctl start mariadb

After done, we'll configure MariaDB and assign a root password, we’ll need to run the following command.

# mysql_secure_installation

This will ask us to enter the password for root but as we haven’t set any password before and its our first time we’ve installed mariadb, we’ll simply press enter and go further. Then, we’ll be asked to set root password, here we’ll hit Y and enter our password for root of MariaDB. Then, we’ll simply hit enter to set the default values for the further configurations.
….
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

installation should now be secure.
Thanks for using MariaDB!

Creating a MariaDB Database

Next, we’ll login to the MariaDB command prompt as root. Here, we’ll need to enter the password of the MariaDB root account that we had set above.

# mysql -u root -p

After we’re logged in into the mariadb command prompt, we’ll gonna create the database.

> CREATE DATABASE dotprojectdb;
> CREATE USER 'dotprojectuser'@'localhost' IDENTIFIED BY 'Pa$$worD';
> GRANT ALL PRIVILEGES ON dotprojectdb.* TO 'dotprojectuser'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;

Creating Database Mysql

Finally, we’ve successfully created a database named dotprojectdb with username dotprojectuser and password as Pa$$worD .

Note: It is strongly recommended to replace the above variables as your desire for the security issue.

Setting PHP configuration

Then, we'll go for configuring some settings in our PHP configuration which is located inside /etc/php.ini file. Here, we'll need to open the file using a text editor and edit it.

# nano /etc/php.ini

Once its opened using the text editor, we'll need to append the file with the configurations shown below.

memory_limit 128M
register_globals = Off
session.auto_start = 1
session.use_trans_sid = 0
date.timezone =America/New_York

Configuring Apache Web Server

In our CentOS machine, we'll create a file named dotproject.conf under /etc/httpd/conf.d/ directory using a text editor.

# nano /etc/httpd/conf.d/dotproject.conf

Then, we'll gonna add the following lines of configuration into the file.

<VirtualHost *:80>
ServerAdmin info@dotproject.linoxide.com
DocumentRoot /var/www/dotproject/
ServerName dotproject.linoxide.com
ServerAlias www.dotproject.linoxide.com
<Directory /var/www/dotproject/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/dotproject.linoxide.com-error_log
CustomLog /var/log/httpd/dotproject.linoxide.com-access_log common
</VirtualHost>

Configuring dotProject Apache Config

Once done, we'll simply save the file and exit the editor.

Enabling Services

Now, we'll gonna restart our Apache web server and MariaDB database server by executing the following systemctl command.

# systemctl restart httpd mariadb

Then, we'll enable them to start automatically in every system boot.

# systemctl enable httpd mariadb

Downloading DotProject

We'll now download the latest release of DotProject ie version 2.1.8 during the time of writing this article. We can download the latest release from the official sourceforge download page but as we're gonna download it via console or terminal, we'll simply get the link from the sourcefoge site and download it using the following wget command.

# cd /tmp
# wget http://downloads.sourceforge.net/project/dotproject/dotproject/dotProject%20Version%202.1.8/dotproject-2.1.8.tar.gz

--2016-01-19 14:49:08-- http://downloads.sourceforge.net/project/dotproject/dotproject/dotProject%20Version%202.1.8/dotproject-2.1.8.tar.gz
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
...
Resolving ncu.dl.sourceforge.net (ncu.dl.sourceforge.net)... 140.115.17.45
Connecting to ncu.dl.sourceforge.net (ncu.dl.sourceforge.net)|140.115.17.45|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4529234 (4.3M) [application/x-gzip]
Saving to: ‘dotproject-2.1.8.tar.gz’
100%[=============================>] 4,529,234 2.39MB/s in 1.8s
2016-01-19 14:49:11 (2.39 MB/s) - ‘dotproject-2.1.8.tar.gz’ saved [4529234/4529234]

Once the download is completed, we'll simply extract the tarball by running the following tar command.

# tar -xzf dotproject-2.1.8.tar.gz

We'll then move the extracted files and directories to /var/www/dotproject/ directory as we have defined in the above apache configuration.

# mv dotproject /var/www/dotproject

Fixing Ownership

After moving the files and directories, we'll now need to change the ownership of the directory to apache user so that apache process owner can have full read/write access over the dotproject directory.

# cd /var/www/dotproject/
# sudo chown -R apache: dotproject/

Allowing Firewall

To expose our dotProject site on the internet or inside the same network, we'll need to allow port 80 from the firewall program. As CentOS 7 is shipped with systemd as the default init system and we'll have firewalld installed as a firewall solution. To allow port 80 or http service, we'll need to run the following commands.

# firewall-cmd --permanent --add-service=http
# firewall-cmd --reload

Web Installation

We'll now go for the web based installation of dotProject. To do so, we'll need to point our web browser to our server's ip address or domain name as http://ip-address/ or http://domain.com/ according to the configuration. Here, in this tutorial, we'll gonna point the url of our web browser to http://dotproject.linoxide.com/ and start the installation process as shown below.

dotProject Installer Requirements

In the start page, we'll see that all the dependencies and settings required for the installation of dotProject has been successfully installed and configure. To start the installation, we'll need to click on the button "Start Installation". After clicking on that, we'll see a page where we'll be asked to enter the required information for logging into the database server.

Database Settings Installer

Here, as we're hosting the database server in the same server where we're installing dotProject, we'll assign Database Host Name as localhost, then, we'll simply enter the Database name, username and password that we had assigned in the above step while creating the database. Once done, we'll click on "install db and write cfg" button which will setup the database and creates a configuration file named config.php under /var/www/dotproject/includes/ directory.

dotProject Installed

Once done, we'll see the log generated by the installer and green notifications that our database installation and config file creation has been done successfully. Then, we'll click on "Login and Configure the dotProject System Environment" link which will ask us the login credentials required for accessing the Admin panel. The default username and password for a fresh installation of dotProject is admin and passwd respectively.

dotProject Admin Login

After we've logged in, we'll see the following page as our dotProject Administration Panel. It is strongly recommended to change the password of administrator as soon as the first login is made.

dotProject Admin Panel

To change the password of the admin user, we'll need to goto User Management page by navigating to User Admin in the navigation bar. Then, we'll need to select admin as the user and click on change password link which will popup another small window where we'll need to enter our old password and new password to be kept.

Conclusion

dotProject has been finally setup and configured successfully in our machine running CentOS 7. It is an awesome web based project management framework that includes modules for companies, projects, tasks (with Gantt charts), forums, files, calendar, contacts, helpdesk, multi-language support, module permissions and themes with good time tracking feature. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-)

The post How to Install dotProject - Project Management Tool in CentOS 7 appeared first on LinOxide.

How to Setup VM for Solaris on VMware Workstation 12

$
0
0

Solaris is the most widely used, enterprise UNIX operating system that Sun Microsystems provides for its family of Scalable Processor Architecture-based processors as well as for Intel-based processors. The difference between the Linux and Unix (Solaris) is that Linux boasts a smaller kernel and its code was rewritten from the ground up while Solaris was originally based on Berkeley UNIX or BSD. There is an ongoing debate about what is a "true" UNIX OS and what is a UNIX-like or UNIX-flavor OS. However, there is no official definition that distinguishes between the thousands of products that use UNIX commands and UNIX shells. The only official way to differentiate is by the trademark controlled by The Open Group.

In this article we will cover the steps to setup your Virtual Machine of the installation of Solaris using VMware Workstation 12. While in the next article we will cover up its next part to show you the complete installation of Solaris on VMware Workstation.

1) Open VMware Workstation:

Starting from the first step, let's open the Home page of your VMware workstation to create new Virtual Machine that we will be using for Solaris installation. Once you click on the 'Create New Virtual Machine' as new VM wizard will be opened.

Create New VM

2) VM Configuration:

Choose the 'Custom' configuration open to configure the advance level settings for this VM as shown below and then click on the 'NEXT' button to proceed.

Custom Settings

3) Hardware Compatibility:

Here you will choose your required hardware version from the drop down available options if you wish to some old version that your infrastructure supports.

Hardware compatibity

4) Installation Media:

In this step you need to mention the path o for your guest Operating System if its available on the disk or an ISO image that you have downloaded. So, we will choose the second option and browse the location of ISO image that you can get from Solaris Download Page. Then click on the 'Next' button to proceed to the next step.

installation Media

5) Name your Virtual Machine:

Choose the name that best describe's the purpose of your new VM. So here we are going to choose name and location for its physical path.

VM name

6) Processor Configuration:

Here you will specify the number of processors and cores that you wish to assign with the VM for Solaris. So we are going choose 1 Processor and core for this VM as per minimum recommendations.

CPU Confiurations

7) RAM Configuration:

Choose the RAM as per recommendations that 2 GB as shown in below image and then click on the 'Next' button to proceed.

RAM Configurations

8) Network Type:

Choose your network connection as the NAT (Network Address Translation) that gives the guest operating system access to the host computer's dial up or external Ethernet network connection using the host IP address.

Network Type

9) I/O Controller:

From the multiple available options for SCSI controller types, choose the recommended one that is LSI logic type and click on the 'Next' button to proceed.

SCSI Controller

10) Disk Type:

Select the virtual disk type as 'SCSI' and click on the Next button to move.

disk type

11) Select Disk:

Select the option to create a new virtual disk that will appear as a single hard disk on your guest operating system.

select disk

12) Disk Capacity:

The recommended disk size for solaris is 16 GB, but we are going to choose 20 GB here. Then select the option to split virtual disk into multiple files that will helps you in case when you want to move your virtual machine to other computer.

disk capacity

13) Disk File location:

Browse the location where you want to save the disk file and click on the Next button.

disk file

14) Finish VM Creation:

Let's click on the finish button to create the virtual machine after reviewing the summary of your selected steps. If find any mistake you can go back to make correction.

Finish VM creation

Once you click on the finish button then you can see your new VM under the list of all your created Virtual Machines. So, choose the Solaris, you will see the summary of your attached devices here. You can click on the Edit VM settings to change the settings if required and then click on the Power On button to start working on it.

VM settings

Conclusion:

We have have successfully setup our new virtual machine on VMware Workstation that we will be using it for Installation of Solaris in our next Article. So up-to this point if you have any confusion or suggestions please don't hesitate to comment us back as we feel pleasure to assist you.

The post How to Setup VM for Solaris on VMware Workstation 12 appeared first on LinOxide.

How to Enable Multiple PHP-FPM Instances with Nginx / Apache

$
0
0

PHP-FPM is also known as PHP FastCGI Process Manager. It is an advancement of PHP FastCGI implementation with more useful features for handling heavy-loaded servers and websites. Some of those features are listed below:

New Features

  • Advanced process managament capability with graceful start/stop options.
  • Ability to run the processes with different userids/groupids listening on different ports and using different PHP configurations.
  • Error logging.
  • Acceleration upload support
  • Special function to finish request and flush all data while doing some time consuming tasks
  • Both Dynamic and Static Child process Spawning
  • IP Address restriction

In this article, I'm going to discuss about installing PHP-FPM along with Nginx and Apache on a CentOS 7 server running cPanel 11.52 with EA3(EasyApache) and how to manage those installed multiple PHP-FPM instances via CPanel.

Before going to the installation procedures, let us take a look on the pre-requisites.

Pre-requisites

  1.  Enable Mod_proxy_fcgi module
  2.  Enable MPM_Event

Since, we are installing PHP-FPM on a EA3 server, we need to run EasyApache to compile Apache to enable these modules.

You can refer my previous document on how to install Nginx as reverse proxy on a Apache server to confirm with the Nginx installation.

I'll brief those installation steps once again here. You can refer to my previous documentation (How to Set Nginx as Reverse Proxy on CentOS 7 /CPanel Server) for details.

Step 1: Install the Epel repo
Step 2: Install nDeploy RPM repo which is the most **IMPORTANT** step in this installation.
Step 3: Install nDeploy and Nginx plugin using yum from the nDeploy repo.
Step 4: Enable/Configure Nginx as reverse proxy

Once this is done, install the PHP-FPM packages for all PHP versions available in the server. EA3 uses remi repository for installing these packages. You can run this nDeploy script to download all packages.

root@server1 [~]# /opt/nDeploy/scripts/easy_php_setup.sh
Loaded plugins: fastestmirror, tsflags, universal-hooks
EA4 | 2.9 kB 00:00:00
base | 3.6 kB 00:00:00
epel/x86_64/metalink | 9.7 kB 00:00:00
epel | 4.3 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 460 kB 00:00:00
(2/2): epel/x86_64/primary_db

Running this script will install all these FPM packages for PHP 54, PHP 55, PHP 56 and PHP 70.

Installed Packages
php54-php-fpm.x86_64 5.4.45-3.el7.remi @remi
php55-php-fpm.x86_64 5.5.31-1.el7.remi @remi
php56-php-fpm.x86_64 5.6.17-1.el7.remi @remi
php70-php-fpm.x86_64 7.0.2-1.el7.remi @remi

After this installation, you need to enable PHP-FPM SAPI for Apache. You can run this script to enable PHP-FPM instances.

root@server1 [~]# /opt/nDeploy/scripts/apache_php-fpm_setup.sh enable
mod_proxy_fcgi.c
Please choose one default PHP version from the list below
PHP70
PHP56
PHP54
PHP55
Provide the exact desired version string here and press ENTER: PHP54
ConfGen:: lxblogger
ConfGen:: blogr
ConfGen:: saheetha
ConfGen:: satest
which: no cagefsctl in (/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin)
info [rebuildhttpdconf] Missing owner for domain server1.centos7-test.com, force lookup to root
Built /usr/local/apache/conf/httpd.conf OK
Waiting for “httpd” to restart gracefully …waiting for “httpd” to initialize ……
…finished.

It will ask the required PHP version which you prefer to run as default on the server. You can enter those details and proceed to configure and generate the virtual host files for the existing domains.

I've chosen PHP 54 as the default PHP-FPM version on my server.

confirm-php-fpm

Even though, the server is configured with PHP-FPM 54, we can modify the PHP-FPM instances for the individual domains via cPanel.

I'll explain you on how to modify the PHP-FPM instances for individual domains via cPanel using some screenshots.

The installation of Nginx plugin will provide you with an icon of Nginx Webstack in your domain's cPanel. You can click on that icon to configure your Web server. I've logged into one of my domain's cPanel to configure it's Web server.

Please check these snapshots.

nginx webstack

nginxicon1

Now you can configure the web-server for the selected main domain as required(I've selected the main domain saheetha.com here). I've gone ahead with automatic configuration options since, I don't have any manual settings to add.

nginx_auto_proxy

Once Nginx is configured, you can select the PHP-FPM instance for your domain here.

php-fpm1

php54

php55

As you can see in these snapshots, my default PHP-FPM  on the server is PHP 54 and I'm  changing the PHP-FPM instance for my domain alone to PHP 55. Once you've modified the PHP-FPM for your domain, you can confirm it by accessing the phpinfo page.

Thank you for referring to this article. I believe this article is really informative and useful for you. I would recommend your valuable comments on this :).

The post How to Enable Multiple PHP-FPM Instances with Nginx / Apache appeared first on LinOxide.


How to Install Solaris 10/11 on VMware Workstation 12

$
0
0

Hello and welcome to our today's article on Installation of Solaris using VMware Workstation. Oracle Solaris 11 is the world's most advanced enterprise operating system that delivers security, speed, and simplicity for enterprise cloud environments and DevOps. In our previous article we setup a new virtual machine for Solaris on VMware Workstation 12 and now we are going to show you a complete demonstration on the installation of Solaris 10/11. In this article we will be using the Solaris version 10 but you can follow the same instruction for the latest version of Solaris 11 that has been just released.

Let's follow the below steps to complete your installation of Solaris on VMware workstation 12.

1) Power On Solaris VM

Open the home page of your VMware Workstation and choose the Solaris 10 VM that you have created by following our previous article and click to the Power On button as shown below.

Poweron VM

2) Boot Menue

Once you have powered on your VM, you will see the grub menu and your VM will be starts boot from Solaris as shown in below image.

Solaris Boot

After starting the Solaris Boot process you will see the following message displayed on your screen showing the release version of SunOS.

SunOS rellease

2) ZFS Root File System

Here you will be asked to choose from the available options about what you want to do. So , choose the option 4 as shown in the below image to start the installation of ZFS root file system.

ZFS root file system

3) Keyboard Configurations

Choose your keyboard layout from the multiple available options by using your arrow keys as shown in the image.

keyboard layout

Then select your language by making a choice from the available options from 0-10 and press Enter key to continue.

language selection

4) Solaris Installation Program

In this section you will be guided on how the solaris installation program works. After reading it press 'F2' key as indicated below to continue.

solaris installation

5) Identifying System

Press F2 key to identify your system with the network and set the default time zone and time/date.

identify your system

6) Network Connectivity

Choose the 'Yes' option to specify that your system is connected to the Solaris supported network and press "F2" to continue.

network connectivity

DHCP Network:
Then choose the Option to 'No' for specifying that you are not using the DHCP for your network.

DHCP for network

System Hostname:

Choose your system hostname that will specify it on the network and then press 'F2' to continue.

system Hostname

IP Address:

Enter the IP address for your network interface as shown.

IP address

System Subnet:

Choose the option 'Yes' if your system is part of a subnet.

Subnet mask

Configure Subnet mask:

Configure the proper subnet mask for your system as shown below, you might face issues if you have configured your sub netmask incorrect.

subnetmask

Configure Ipv6:

Choose the Option 'No' for IPv6 but you can still leave it to yes as it has no effect your system.

IPv6 setting

Default Route:

To set the default route you can choose the option to the one upon reboot and then press F2 key to move to the next step.

Default Route

So, you have configured all required network settings, the summary of your selected options can be viewed on the follwoing snapshot. If you are sure that the information is correct then press 'F2' key to move to the next option.

Network summary

7) Security Policy

In this section we configure the standard UNIX security policy, if you wish to use Kerberose security then you can choose 'Yes' option and then press 'F2' key to continue.

securoty policy

8) Name Service

Select the option for setting up the Name service for your network, if you are not using the any name service then choose the 'None' option and then press F2 key to continue.

Name service

Next you will be asked to configure the NFSv4 domain Configurations, so choose the first option to use the NFSv4 domain derived by the system as shown in the below image.

NFSv4 Domain Name

9) Date and Time Zone

Select the your current time zone and the country or the region you are living in and choose the current date and time for your system settings. Then press F2 to proceed to the next step.

date and tine zone

10) Root Password

Setup your strong root password for your system and press 'F2' key to continue if you wish to leave your password as blank as yet.

root password

11) Remote Service

Choose the Option to enable remote services that will make your client clients to easily access the network.

remote service

12) Configuration Manager Registration

Leave this option as blank to provide Solaris auto registration information and simpliy move to the next step by pressing the 'F2' button.

auto registration

Leave all option as blank for the proxy server settings, then you will see a notification message as shown below.

system information

13) Solaris Interactive Installation

Solaris Interactive installation

14) iSCSI Installation

iSCSI Installation

Eject CD/DVD Automatically:

Select the option to Eject your CD/DVD automatically from your system after completing the installation.

Ejecting CD/DVD

Auto Reboot:

Select the option to Automatically reboot the system after completing the installation.

Auto reboot

You may need to manually eject the CD/DVD or select select a different boot device after reboot to avoid repeating the installation process.

Choose MEdia:

Here you need to specify the media from which you are going to install the Solaris Operating system . So, we are going to choose CD/DVD ROM here.

Choose Media

License Agreement:

Press 'F2' key to accept the license agreement, and choose you geographical location to mention your initial locale after installing your operating system.

License Agreement

15) Additional Products

If you wish add some additional products then select the location you wish to scan. At this point we don't need to add any additional product so we are going to choose as 'None'.

Additional Products

16) Filesystem Type

Select the 'ZFS' as your file system type to to install solaris on it.

zfs file system

17) Select software

Select the second option 'Entire Distribution' for installing the Solaris software on your system and hit the 'F2' key to proceed to the next option.

Select software

18) Select Disks

In this section you need to choose the disk where your software for Saloris will be going to install on it.

Select Disks

19) Configure ZFS

Now configure your ZFS root file system settings, you can leave them as default and press 'F2' key to continue your installation process.

Configure ZFS

20) Mount Remote File System

Press 'F2' key to mount remote file system that will helps in case of any space issues.

mount remote file system

21) Profile

Let's review each option that you have selected to configure your environment for installation of Solaris. If everything is OK then hit 'F2' key to begin installation.

profile

22) Solaris Initial Install

Once the installation process starts it will take few minutes to complete the installation process.

Solaris Initial Install

23) Welcome to Node1

How it looks? let's login to the Node using your the credentials you have configured in previous steps.

Solaris Login

after providing the right credentials you will be asked to choose your default Desktop environment as CDE (Common Desktop Environment).

Welcome to Solaris Desktop

Welcome to the Java Desktop system for Oracle Solaris. It has been installed and ready to use for your testing or configure it for your production environment.

Java Desktop for Solaris

Click on the Launch key to explore its installed applications and features.

Launch Solaris

Conclusion

Solaris is claimed by many as the most advanced operating system in commercial use today.Free Solid relieable and feels good to use on your desktop.It is currently been developed as a Opensource project called OpenSolaris. You can test your hardware compatibility if it would run on your computer there is a tool on the Sun site which will test your hardware for free to see if its suitable. Hope you understand the basics installation of Solaris, if you are comfortable with using the Linux and working on the UNIX is not a big deal for you. So, keep enjoying with Solaris and don't forget to leave your comments.

The post How to Install Solaris 10/11 on VMware Workstation 12 appeared first on LinOxide.

How to Install Concrete5 CMS on Ubuntu 15.04 / CentOS

$
0
0

Concrete5 is a free and open source content management system published under MIT License. It is designed for making creating and deploying of website pretty easy for users with a minimum of technical skills. It is developed in PHP programming language making its interface components and site structure a powerful framework built from custom components and third-party libraries from projects like Laravel and Symfony Components. Concrete5 always follows model-view-controller development pattern and with version 7 fully embraces domain-driven design as well. It has a beautiful competitive web builder like Squarespace or Wix making creation of website very easy for everyone technical and non-technical people. Some of the awesome features of Concrete5 are listed as follows.

  • Concrete5 comes with an easy to use WYSIWYG text editor.
  • It consists of editing toolbar which enables us to customize our site as we surf.
  • Add a page anywhere, preview your changes before publishing and it's updated everywhere
  • It allows us to track versions and compare differences between.
  • It contains a file manager with bulk upload and image manipulation using Picnik.
  • And much more

In this article, we'll learn how we can setup Concrete5 in our machine running Ubuntu 15.04 or CentOS 7 linux distribution.

Installing LEMP Stack

First of all, we’ll need to setup a complete LEMP Stack in our machine running Ubuntu 15.04 or CentOS 7. It is the combination of Nginx web server, MariaDB database server and PHP modules. To setup the LEMP stack in our machine, we’ll need to open a terminal or console and run the following command in it according to the distribution we're running.

On Ubuntu 15.04

# apt-get update
# apt-get install nginx mariadb-server mariadb-client php5-mysql php-pear php5-gd php5-intl php5-curl php5-xdebug php5-dev php5-xcache php5-fpm curl unzip

On CentOS 7

# yum update
# yum install nginx mariadb-­server mariadb-client php-­mysql php-­pear php-gd php-­xml php­-intl php­-curl php­xdebug php­-dev php-mbstring php-­xcache php5-fpm curl

Configuring MariaDB

Now, we'll need to follow the following steps in order to configure our MariaDB and set a password for the database root user. To configure MariaDB and assign a root password, we’ll need to run the following command.

# mysql_secure_installation
This will ask us to enter the password for root but as we haven’t set any password before and its our first time we’ve installed mariadb, we’ll simply press enter and go further. Then, we’ll be asked to set root password, here we’ll hit Y and enter our password for root of MariaDB. Then, we’ll simply hit enter to set the default values for the further configurations.
….
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

installation should now be secure.
Thanks for using MariaDB!

Note: Please note down the root password of MariaDB as it will be used later to create a database for our Concrete5 application and in the future too.

After its done, we'll start the MariaDB server by running the following systemctl command as both CentOS 7 and Ubuntu 15.04 comes with systemd preinstalled as default init system.

# systemctl start mysql

Configuring PHP

Next. we'll configure our PHP configuration file so that it will fulfill the requirements to run Concrete5 installation. Configuring PHP as required for Concrete5 will result in the best performance it can give. To do so, we'll need to edit the configuration which is located inside /etc/php5/fpm/php.ini using our favorite text editor.

# nano /etc/php5/fpm/php.ini

After the file is opened with the text editor, we'll need to append the file using the following configuration required to run Concrete5.

cgi.fix_pathinfo=0
post_max_size = 20M
upload_max_filesize = 20M
memory_limit = 128M
safe_mode = Off

Creating MariaDB Database

Next, we'll go further towards the creation of our new database so that Concrete5 can store data inside that MariaDB server. To do so, we’ll need to first login to the MariaDB command prompt as root. Here, we’ll need to enter the password of the MariaDB root account that we had set above.

# mysql -u root -p

After we’re logged in into the mariadb command prompt, we’ll create the database, database user, password and assign full privileges to that database. To do so, we'll need to run the following MariaDB console commands.

> CREATE DATABASE concrete5db;
> CREATE USER 'concrete5user'@'localhost' IDENTIFIED BY 'Pa$$worD';
> GRANT ALL PRIVILEGES ON concrete5db.* TO 'concrete5user'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;

Creating MySQL Database

Configuring Nginx Server

Now, we'll configure our Nginx server and create the virtual host configuration file for making our concrete5 site running in the web server. To do so, we'll need to open /etc/nginx/sites-available/concrete5.linoxide.com using a text editor.

# nano /etc/nginx/sites-available/concrete5.linoxide.com

Then, we'll simply append the following configuration into the file.

server {
listen 80;
root /var/www/concrete5.linoxide.com;
index index.php index.html index.htm;
server_name concrete5.linoxide.com;
location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_index index.php;
fastcgi_pass unix://var/run/php5-fpm.sock;
include fastcgi.conf;
}
}

Once its done, we'll save the file and exit the text editor.

After that, we'll need to activate the configuration file by creating a new link of the newly created nginx file under /etc/nginx/sites-enabled/ directory. This can be done by running the following command.

# ln -s /etc/nginx/sites-available/concrete5.linoxide.com /etc/nginx/sites-enabled/concrete5.linoxide.com

Downloading Concrete5

We'll download the latest release of Concrete5 ie version 5.7 from the Official Download Page. We'll open the download page and get the link of the zipped compressed file. Then, we'll simply download it using curl command in a terminal or console under /tmp/ directory.

# cd /tmp/
# curl -LJO https://www.concrete5.org/download_file/-/view/85780/

Downloading Concrete5

Once its successfully downloaded, we'll gonna extract it using unzip.

# unzip concrete5.7.5.6.zip

Then, we'll gonna move the entire extracted concrete5 directory to our webroot we had set above in our nginx server configuration file ie /var/www/concrete5.linoxide.com . We can do that by running the following command.

# mkdir -p /var/www/concrete5.linoxide.com
# mv /tmp/concrete5.7.5.6/* /var/www/concrete5.linoxide.com

Fixing Permissions and Ownership

Next, we'll gonna fix some file permissions and ownership of the installation path. First, we'll gonna set the ownership of the installation directory to nginx process owner so that Nginx web server will have full access of the files and directories to edit, create and delete.

# chown www-data: -R /var/www/concrete5.linoxide.com

Starting and Enabling Services

We’ll now start our newly installed Nginx web, MariaDB database and php5-fpm services in our machine. To do so, we'll need to run the following command according to the distribution we're running.

On Ubuntu 15.04

As we know, Ubuntu 15.04 is shipped with systemd as the default init system, so we'll need to execute the following commands to start nginx mariadb and php-fpm.

# systemctl start nginx mysql php5-fpm

After its started, we'll now make it able to start automatically in every system boot by running the following command.

# systemctl enable nginx mysql php5-fpm

Synchronizing state for nginx.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d nginx defaults
Executing /usr/sbin/update-rc.d nginx enable
Synchronizing state for mysql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d mysql defaults
Executing /usr/sbin/update-rc.d mysql enable
Synchronizing state for php5-fpm.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d php5-fpm defaults
Executing /usr/sbin/update-rc.d php5-fpm enable

On CentOS 7

Also in CentOS 7, systemd is the default init system so, we'll run the following command to start them.

# systemctl start nginx mariadb php5-fpm

Next, we'll enable them to start automatically in every startup of init system using the following command.

# systemctl enable nginx mariadb php5-fpm

ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
ln -s '/usr/lib/systemd/system/php5-fpm.service' '/etc/systemd/system/multi-user.target.wants/php5-fpm.service'

Allowing Firewall

Now, we'll gonna configure our firewall programs to allow port 80 (http) so that our nginx web server running Concrete5 will be accessible from other machines in the network across the default http port ie 80.

On Ubuntu 15.04

Iptables is a popular firewall program which is installed in the ubuntu distributions by default. To expose port 80, we'll need to run the following commands in a terminal or console.

# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# /etc/init.d/iptables save

On CentOS 7

As CentOS 7 has systemd installed by default, it contains firewalld running as firewall program. In order to open the port 80 (http service) on firewalld, we'll need to execute the following commands.

# firewall-cmd --permanent --add-service=http

success

# firewall-cmd --reload

success

Accessing Web Interface

Finally, after everything is setup and configured in above steps, we'll now go for accessing the web installation process of Concrete5. To do so, we'll need to point our web browser to http://ip-address/ or http://domain.com . Here, in this tutorial, we'll point our browser to http://concrete5.linoxide.com/ . After done, we'll be welcomed by the Concrete5 Installation Page as shown below.

Concrete5 Language

Now, we'll select the language for our Concrete5 CMS. Once we have selected our language, we'll go further towards continuing the installation. On the next page, the setup will check if the dependencies are fulfilled or not. As we can see, we have already installed and configured all the required dependencies so we'll continue further.

Requirements Check

Next, we'll need to enter the required information for our site like Site Name, Administration information which will be required for us to login to our dashboard. Then, we'll need to enter the database login information which we had created in the above step.

Configuring Site

Here, we've entered Server, MySQL username, MySQL password and Database Name as localhost, concrete5user, Pa$$worD and concrete5db respectively that we had configured above.

Concrete5 Installed

Once done, we'll see the progress bar which shows us the installation of Concrete5. Once its completed, we'll be welcomed to the homepage of our website logged in as admin. Then, we can customize our site as our need and desire.

Concrete5 Homepage

To login as the admin or user into the dashboard, we'll need to point our browser to http://concrete5.linoxide.com/index.php/login as we can see below.

Login Screen Concrete5

Conclusion

We've finally installed Concrete5 Content Mangement System in our machine running Ubuntu 15.04 and CentOS 7. Now, we can customize our website, install themes, plugins, templates and make the site look and work as our need and requirements. Really, Concrete5 has made content management and creating website pretty easy and fast. We don't need any knowledge of coding to create our website built with concrete5. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-)

The post How to Install Concrete5 CMS on Ubuntu 15.04 / CentOS appeared first on LinOxide.

How to Set Nginx as Reverse Proxy on Centos7 CPanel

$
0
0

Nginx is one of the fastest and most powerful web-server. It is known for its high performance and low resource utilization. It can be installed as both a standalone and a Reverse Proxy Web-server. In this article, I'm discussing about the installation of Nginx as a reverse proxy along with Apache on a CPanel server with latest CentOS 7 installed.

Nginx as a reverse proxy will work as a frontend webserver serving static contents along with Apache serving the dynamic files in backend. This setup will boost up the overall server performance.

Let's walk through the installation steps for Nginx as reverse proxy in CentOS7 x86_64 bit server with cPanel 11.52 installed.

First of all, we need to install the EPEL repo to start-up with the process.

Step 1 : Install the EPEL repo.

root@server1 [/usr]# yum -y install epel-release
Loaded plugins: fastestmirror, tsflags, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 66.23.237.210
* base: mirrors.linode.com
* extras: mirrors.linode.com
* updates: mirrors.linode.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
epel-release noarch 7-5 extras 14 k

Step 2: After installing the repo, we can start with the installation of the nDeploy RPM repo for CentOS to install our required nDeploy Webstack and Nginx plugin.

root@server1 [/usr]# yum -y install http://rpm.piserve.com/nDeploy-release-centos-1.0-1.noarch.rpm
Loaded plugins: fastestmirror, tsflags, universal-hooks
nDeploy-release-centos-1.0-1.noarch.rpm | 1.7 kB 00:00:00
Examining /var/tmp/yum-root-ei5tWJ/nDeploy-release-centos-1.0-1.noarch.rpm: nDeploy-release-centos-1.0-1.noarch
Marking /var/tmp/yum-root-ei5tWJ/nDeploy-release-centos-1.0-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package nDeploy-release-centos.noarch 0:1.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
nDeploy-release-centos noarch 1.0-1 /nDeploy-release-centos-1.0-1.noarch 110

Step 3: Install the nDeploy and Nginx nDeploy plugins.

root@server1 [/usr]# yum --enablerepo=ndeploy install nginx-nDeploy nDeploy
Loaded plugins: fastestmirror, tsflags, universal-hooks
epel/x86_64/metalink | 9.9 kB 00:00:00
epel | 4.3 kB 00:00:00
ndeploy | 2.9 kB 00:00:00
(1/4): ndeploy/7/x86_64/primary_db | 14 kB 00:00:00
(2/4): epel/x86_64/group_gz | 169 kB 00:00:00
(3/4): epel/x86_64/primary_db | 3.7 MB 00:00:02

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
nDeploy noarch 2.0-11.el7 ndeploy 80 k
nginx-nDeploy x86_64 1.8.0-34.el7 ndeploy 36 M
Installing for dependencies:
PyYAML x86_64 3.10-11.el7 base 153 k
libevent x86_64 2.0.21-4.el7 base 214 k
memcached x86_64 1.4.15-9.el7 base 84 k
python-inotify noarch 0.9.4-4.el7 base 49 k
python-lxml x86_64 3.2.1-4.el7 base 758 k

Transaction Summary
===============================================================================================================================================
Install 2 Packages (+5 Dependent packages)

With these steps, we've completed with the installation of Nginx plugin in our server. Now we need to configure Nginx as reverse proxy and create the virtualhost for the existing cPanel user accounts. For that we can run the following script.

Step 4: To enable Nginx as a front end Web Server and create the default configuration files.

root@server1 [/usr]# /opt/nDeploy/scripts/cpanel-nDeploy-setup.sh enable
Modifying apache http and https port in cpanel

httpd restarted successfully.
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/ndeploy_watcher.service to /usr/lib/systemd/system/ndeploy_watcher.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/ndeploy_backends.service to /usr/lib/systemd/system/ndeploy_backends.service.
ConfGen:: saheetha
ConfGen:: satest

As you can see these script will modify the Apache port from 80 to another port to make Nginx run as a front end web server and create the virtual host configuration files for the existing cPanel accounts. Once it is done, confirm the status of both Apache and Nginx.

Apache Status:

root@server1 [/var/run/httpd]# systemctl status httpd
● httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2016-01-18 06:34:23 UTC; 12s ago
Process: 25606 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 24760 (httpd)
CGroup: /system.slice/httpd.service
‣ 24760 /usr/local/apache/bin/httpd -k start

Jan 18 06:34:23 server1.centos7-test.com systemd[1]: Starting Apache Web Server...
Jan 18 06:34:23 server1.centos7-test.com apachectl[25606]: httpd (pid 24760) already running
Jan 18 06:34:23 server1.centos7-test.com systemd[1]: Started Apache Web Server.

Nginx Status:

root@server1 [~]# systemctl status nginx
● nginx.service - nginx-nDeploy - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2016-01-17 17:18:29 UTC; 13h ago
Docs: http://nginx.org/en/docs/
Main PID: 3833 (nginx)
CGroup: /system.slice/nginx.service
├─ 3833 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
├─25473 nginx: worker process
├─25474 nginx: worker process
└─25475 nginx: cache manager process

Jan 17 17:18:29 server1.centos7-test.com systemd[1]: Starting nginx-nDeploy - high performance web server...
Jan 17 17:18:29 server1.centos7-test.com nginx[3804]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Jan 17 17:18:29 server1.centos7-test.com nginx[3804]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Jan 17 17:18:29 server1.centos7-test.com systemd[1]: Started nginx-nDeploy - high performance web server.

Nginx act as a frontend webserver running on port 80 and Apache configuration is modified to listen on http port 9999 and https port 4430. Please see their status below:

root@server1 [/usr/local/src]# netstat -plan | grep httpd
tcp 0 0 0.0.0.0:4430 0.0.0.0:* LISTEN 17270/httpd
tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 17270/httpd
tcp6 0 0 :::4430 :::* LISTEN 17270/httpd
tcp6 0 0 :::9999 :::* LISTEN 17270/httpd

apacheport
root@server1 [/usr/local/src]# netstat -plan | grep nginx
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 17802/nginx: master
tcp 0 0 45.79.183.73:80 0.0.0.0:* LISTEN 17802/nginx: master

The virtualhost entries created for the existing users as located in the folder "/etc/nginx/sites-enabled". This file path is included in the Nginx main configuration file.

root@server1 [/etc/nginx/sites-enabled]# ll | grep .conf
-rw-r--r-- 1 root root 311 Jan 17 09:02 saheetha.com.conf
-rw-r--r-- 1 root root 336 Jan 17 09:02 saheethastest.com.conf

Sample Vhost for a domain:

server {

listen 45.79.183.73:80;
#CPIPVSIX:80;

# ServerNames
server_name saheetha.com www.saheetha.com;
access_log /usr/local/apache/domlogs/saheetha.com main;
access_log /usr/local/apache/domlogs/saheetha.com-bytes_log bytes_log;

include /etc/nginx/sites-enabled/saheetha.com.include;

}

We can confirm the working of the web server status by calling a website in the browser. Please see the web server information on my server after the installation.

root@server1 [/home]# ip a | grep -i eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet 45.79.183.73/24 brd 45.79.183.255 scope global dynamic eth0
root@server1 [/home]# nginx -v
nginx version: nginx/1.8.0

webserver-status

Nginx will create the virtual host automatically for any newly created accounts in cPanel. With these simple steps we can configure Nginx as reverse proxy on a CentOS 7/CPanel server.

Advantages of Nginx as Reverse Proxy:

  1. Easy to install and configure
  2. Performance and efficiency
  3. Prevent DDOS attacks
  4. Allows .htaccess PHP rewrite rules

I hope this article is useful for you guys. Thank you for referring to this. I would appreciate your valuable comments and suggestions on this for further improvements.

The post How to Set Nginx as Reverse Proxy on Centos7 CPanel appeared first on LinOxide.

How to Install MariaDB 10 on CentOS 7 CPanel Server

$
0
0

MariaDB is a enhanced open source and drop-in replacement for MySQL. It is developed by MariaDB community and available under the terms of the GPL v2 license. Software Security is the main focus for the MariaDB developers. They maintain its own set of security patches for each MariaDB releases. When any critical security issues are discovered, the developers introduces a new release of MariaDB to get the fix out as soon as possible.

MariaDB is always up-to-date with the latest MySQL releases. It is highly compatible and works exactly like the MySQL. Almost all commands, data, table definition files, Client APIs, protocols, interfaces, structures, filenames, binaries, ports, database storage locations etc are same as the MySQL. It isn't even needed to convert databases to switch to MariaDB.

Advantages of MariaDB

  • Truly Open source
  • More quicker and transparent security releases
  • Highly Compatible with MySQL
  • Improved Performance
  • More storage engines compared to MySQL

In this article, I provides guidelines on how to upgrade MySQL 5.5 to the latest MariaDB on a CentOS 7 CPanel server. Let's walk through the Pre-installation steps.

Pre-requisites:

1. Stop current MySQL Service

root@server1 [/var/# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5859
Server version: 5.5.47-cll MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@server1 [~]# systemctl stop mysql
root@server1 [~]# systemctl status mysql
● mysql.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysql)
Active: failed (Result: exit-code) since Sun 2016-01-31 10:00:02 UTC; 1min 31s ago
Docs: man:systemd-sysv-generator(8)
Main PID: 23430 (code=exited, status=203/EXEC)

Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Started MySQL Server.
Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Starting MySQL Server...
Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service: main process exited, code=exited, status=203/EXEC
Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Unit mysql.service entered failed state.
Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service failed.

2. Move all configuration files and databases prior to the upgrade

Move the DB storage path and MySQL configuration files

root@server1 [~]# cp -Rf /var/lib/mysql /var/lib/mysql-old

root@server1 [/var/lib/mysql]# cat /etc/my.cnf
[mysqld]
default-storage-engine=MyISAM
innodb_file_per_table=1
max_allowed_packet=268435456
open_files_limit=10000

root@server1 [~]#mv /etc/my.cnf /etc/my.cnf-old

3. Remove and uninstall all MySQL rpms from the server

Run the following commands to disable the MySQL RPM targets. By running this commands, cPanel will no longer handle MySQL updates, and mark these rpm.versions as uninstalled on the system.

/scripts/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled
/scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled
/scripts/update_local_rpm_versions --edit target_settings.MySQL55 uninstalled
/scripts/update_local_rpm_versions --edit target_settings.MySQL56 uninstalled

Now run the this command:

/scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56 to remove all existing MySQL rpms on the server and leave a clean environment for MariaDB installation. Please see its output below:

root@server1 [/var/lib/mysql]# /scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56
[2016-01-31 09:53:59 +0000]
[2016-01-31 09:53:59 +0000] Problems were detected with cPanel-provided files which are RPM controlled.
[2016-01-31 09:53:59 +0000] If you did not make these changes intentionally, you can correct them by running:
[2016-01-31 09:53:59 +0000]
[2016-01-31 09:53:59 +0000] > /usr/local/cpanel/scripts/check_cpanel_rpms --fix
[2016-01-31 09:53:59 +0000]
[2016-01-31 09:53:59 +0000] The following RPMs are unneeded on your system and should be uninstalled:
[2016-01-31 09:53:59 +0000] MySQL55-client-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] MySQL55-devel-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] MySQL55-server-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] MySQL55-shared-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] MySQL55-test-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] compat-MySQL50-shared-5.0.96-4.cp1136
[2016-01-31 09:53:59 +0000] compat-MySQL51-shared-5.1.73-1.cp1150
[2016-01-31 09:53:59 +0000] Removing 0 broken rpms:
[2016-01-31 09:53:59 +0000] rpm: no packages given for erase
[2016-01-31 09:53:59 +0000] No new RPMS needed for install
[2016-01-31 09:53:59 +0000] Disabling service monitoring.
[2016-01-31 09:54:01 +0000] Uninstalling unneeded rpms: MySQL55-test MySQL55-server MySQL55-client compat-MySQL51-shared compat-MySQL50-shared MySQL55-shared MySQL55-devel
[2016-01-31 09:54:04 +0000] Removed symlink /etc/systemd/system/multi-user.target.wants/mysql.service.
[2016-01-31 09:54:04 +0000] Restoring service monitoring.

With these steps, we've uninstalled existing MySQL RPMs, marked targets to prevent further MySQL updates and made the server ready and clean for the MariaDB installation.

To startup with the installation, we need to create a yum repository for MariaDB depending on the MariaDB & CentOS versions. This is how I did it!

Installation procedures:

Step 1: Creating a YUM repository.

root@server1 [~]# vim /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
root@server1 [/etc/yum.repos.d]# cat /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Step 2: Open the /etc/yum.conf and modify the exclude line as below:

Remove this line exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* php* proftpd* pure-ftpd* spamassassin* squirrelmail*

And replace with this line exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* proftpd* pure-ftpd* spamassassin* squirrelmail*
**IMPORTANT ***

We need to make sure, we've removed the MySQL and PHP from the exclude list.

Step 3: Run the following command to install MariaDB and related packages.

yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql

root@server1 [~]#yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
MariaDB-client x86_64 10.0.23-1.el7.centos mariadb 10 M
MariaDB-devel x86_64 10.0.23-1.el7.centos mariadb 6.3 M
MariaDB-server x86_64 10.0.23-1.el7.centos mariadb 55 M
php-mysql x86_64 5.4.16-36.el7_1 base 99 k
Installing for dependencies:
MariaDB-common x86_64 10.0.23-1.el7.centos mariadb 43 k
MariaDB-shared x86_64 10.0.23-1.el7.centos mariadb 1.2 M
libzip x86_64 0.10.1-8.el7 base 48 k
php-common x86_64 5.4.16-36.el7_1 base 563 k
php-pdo x86_64 5.4.16-36.el7_1 base 97 k

Transaction Summary
===============================================================================================================================================
Install 4 Packages (+5 Dependent package)

Step 4: Restart and make sure the MySQL service is up.

root@server1 [~]# systemctl start mysql
root@server1 [~]#
root@server1 [~]#
root@server1 [~]# systemctl status mysql
● mysql.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysql)
Active: active (exited) since Sun 2016-01-31 10:01:46 UTC; 3s ago
Docs: man:systemd-sysv-generator(8)
Process: 23717 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
Main PID: 23430 (code=exited, status=203/EXEC)

Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL...
Jan 31 10:01:46 server1.centos7-test.com mysql[23717]: Starting MySQL SUCCESS!
Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL.

Step 5 : Run mysql_upgrade command

It will examine all tables in all databases for incompatibilities with the current installed version and upgrades the system tables if necessary to take advantage of new privileges or capabilities that might have added with the current version.

root@server1 [~]# mysql_upgrade
MySQL upgrade detected
Phase 1/6: Checking and upgrading mysql database
Processing databases
mysql
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/6: Fixing views from mysql
Phase 3/6: Running 'mysql_fix_privilege_tables'
Phase 4/6: Fixing table and database names
Phase 5/6: Checking and upgrading tables
Processing databases
cphulkd
cphulkd.auths OK
cphulkd.blacklist OK
cphulkd.brutes OK
cphulkd.good_logins OK
cphulkd.ip_lists OK
cphulkd.known_netblocks OK
cphulkd.login_track OK
cphulkd.logins OK
cphulkd.report OK
cphulkd.whitelist OK
eximstats
eximstats.defers OK
eximstats.failures OK
eximstats.sends OK
eximstats.smtp OK
information_schema
leechprotect
leechprotect.hits OK
modsec
modsec.hits OK
performance_schema
roundcube
roundcube.cache OK
roundcube.cache_index OK
roundcube.cache_messages OK
roundcube.cache_shared OK
roundcube.cache_thread OK
roundcube.contactgroupmembers OK
roundcube.contactgroups OK
roundcube.contacts OK
roundcube.cp_schema_version OK
roundcube.dictionary OK
roundcube.identities OK
roundcube.searches OK
roundcube.session OK
roundcube.system OK
roundcube.users OK
saheetha_test
saheetha_test.authors OK
whmxfer
whmxfer.sessions OK
Phase 6/6: Running 'FLUSH PRIVILEGES'
OK

Step 6 : Restart the MySQL service once again to ensure everything works perfect.

root@server1 [~]# systemctl restart mysql
root@server1 [~]#
root@server1 [~]# systemctl status mysql
● mysql.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysql)
Active: active (running) since Sun 2016-01-31 10:04:11 UTC; 9s ago
Docs: man:systemd-sysv-generator(8)
Process: 23831 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 23854 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
Main PID: 23430 (code=exited, status=203/EXEC)
CGroup: /system.slice/mysql.service
├─23861 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/server1.centos7-test.com.pid
└─23933 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/v...

Jan 31 10:04:10 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL...
Jan 31 10:04:11 server1.centos7-test.com mysql[23854]: Starting MySQL. SUCCESS!
Jan 31 10:04:11 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL.

Step 7: Run EasyApache to rebuild Apache/PHP with MariaDB and ensure all PHP modules remains intact.

root@server1 [~]#/scripts/easyapache --build

****IMPORTANT *****
If you forget to rebuild Apache/PHP after the MariaDB installation, it will report the library error as below:

root@server1 [/etc/my.cnf.d]# php -v
php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

Step 8: Now verify the installation and databases.

root@server1 [/var/lib/mysql]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 15
Server version: 10.0.23-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show storage engines;
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| CSV | YES | CSV storage engine | NO | NO | NO |
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
10 rows in set (0.00 sec)

That's all :). Now we're all set to go with MariaDB with its improved and efficient features. Hope you enjoyed reading this documentation. I would recommend your valuable suggestions and feedback on this!

The post How to Install MariaDB 10 on CentOS 7 CPanel Server appeared first on LinOxide.

How to Add New Disk in Linux CentOS 7 Without Rebooting

$
0
0

Increasing disk spaces on the Linux servers is a daily routine work for very system administrator. So, in this article we are going to show you some simple simple steps that you can use to increase your disk spaces on Linux CentOS 7 without rebooting to your production server using Linux commands. We will cover multiple methods and possibilities to increase and add new disks to the Linux systems, so that you can follow the one that you feel comfortable while using according to your requirements.

1) Increasing Disk of VM Guest:

Before increasing the disk volume inside your Linux system, you need to add a new disk or increase the one its has already attached with the system by editing its settings from your VMware vShere, Workstation or any other infrastructure environment that you are using.

Increase disk

2) Check Disk Space:

Run the following command to check the current size of your disk space.

# df -h

# fdisk -l

Fdisk check

Here we can see that the total disk size is still the same that is 10 GB while we have already increased it to 50 GB from the back end.

3) Expanding Space without Rebooting VM

Now run the following commands to expand the disk space in the physical volume of the Operating System without rebooting the virtual machine by Re-scanning the SCSI Bus and then adding SCSI Device.

# ls /sys/class/scsi_host/

# echo "- - -" > /sys/class/scsi_host/host0/scan

# echo "- - -" > /sys/class/scsi_host/host1/scan

# echo "- - -" > /sys/class/scsi_host/host2/scan

Check the names of your SCSI devices and then rescan the SCSI buses using below commands.

# ls /sys/class/scsi_device/

# echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan

# echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan

That will rescan the current scsi bus and the disk size that we increased from the VM guest settings will be show up as you can see in the below image.

Rescan disk device

4) New Disk Partition:

Once you are able to see the increased disk space inside your system then the run the following command to format your disk for creating a new partition by following the steps to increase your physical disk volume.

# fdisk /dev/sda

Welcome to fdisk (util-linux 2.23.2) press the 'm' key for help

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help):

Type the 'p' to print the current partition table then create a new primary partition by typing the 'n' key and selecting the available sectors. Change the disk type to 'Linux LVM' by using 't' command and selecting the code to '8e' or leave as it to its default type that is '83'.

Now write the table to disk and exit by Entring 'w' key as shown.

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)

New disk Volume

5)Creating Physical Volume:

As indicated above run the 'partprobe' or kpartx command so that the tables are ready to use and then create the new Physical Volume using the below commands.

# partprobe

# pvresize /dev/sda3

To check the newly created volume run the following command to see if the new physical volume has been created and visible. After that we will extend the Volume Group 'centos' with the newly create Physical Volume as shown.

# pvdisplay

# vgextend centos /dev/sda3

Extend volume Group

6) Extending Logical Volume:

Now we will extend the Logical Volume to increase the disk space on it using the the below command.

# lvextend -L +40G /dev/mapper/centos-root

Once you get the successfully increased message, run the command as shown below to extend the size of your logical volume .

# xfs_growfs /dev/mapper/centos-root

The size of the '/' partition has been increased successfully, you can check the size of your disk drives by using the 'df' command as shown.

Increase disk space

7) Extending Root Partition by Adding New Disk Without Reboot:

This is the second method with but with quite similar commands to increase the size of the Logical volume in CentOS 7.

So, the first step is to Open the setting of your VM guest settings and click on the 'Add' new button and proceed to the next option.

add new disk

Choose the required configuration for the new disk by selecting the size of the new disk and its type as shown in the below image.

New disk setup

Then come to the server side and repeat the following commands to scan your disk devices to the new disk is visible on the system.

# echo "- - -" > /sys/class/scsi_host/host0/scan

# echo "- - -" > /sys/class/scsi_host/host1/scan

# echo "- - -" > /sys/class/scsi_host/host2/scan

List the names of your SCSi devices

# ls /sys/class/scsi_device/

# echo 1 > /sys/class/scsi_device/1\:0\:0\:0/device/rescan
# echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan
# echo 1 > /sys/class/scsi_device/3\:0\:0\:0/device/rescan

# fdisk -l

scanning new disk

Once the new disk is visible run the below commands to create the new physical volume and add it to the volume group as shown.

# pvcreate /dev/sdb

# vgextend centos /dev/sdb

# vgdisplay

Extending olume Group

Now extend the Logical Volume by adding the disk space on it and then add it to the root partition.

# lvextend -L +20G /dev/mapper/centos-root

# xfs_growfs /dev/mapper/centos-root

# df -h

Increase / Partition

Conclusion:

Managing disk partitions in Linux CentOS 7 is a simple process to increase the disk space of any of your logical volumes by using the steps as described in this article. You don't need to give your production server's reboot for this purpose but simply rescan your SCSi devices and expand your desired LVM. We hope you find this article much helpful. Feel free to leave your valuable comments or suggestions.

The post How to Add New Disk in Linux CentOS 7 Without Rebooting appeared first on LinOxide.

Viewing all 382 articles
Browse latest View live