How To Install XAMPP on CentOS 7

XAMPP on CentOS 7

XAMPP is an open source software that provides users with an out-of-the-box server experience. It is a complex, yet very easy-to-use AMPP (Apache, MySQL, PHP and Perl) distribution that’s compatible with the Linux, Microsoft Windows and Mac OS X operating systems. The best tool for those who want to install a fully functional web development environment.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation XAMPP stack on a CentOS 7 server.
Features XAMPP

Regularly updated to the latest versions of Apache, MariaDB, PHP and Perl.
Supports other modules like OpenSSL, phpMyAdmin, MediaWiki, Joomla, WordPress etc.,
Tests the website designers and programmers work without Internet.
Secured package.
Allows creation and manipulation of databases in MariaDB and SQLite.

Install XAMPP on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing XAMPP on CentOS 7.

The first step is to download script from official xampp and to add the code in a new .run file on your Ubuntu machine, wherever you’d like this:

https://www.apachefriends.org/xampp-files/7.1.1/xampp-linux-x64-7.1.1-0-installer.run

Next, run the following command to make XAMPP executable:

chmod +x xampp-linux-x64-7.1.1-0-installer.run

Now is the time to run the script file to install XAMPP and wait until xampp is fully installed:

./xampp-linux-x64-7.1.1-0-installer.run

That should start the XAMPP installation setup. Continue with the installation as you usually do:
XAMPP1
xampp2
xampp3
xampp4
xampp5
xampp6
Once the setup is finished, XAMPP should be available for its usage in your Desktop or open your browser and follow this link : http://localhost/dashboard/

Congratulation’s! You have successfully installed XAMPP. Thanks for using this tutorial for installing XAMPP stack on CentOS 7 system. For additional help or useful information, we recommend you to check the official XAMPP web site.

How To Install PowerDNS on CentOS 7

PowerDNS on CentOS 7

PowerDNS is a MySQL-based DNS server, written in C++ and licensed under the GPL. PowerDNS can be managed through a web interface (PowerAdmin). Unlike Bind, PowerDNS can be setup using a multitude of backends such as Bind Zone Files, or various Databases.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation PowerDNS on a CentOS 7 server.
Install PowerDNS on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing PowerDNS and backend.

First, you need to enable EPEL repository and all required packages on your system:

yum install epel-release
yum install bind-utils pdns pdns-recursor pdns-backend-mysql mariadb mariadb-server

Enable PowerDNS on boot and start PowerDNS server:

systemctl enable mariadb
systemctl enable pdns
systemctl enable pdns-recursor

Step 3. Configuring MariaDB.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.

mysql_secure_installation

Step 4. Create PowerDNS Database and User in MariaDB.

Login as a MariaDB root and create a new database and tables:

### mysql -uroot -p

create user 'powerdns'@'localhost' identified by 'password';
grant all privileges on powerdns.* to 'powerdns'@'localhost';
flush privileges;
use powerdns;

CREATE TABLE domains (
id INT AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
PRIMARY KEY (id)
) Engine=InnoDB;

CREATE UNIQUE INDEX name_index ON domains(name);

CREATE TABLE records (
id INT AUTO_INCREMENT,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(10) DEFAULT NULL,
content VARCHAR(64000) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
disabled TINYINT(1) DEFAULT 0,
ordername VARCHAR(255) BINARY DEFAULT NULL,
auth TINYINT(1) DEFAULT 1,
PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
CREATE INDEX recordorder ON records (domain_id, ordername);

CREATE TABLE supermasters (
ip VARCHAR(64) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) NOT NULL,
PRIMARY KEY (ip, nameserver)
) Engine=InnoDB;

CREATE TABLE comments (
id INT AUTO_INCREMENT,
domain_id INT NOT NULL,
name VARCHAR(255) NOT NULL,
type VARCHAR(10) NOT NULL,
modified_at INT NOT NULL,
account VARCHAR(40) NOT NULL,
comment VARCHAR(64000) NOT NULL,
PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX comments_domain_id_idx ON comments (domain_id);
CREATE INDEX comments_name_type_idx ON comments (name, type);
CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);

CREATE TABLE domainmetadata (
id INT AUTO_INCREMENT,
domain_id INT NOT NULL,
kind VARCHAR(32),
content TEXT,
PRIMARY KEY (id)
) Engine=InnoDB;

CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);

CREATE TABLE cryptokeys (
id INT AUTO_INCREMENT,
domain_id INT NOT NULL,
flags INT NOT NULL,
active BOOL,
content TEXT,
PRIMARY KEY(id)
) Engine=InnoDB;

CREATE INDEX domainidindex ON cryptokeys(domain_id);

CREATE TABLE tsigkeys (
id INT AUTO_INCREMENT,
name VARCHAR(255),
algorithm VARCHAR(50),
secret VARCHAR(255),
PRIMARY KEY (id)
) Engine=InnoDB;

CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);

Step 5. Configure PowerDNS.

Open the /etc/pdns/pdns.conf file and add the following lines:
allow-axfr-ips=
allow-recursion=
launch=gmysql
gmysql-host=127.0.0.1
gmysql-user=
gmysql-password=
gmysql-dbname=powerdns
local-address=
local-port=53
master=yes
recursor=127.0.0.1:5353
setgid=pdns
setuid=pdns
webserver=yes
webserver-address=
webserver-password=
webserver-port=8081

Finally, restart the Power DNS service:

systemctl restart pdns.service
systemctl enable pdns.service

Step 6. Configure Recursor.

Open the /etc/pdns-recursor/recursor.conf file and add the following lines:

setuid=pdns-recursor
setgid=pdns-recursor
allow-from=127.0.0.0/8
local-address=127.0.0.1
local-port=5353

Start the Recursor service:

systemctl restart pdns-recursor

Test Recursor:

host ping.wpcademy.com 127.0.0.1

Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

ping.wpcademy.com has address 194.109.46.8
ping.wpcademy.com has IPv6 address 2001:888:0:25:169:109:21:66

Congratulation’s! You have successfully installed PowerDNS. Thanks for using this tutorial for installing PowerDNS on CentOS 7 system. For additional help or useful information, we recommend you to check the official PowerDNS web site.

How To Install Invoice Ninja on CentOS 7

Invoice Ninja on CentOS 7

Invoice Ninja is a free and open source web-bases application software that can be used for invoicing, payments, time tracking and many more. It is best solution for invoicing and billing customers. You can easily create and send invoices online in seconds. Invoice Ninja allows you to create your own custom invoice and show live invoice as PDF file.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Invoice Ninja on a CentOS 7 server.
Invoice Ninja’s features

Create work tasks and track time
Create invoices online in seconds
Email invoices & get paid online
Mobile responsive design
Integrate 45+ payment gateways
10 fresh invoice template designs
View live invoice .PDF creation
Add your company logo to invoices
Quotations convert to invoices
Auto-billing & recurring invoices
Multiple tax settings
Multiple currencies supported
Client Portal to View Invoices
Alerts when invoices are paid
Set invoice payment due dates
Import expenses and setup vendors

Install Invoice Ninja on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y install epel-release
yum -y update

Step 2. Install LEMP server.

A CentOS 7 LEMP stack server is required. If you do not have a LEMP installed, you can follow our guide here. Also install required PHP modules:

yum install install php70w-fpm php70w-cli php70w-pear php70w-gd php70w-xml php70w-curl php70w-gmp php70w-pdo php70w-mysql php70w-zip php70w-mbstring php70w-mcrypt

Once the installation is finished, you will need to modify the php.ini configuration file:

nano /etc/php.ini

Change the following line:

cgi.fix_pathinfo=0

Step 3. Configuring MariaDB for Invoice Ninja.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

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

Next we will need to log in to the MariaDB console and create a database for the Invoice Ninja. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Invoice Ninja installation:

MariaDB [(none)]> CREATE DATABASE ninja_db;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON ninja_db.* TO 'ninja'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Step 4. Configure PHP-FPM.

You will need to configure PHP-FPM pool for Nginx user:

nano /etc/php-fpm.d/www.conf

Change the following lines:

user = nginx
group = nginx
listen = /var/run/php/php-fpm.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

Save the file and exit from the text editor.

Next, you will need to create a new directory for PHP session and socket file:

mkdir -p /var/lib/php/session
mkdir -p /var/run/php/
chown -R nginx:nginx /var/lib/php/session/
chown -R nginx:nginx /var/run/php/

Next, start PHP-FPM and enable it to start at boot time using following commands:

systemctl start php-fpm
systemctl enable php-fpm

Step 5. Installing Invoice Ninja.

First thing to do is to go to Invoice Ninja’s download page and download the latest stable version of Invoice Ninja:

cd /var/www/html/
git clone https://github.com/hillelcoren/invoice-ninja.git ninja

You need to install composer:

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer

Next, install all the Invoice Ninja dependencies using composer:

cd /var/www/html/ninja
composer install --no-dev -o

Once the installation is done, rename the .env file and make some changes:

mv .env.example .env
nano .env

Change the database values according to your database:

DB_DATABASE=ninja_db
DB_USERNAME=ninja
DB_PASSWORD=Y0urPa55w0rd

Save the file and exit from the text editor. Next, edit the database configuration in the config directory:

nano config/database.php

Change the following lines:

'database' => env('DB_DATABASE', 'ninja_db'),
'username' => env('DB_USERNAME', 'ninja'),
'password' => env('DB_PASSWORD', 'Y0urPa55w0rd'),

Save the file and exit from the text editor and prepare the database with following command:

php artisan migrate

You will be prompted for a run the command, type ‘yes’ and press Enter.

Next, seed the database with all records as shown below:

php artisan db:seed

Run following command to generate the application key and note this application key:

php artisan key:generate

Next, edit the app.php file with nano text editor:

nano config/app.php

Add the key as shown below:

'key' => env('APP_KEY', 'y0urGenerated Key'),

Save and close the file also change some folders permissions:

chown -R nginx:nginx /var/www/html/ninja/

 

Step 6. Configure Nginx for Invoice Ninja.

Create an SSL Certificate and create a new virtual host configuration for Invoice Ninja:

mkdir -p /etc/nginx/cert/openssl req -new -x509 -days 365 -nodes -out /etc/nginx/cert/ninja.crt -keyout /etc/nginx/cert/ninja.keychmod 600 /etc/nginx/cert/*

Next, create a new virtual host configuration file inside /etc/nginx/ directory:

nano /etc/nginx/conf.d/ninja.conf

Add the following lines:

server {
listen 80;
server_name idroot.net;
add_header Strict-Transport-Security max-age=2592000;
rewrite ^ https://$server_name$request_uri? permanent;
}

server {
listen 443 default;
server_name 192.168.15.23;
ssl on;
ssl_certificate /etc/nginx/cert/ninja.crt;
ssl_certificate_key /etc/nginx/cert/ninja.key;
ssl_session_timeout 5m;
ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL';
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
root /var/www/html/ninja/public;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

# Access and Error Log for Invoice Ninja
access_log /var/log/nginx/ininja.access.log;
error_log /var/log/nginx/ininja.error.log;

sendfile off;

# Handle PHP Applications
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}

location ~ /\.ht {
deny all;
}
}

Save and close the file. Restart the Nginx service for the changes to take effects:

systemctl restart nginx

Step 7. Configure FirewallD Invoice Ninja.

Before accessing Invoice Ninja web interface, you will need to allow http and https service through firewalld:

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

Step 8. Accessing Invoice Ninja.

Invoice Ninja will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/ or http://server-ip and complete the required the steps to finish the installation.

Congratulation’s! You have successfully installed Invoice Ninja. Thanks for using this tutorial for installing Invoice Ninja on CentOS 7 system. For additional help or useful information, we recommend you to check the official Invoice Ninja web site.

How To Install Pip on CentOS 7

Pip on CentOS 7

The Pip command is a tool for installing and managing Python packages, such as those found in the Python Package Index. With the help of pip you can also install the package of particular version. Most importantly pip has a feature to manage full lists of packages and corresponding version numbers, possible through a “requirements” file. It performs the same basic job as easy_install, but with some extra features.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Pip Python on a CentOS 7 server.
Install Pip on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum install epel-release
yum -y update

Step 2. Installing Pip.

Method 1.

Install the pip by using Yum command:

yum -y install python-pip

Once the installation is completed you can verify that it was successful by using the following command:

pip -V

Method 2.

Installing Pip with Curl and Python:

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"

Now install pipby using the following command:

python get-pip.py

Once the installation is completed you can verify the installation:

pip -V

Step 3. How to use pip command.

After installing python-pip package, the pip command will be available on system. There are multiple options available with pip command:

To install new python package type:

pip install packageName

To uninstall python package installed by pip type:

pip uninstall packageName

To search python package type:

pip search packageName

For more Pip options and usage examples you can use the –help flag:

[[email protected] ~]# pip --help


Usage:
pip [options]

Commands:

install Install packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
search Search PyPI for packages.
wheel Build wheels from your requirements.
zip DEPRECATED. Zip individual packages.
unzip DEPRECATED. Unzip individual packages.
bundle DEPRECATED. Create pybundles.
help Show help for commands.

General Options:

-h, --help Show help.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output.
--log-file Path to a verbose non-appending log, that only logs failures. This
log is active by default at /home/sharad/.pip/pip.log.
--log Path to a verbose appending log. This log is inactive by default.
--proxy Specify a proxy in the form [user:passwd@]proxy.server:port.
--timeout Set the socket timeout (default 15 seconds).
--exists-action Default action when a path already exists: (s)witch, (i)gnore,
(w)ipe, (b)ackup.
--cert Path to alternate CA bundle.
[[email protected] ~]#

Congratulation’s! You have successfully installed Pip. Thanks for using this tutorial for installing Pip Python on CentOS 7 system. For additional help or useful information, we recommend you to check the official Python web site.

How To Install lnav on CentOS 7

lnav on CentOS 7

The Log File Navigator (lnav) is an enhanced log file viewer that takes advantage of any semantic information that can be gleaned from the files being viewed, such as timestamps and log levels. Using this extra semantic information, lnav can do things like interleaving messages from different files, generate histograms of messages over time, and providing hotkeys for navigating through the file. It is hoped that these features will allow the user to quickly and efficiently zero in on problems.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation lnav log file navigator on a CentOS 7 server.
lnav Features

Single log view: all log file contents are merged into a single view based on message timestamps. No need to manually correlate timestamps across multiple windows or figure out the order in which to view rotated log files.
Automatic format detection for several common log files. It also detects gzip/bzi2 files and decompress them automatically on the fly.
Filters: display only lines that match or do not match a set of regular expressions. Filter by error level.
Timeline view: shows a histogram of messages over time. The number of warnings and errors are highlighted in the display so that you can easily see where problems have occurred.
Query logs using SQL: log files are directly used as the backing for SQLite virtual tables.
Automatic data extraction: built-in log message parser can automatically discover and extract interesting data from plainly formatted log messages.
Live operation: Search as you type. New log lines are automatically loaded and searched as they are added; filters apply to lines as they are loaded; and, SQL queries are checked for correctness as you type.
Syntax highlighting with configurable colourizing
Tab completion
Sessions
Supports Linux and Mac

Install lnav on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing lnav.

For CentOS 7 or older versions, you need to include EPEL Repository to your YUM first:

yum install epel-release -y

Now, install lnav using yum command:

yum install lnav -y

How to Use lnav

First look at all the options taken by lnav:

usage: lnav [options] [logfile1 logfile2 ...]

A curses-based log file viewer that indexes log messages by type
and time to make it easier to navigate through files quickly.

Key bindings:
? View/leave the online help text.
q Quit the program.

Options:
-h Print this message, then exit.
-H Display the internal help text.
-I path An additional configuration directory.
-i Install the given format files and exit.
-C Check configuration and then exit.
-d file Write debug messages to the given file.
-V Print version information.

-a Load all of the most recent log file types.
-r Load older rotated log files as well.
-t Prepend timestamps to the lines of data being read in
on the standard input.
-w file Write the contents of the standard input to this file.

-c cmd Execute a command after the files have been loaded.
-f path Execute the commands in the given file.
-n Run without the curses UI. (headless mode)
-q Do not print the log messages after executing all
of the commands or when lnav is reading from stdin.

Optional arguments:
logfile1 The log files or directories to view. If a
directory is given, all of the files in the
directory will be loaded.

Examples:
To load and follow the syslog file:
$ lnav

To load all of the files in /var/log:
$ lnav /var/log

To watch the output of make with timestamps prepended:
$ make 2>&1 | lnav -t
Let’s use some examples to demonstrate the working of this tool, run lnav command and it will start displaying the real time information on the basis of most recent time stamps from all log files:
lnav

lnav-log-viewer

Congratulation’s! You have successfully installed Seafile. Thanks for using this tutorial for installing lnav log file navigator on CentOS 7 system. For additional help or useful information, we recommend you to check the official lnav web site.

How To Install Seafile on CentOS 7

Seafile on CentOS 7

Seafile is a open source cloud storage software. It offers file sharing and syncing for individual users and groups, it provides client side encryption and easy access from mobile devices. Also easily integrated with local services such as LDAP and WebDAV or can be deployed using advanced network services and databases like MySQL, SQLite, PostgreSQL, Memcached, Nginx or Apache Web Server.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Seafile Secure Cloud Storage on a CentOS 7 server.
Install Seafile on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing required packages.

Seafile storage setup requires some Python modules that must be installed on your server:

yum install python-imaging MySQL-python python-memcached python-ldap python-urllib3

Step 3. Installing MariaDB.

Install MariaDB using Yum:

yum install epel-release
yum install mariadb mariadb-server

Start MariaDB and enable it to start on boot of the server:

systemctl start mariadb.service
systemctl enable mariadb.service

Configuring MariaDB for Seafile.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

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

Step 4. Installing Seafile.

First thing to do is to go to Seafile’s download page and download the latest stable version of Seafile, At the moment of writing this article it is version 6.0.8:

wget https://bintray.com/artifact/download/seafile-org/seafile/seafile-server_6.0.8_x86-64.tar.gz

Unpack the Seafile archive to the document root directory on your server:

sudo mkdir -p /opt/seafile/installed
sudo mv seafile-server_6.0.8_x86-64.tar.gz /opt/seafile/installed
sudo mv seafile-server-6.0.8/ /opt/seafile

Run this script which will create the required databases and directories for the Seafile server and and answer all questions using the following configuration options, after the script verifies the existence of all Python required modules:

cd /opt/seafile/seafile-server-6.0.8
sudo ./setup-seafile-mysql.sh

After the installation finishes, run the following commands to start Seafile server and setup an admin user account:

sudo ./seafile.sh start
sudo ./seahub.sh start

Step 5. Configure firewall rules for Seafile.

You need to modify firewall rules using these commands:

sudo firewall-cmd --zone=public --permanent --add-port=8082/tcp
sudo firewall-cmd --zone=public --permanent --add-port=8000/tcp
sudo firewall-cmd --reload

Step 6. Accessing Seafile.

Seafile will be available on HTTP port 8000 by default. Open your favorite browser and navigate to http://yourdomain.com:8000 or http://server-ip:8000. Enter the admin email id and password to login which you have created at the time of installation. If you are using a firewall, please open port 8000 to enable access to the control panel.
seafile-web-interface-login
Congratulation’s! You have successfully installed Seafile. Thanks for using this tutorial for installing Seafile Secure Cloud Storage on CentOS 7 system. For additional help or useful information, we recommend you to check the official Seafile web site.

How To Install Mattermost on CentOS 7

Mattermost on CentOS 7

Mattermost is an open source, private cloud Slack-alternative. A workplace messaging system for web, PCs and phones, released under the MIT license.

As an alternative to proprietary SaaS messaging, Mattermost brings all your team communication into one place, making it searchable and accessible anywhere. Mattermost is “Slack-compatible, not Slack-limited”, supporting a superset of Slack’s incoming and outgoing webhook integrations, including compatibility with existing Slack integrations. From your existing Slack teams, you can import users, public channel history and even theme setting colors into Mattermost.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Mattermost on a CentOS 7 server.
Install Mattermost on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing MySQL database.

Install and set up the database for use by the Mattermost server. You can install MySQL using command below:

wget http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
yum localinstall mysql57-community-release-el7-9.noarch.rpm

Next, install MySQL:

sudo yum install mysql-community-server

Start the MySQL server:

systemctl start mysqld.service
chkconfig mysqld on

Configuring MySQL for SugarCRM.

By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL:

mysql_secure_installation

Configure it like this:

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

Next we will need to log in to the MySQL console and create a database for the Mattermost. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Mattermost installation:

mysql> CREATE USER 'mmuser'@'localhost' IDENTIFIED BY 'mmuser_strong_password';
mysql> CREATE DATABASE mattermostdb;
mysql> GRANT ALL PRIVILEGES ON mattermostdb.* TO 'mmuser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;

Step 3. Installing Mattermost Server.

First thing to do is to go to Mattermost’s download page and download the latest stable version of Mattermost, At the moment of writing this article it is version 3.6.2:

wget https://releases.mattermost.com/3.6.2/mattermost-3.6.2-linux-amd64.tar.gz

Unpack the Mattermost archive to the document root directory on your server:

tar xf *.gz
mv mattermost /opt/

Create the storage directory for files:

mkdir /opt/mattermost/data

Set up a system user and group called mattermost that will run this service, and set the ownership and permissions:

useradd --system --user-group mattermost
chown -R mattermost:mattermost /opt/mattermost
chmod -R g+w /opt/mattermost

Set up the database driver through the /opt/mattermost/config/config.json file. In it, search for “DriverName” and “DataSource” lines and change as follows:

"DriverName": "mysql"
"DataSource": "mmuser:@tcp(localhost:3306)/mattermost?charset=utf8"

Save, exit, and test the Mattermost Server with the following command:

sudo -u mattermost /opt/mattermost/bin/platform

When the server starts, it shows some log information and the text Server is listening on :8065. You can stop the server by pressing CTRL+C in the terminal window.

Step 4. Create a systemd unit for Mattermost.

Create a systemd file for Mattermost, /etc/systemd/system/mattermost.service and, in it, paste the following configuration:

[Unit]
Description=Mattermost
After=syslog.target network.target postgresql-9.4.service

[Service]
Type=simple
WorkingDirectory=/opt/mattermost/bin
User=mattermost
ExecStart=/opt/mattermost/bin/platform
PIDFile=/var/spool/mattermost/pid/master.pid
LimitNOFILE=49152

[Install]
WantedBy=multi-user.target

Make the service executable:

chmod 664 /etc/systemd/system/mattermost.service

And reload the services:

systemctl daemon-reload

Enable Mattermost service:

chkconfig mattermost on

And start it with systemd:

systemctl start mattermost

Step 5. Installing and configure NGINX.

In a production system, use a proxy server in front of Mattermost Server. In this case, NGINX. The main benefits of doing this are:

SSL termination
Port mapping :80 to :8065
HTTP to HTTPS redirect
Standard request logs

In order to install NGINX on CentOS 7, create a yum repository file, /etc/yum.repos.d/nginx.repo, with the following content:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/7.1/$basearch/
gpgcheck=0
enabled=1

Install Nginx using YUM command:

yum install nginx.x86_64

After the installation is complete, start NGINX:

systemctl start nginx
systemctl enable nginx

Configuration Nginx.

In order to configure NGINX as proxy server, create the file /etc/nginx/sites-available/mattermost and past:

upstream backend {
server localhost:8065;
}

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;

server {
listen 80;
server_name mattermost.mydomain.com;

location /api/v3/users/websocket {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 50M;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_buffers 256 16k;
proxy_buffer_size 16k;
proxy_read_timeout 600s;
proxy_pass http://backend;
}

location / {
client_max_body_size 50M;
proxy_set_header Connection "";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_buffers 256 16k;
proxy_buffer_size 16k;
proxy_read_timeout 600s;
proxy_cache mattermost_cache;
proxy_cache_revalidate on;
proxy_cache_min_uses 2;
proxy_cache_use_stale timeout;
proxy_cache_lock on;
proxy_pass http://backend;
}
}

Remove the existing default sites-enabled file:

rm /etc/nginx/sites-enabled/default

Enable the mattermost configuration:

ln -s /etc/nginx/sites-available/mattermost /etc/nginx/sites-enabled/mattermost

Finally, restart Nginx service:

systemctl restart nginx

Step 7. Accessing Mattermost.

Mattermost will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://mattermost.mydomain.com/ and continue to configure Mattermost by entering an email address and creating an account. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed Mattermost. Thanks for using this tutorial for installing Mattermost on CentOS 7 system. For additional help or useful information, we recommend you to check the official Mattermost web site.