How To Install Vagrant on CentOS 7

Vagrant on CentOS 7

Vagrant is an open source tool for building an entire virtual development environment. Frequently, a test environment is needed for analyzing the latest release and new tools. Also, it reduces the time spent on re-building that your OS. By default, vagrant uses virtualbox for managing the Virtualization. Vagrant acts as the fundamental configuration for managing/deploying multiple reproducible virtual environments with the same configuration.

Table of Contents

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

Step 2. Installing VirtualBox.

Step 3. Installing Vagrant.

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 Vagrant virtual development environment on a CentOS 7 server.
Install Vagrant 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 VirtualBox.

The prerequisite is you need to install Virtualbox before working on Vagrant because Vagrant uses Virtualbox to install virtual machines:

yum -y install gcc dkms make qt libgomp patch 
yum -y install kernel-headers kernel-devel binutils glibc-headers glibc-devel font-forge

Next add VirtualBox repository:

cd /etc/yum.repo.d/
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

Install the VirtualBox using yum command:

yum install -y VirtualBox-5.1
/sbin/rcvboxdrv setup

Step 3. Installing Vagrant.

First, download the latest version of the vagrant or use following command to install Vagrant 1.8.1 which is latest at the time of this post:

wget https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_x86_64.rpm

Then use the following command to install rpm vagrant package:

yum localinstall vagrant_1.8.1_x86_64.rpm

We can verify the installation by issue command to check the installed version of Vagrant:

vagrant -v

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

How To Install Caddy Web Server on CentOS 7

Caddy Web Server on CentOS 7

KDE is a well-known desktop environment for the Unix-Like systems designed for users who wants to have a nice desktop environment for their machines, It is one of the most used desktop interfaces out there.

Table of Contents

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

Step 2. Installing Caddy web server on CentOS 7.

Step 3. Setting Up Necessary Directories.

Step 4. Installing Caddy as a System Service.

Step 5. Creating Test Web Page and a Caddyfile.

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 KDE Plasma desktop environment on a CentOS 7 server.
Caddy Features

Automatic HTTPS.
Easy Deployment.
Multi-core.
WebSockets.
Rewrites & Redirects.
Virtual Hosts.

Install Caddy Web Server 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 Caddy web server on CentOS 7.

Install Caddy is quick and easy with run the following command:

curl https://getcaddy.com | bash

After the script finishes, you can run the following command to see where is your Caddy’s binary file:

which caddy

Your output should be like below:

/usr/local/bin/caddy

Step 3. Setting Up Necessary Directories.

Next, create the directories where we will store the Caddy configuration file Caddyfile and SSL certificates:

mkdir /etc/caddy
chown -R root:caddy /etc/caddy
touch /etc/caddy/Caddyfile
mkdir /etc/ssl/caddy
chown -R caddy:root /etc/ssl/caddy
chmod 0770 /etc/ssl/caddy
mkdir /var/www
chown caddy:caddy /var/www

Step 4. Installing Caddy as a System Service.

We also need to create a new SystemD configuration script:

cd /etc/systemd/system/
nano caddy.service

Add following line:

[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
Restart=on-failure
StartLimitInterval=86400
StartLimitBurst=5

; User and group the process will run as.
User=caddy
Group=caddy

; Letsencrypt-issued certificates will be written to this directory.
Environment=CADDYPATH=/etc/ssl/caddy

; Always set "-root" to something safe in case it gets forgotten in the Caddyfile.
ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp
ExecReload=/bin/kill -USR1 $MAINPID

; Limit the number of file descriptors; see `man systemd.exec` for more limit settings.
LimitNOFILE=1048576
; Unmodified caddy is not expected to use more than that.
LimitNPROC=64

; Use private /tmp and /var/tmp, which are discarded after caddy stops.
PrivateTmp=true
; Use a minimal /dev
PrivateDevices=true
; Hide /home, /root, and /run/user. Nobody will steal your SSH-keys.
ProtectHome=true
; Make /usr, /boot, /etc and possibly some more folders read-only.
ProtectSystem=full
; … except /etc/ssl/caddy, because we want Letsencrypt-certificates there.
;   This merely retains r/w access rights, it does not add any new. Must still be writable on the host!
ReadWriteDirectories=/etc/ssl/caddy

; The following additional security directives only work with systemd v229 or later.
; They further retrict privileges that can be gained by caddy. Uncomment if you like.
; Note that you may have to add capabilities required by any plugins in use.
;CapabilityBoundingSet=CAP_NET_BIND_SERVICE
;AmbientCapabilities=CAP_NET_BIND_SERVICE
;NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

Set the owner and permissions:

chown root:root /etc/systemd/system/caddy.service
chmod 644 /etc/systemd/system/caddy.service

At last, execute the following commands to enable Caddy to run on boot:

systemctl enable caddy
systemctl start caddy

Step 5. Creating Test Web Page and a Caddyfile.

For testing purposes, we will create a test HTML file:

mkdir -p /var/www/wpcademy.com
echo "Caddy" > /var/www/wpcademy.com/index.html
chown -R www-data: /var/www/my-domain.com

Next, add our domain to the Caddy configuration file:

nano /etc/caddy/Caddyfile

Add following line:

my-domain.com {
    root /var/www/wpcademy.com
}

Save the file and exit the editor. To apply the changes, restart Caddy:

systemctl restart caddy.service

Now, with a web browser, just go to https://wpcademy.com, and you will see our test page!

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

 

How To Install PimCore on CentOS 7

PimCore on CentOS 7

Pimcore is a free and open-source web content management platform for creating and managing web applications and digital presences released under the terms of the BSD Licence. The pimcore platform contains various integrated applications for web content management, product information management, multi-channel publishing, e-commerce and various other marketing-specific applications like digital asset management, marketing management and an integrated behavioral targeting engine for personalizing content.

Table of Contents

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

Step 2. Install LAMP server.

Step 3. Installing PimCore.

Step 4. Configuring MariaDB for Pimcore.

Step 5. Configuring Apache web server for Pimcore.

Step 6. Configuring the ports in firewall for Pimcore.

Step 7. Accessing Pimcore.

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 PimCore CMS on a CentOS 7 server.
Install PimCore 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. Install LAMP server.

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

yum -y install php-gd php-imap php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp curl curl-devel

Step 3. Installing PimCore.

Download the latest stable release of Pimcore to your server:

wget https://www.pimcore.org/download/pimcore-data.zip

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

mkdir /var/www/html/pimcore/
unzip pimcore-data.zip -d /var/www/html/pimcore/

We will need to change some folders permissions:

chown apache:apache -R /var/www/html/pimcore

Step 4. Configuring MariaDB for Pimcore.

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 Pimcore. 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 Pimcore installation:

MariaDB [(none)]> CREATE DATABASE pimcore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON pimcore.* TO 'pimcore'@'localhost' IDENTIFIED BY 'strong_password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Step 5. Configuring Apache web server for Pimcore.

We will create Apache virtual host for your Pimcore website. First create ‘/etc/httpd/conf.d/vhosts.conf’ file with using a text editor of your choice:

nano /etc/httpd/conf.d/vhosts.conf
IncludeOptional vhosts.d/*.conf

Next, create the virtual host:

mkdir /etc/httpd/vhosts.d/
nano /etc/httpd/vhosts.d/yourdomain.com.conf

Add the following lines:

ServerAdmin [email protected]
DocumentRoot "/var/www/html/pimcore/"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

<Directory "/var/www/html/pimcore/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted


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

systemctl restart httpd.service
systemctl enable httpd.service

Step 6. Configuring the ports in firewall for Pimcore.

Modify firewall rules in order to allow access for visitors:

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

Step 7. Accessing Pimcore.

Pimcore 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 Pimcore. Thanks for using this tutorial for installing Pimcore on your CentOS 7 system. For additional help or useful information, we recommend you to check the official Pimcore web site.

How To Install XWiki on CentOS 7

XWiki on CentOS 7

XWiki is a free wiki software platform written in Java. XWiki is an enterprise but open source wiki. It includes WYSIWYG editing, OpenDocument based document import/export, semantic annotations and tagging, and advanced permissions management.

Table of Contents

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

Step 2. Installing Java.

Step 3. Installing XWiki.

Step 4. Start XWiki.

Step 5. Accessing XWiki.

 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 XWiki on a CentOS 7 server.
Install XWiki 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 Java.

Now you will need to install JAVA, run the following command to download the RPM package using the following command:

wget --no-cookies --no-check-certificate --header "Cookie:oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm"

Once you have downloaded the RPM file, you can install the package using following command:

yum localinstall jdk-8u91-linux-x64.rpm

Check if it is successfully installed with the following command:

java -version

Step 3. Installing XWiki.

Run the following commands in Terminal to install XWiki on CentOS 7:

wget http://download.forge.ow2.org/xwiki/xwiki-enterprise-installer-generic-8.4.4-standard.jar

To run the installer, enter the following command:

java -jar xwiki-enterprise-installer-generic-8.4.4-standard.jar

Now, the installer will ask you several questions with a prompt to enter 1 (accept) 2 (quit) 3 (redisplay). Most of the prompts can be answered with 1 (accept).

Step 4. Start XWiki.

To start XWiki, you need to navigate to the directory you chose in the previous step:

cd /usr/local/"XWiki Enterprise 8.4.4"
bash start_xwiki.sh

Step 5. Accessing XWiki.

XWiki will be available on HTTP port 8080 by default. Open your favorite browser and navigate to http://yourdomain.com:8080 or http://server-ip:8080 and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

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

How To Install KernelCare on Your Linux Server

KernelCare on Your Linux Server

KernelCare is fabulous kernel update tool by CloudLinux. We started testing this kernel patch in a few servers and the result has been truly amazing, allowing us to avoid server downtime after kernel updates because of each server reboot we had to apply after the kernel was updated.

Table of Contents

Step 1. Installing Kernelcare.

 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 KernelCare on your Linux server.
Install KernelCare on Your Linux Server

Step 1. Installing Kernelcare.

In order to install KernelCare on a RPM system like CentOS or RHEL, use the following commands:

rpm -i https://downloads.kernelcare.com/kernelcare-latest.x86_64.rpm

To install KernelCare on Debian based system like Debian or Ubuntu run:

wget https://downloads.kernelcare.com/kernelcare-latest.deb
dpkg -i kernelcare-latest.deb

Check the status of the live patching by running:

/usr/bin/kcarectl --info

The software will automatically check for new patches every 24 hours. To update manually, run:

/usr/bin/kcarectl --update

Note: If you haven’t previously licensed KernelCare, this will install a 30 day trial key for you.

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

How To Install Graylog on CentOS 7

Graylog on CentOS 7

Graylog is a free and open source powerful centralized log management tool based on Elasticsearch and MongoDB. Graylog helps you to collect, index and analyze any machine logs centrally.

Table of Contents

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

Step 2. Installing Java.

Step 3. Installing MongoDB.

Step 4. Installing Elasticsearch.

Step 5. Configuring Elasticsearch.

Step 6. Installing Graylog.

Step 7. Accessing Graylog.

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 Graylog on a CentOS 7 server.
Install Graylog 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 Java.

Now you will need to install JAVA, run the following command to download the RPM package using the following command:

wget --no-cookies --no-check-certificate --header "Cookie:oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm"

Once you have downloaded the RPM file, you can install the package using following command:

yum localinstall jdk-8u91-linux-x64.rpm

Check if it is successfully installed with the following command:

java -version

Step 3. Installing MongoDB.

MongoDB is not available in the default CentOS repository. You will need to add the MongoDB repo first:

nano /etc/yum.repos.d/mongodb.repo

Add the following contents:

[mongodb]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc

Install MongoDB by running the following command:

yum install mongodb-org -y

Start the MongoDB service and enable it to start on boot with the following command:

systemctl enable mongod.service
systemctl start mongod.service

Step 4. Installing Elasticsearch.

In order to install Elasticsearch using the official repository, we have to download and install the public signing key:

rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch

Create and add the following in your /etc/yum.repos.d/ director:

nano /etc/yum.repos.d/elasticsearch.repo

Add the following contents:

[elasticsearch-2.x]
name=Elasticsearch repository for 2.x packages
baseurl=https://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1

Now, install Elasticsearch using the follwing command:

yum install elasticsearch -y

Start the elasticsearch service and enable it to start on boot time with the following command:

systemctl enable elasticsearch.service
systemctl start elasticsearch.service

Step 5. Configuring Elasticsearch.

First, open up the Elasticsearch configuration file:

nano /etc/elasticsearch/elasticsearch.yml

Change the file as shown below:

cluster.name: graylog

Let’s prevent possible remote code executions. Add the following lines:

script.inline: false
script.indexed: false
script.file: false

Restart the elasticsearch service:

systemctl restart elasticsearch.service

Check the health of the Elasticsearch with the following command:

curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'

Step 6. Installing Graylog.

We need to download and install the Graylog repository using the following command:

rpm -Uvh https://packages.graylog2.org/repo/packages/graylog-2.2-repository_latest.rpm

Install Graylog server using yum:

yum install graylog-server -y

After you have installed the Graylog Server, you have to generate secret key for Graylog using the following command:

### pwgen -N 1 -s 96 
MTtPFSMZxAvoLsUiXXauggyJ761hwkGn1ZTN2ovb8wN2tO1LzyeNbaatOrpLukp96p0MxwHQosmMGPbmw46ojnnSORVvr2

Now create a hash password for the root user that can be used to log in to the Graylog web server using the following command:

### echo -n Password | sha256sum
e7cf3ef4f17c3999a94f2c6f612e8bmwe46b1026878e4e19398b23bd38ec221a
1
2
	
### echo -n Password | sha256sum
e7cf3ef4f17c3999a94f2c6f612e8bmwe46b1026878e4e19398b23bd38ec221a

Edit the server.conf file:

nano /etc/graylog/server/server.conf

Make changes to the file as shown below:

password_secret= MTtPFSMZxAvoLsUiXXauggyJ761hwkGn1ZTN2ovb8wN2tO1LzyeNbaatOrpLukp96p0MxwHQosmMGPborm1YRojnnSORVvr2
root_password_sha2= e7cf3ef4f17c3999a94f2c6f612e8a888e5b10268bmwe4619398b23bd38ec221a
[email protected]
root_timezone=UTC
elasticsearch_discovery_zen_ping_unicast_hosts = ipaddress:9300
elasticsearch_shards=1
script.inline: false
script.indexed: false
script.file: false

To enable the Graylog web interface, make changes to the file as shown below:

rest_listen_uri = http://your-server-ip:12900/
web_listen_uri = http://your-server-ip:9000/

After you have modified the configuration file, you can start Graylog Service using the following commands:

systemctl enable graylog-server.service
systemctl start graylog-server.service

Step 7. Accessing Graylog.

Graylog will be available on HTTP port 8080 by default. Open your favorite browser and navigate to http://yourdomain.com:9000 or http://server-ip:9000 and complete the required the steps to finish the installation.
Installing-Graylog-LoginScreen
Congratulation’s! You have successfully installed Graylog. Thanks for using this tutorial for installing Graylog in CentOS 7 system. For additional help or useful information, we recommend you to check the official Graylog web site.

How To Install Foxit Reader on CentOS 7

Foxit Reader on CentOS 7

Foxit PDF Reader can be used to view, create, edit, organize, sign, scan, and OCR. It can easily export PDF files to office, PDF/A/E/X, and more. Users can collaborate, share, sign, protect, and secure documents using Foxit Reader.

Table of Contents

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

Step 2. Installing Foxit PDF Reader.

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 Foxit Reader on a CentOS 7 server.
Install Foxit Reader 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 Foxit PDF Reader.

First download the installer file according to your system requirement. Use below link to download Foxit installer:

wget http://cdn01.foxitsoftware.com/pub/foxit/reader/desktop/linux/1.x/1.1/en_us/FoxitReader1.10.0225_Server_x64_enu_Setup.run.tar.gz

Unpack the Foxit PDF Reader archive to the document root directory on your server:

tar -xvf FoxitReader1.10.0225_Server_x64_enu_Setup.run.tar.gz

Next run the following command to start the setup process of Foxit Reader:

./FoxitReader.enu.setup.1.1.0.0225(r205262).x64.run

The installation wizard is completed and to start running the application, type the FoxitReader command in the terminal and hit enter:

FoxitReader

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