How to Install Python 3.6 and Django with Apache (mod_wsgi)

Submitted by aknnn on Wed, 10/10/2018 - 00:43

Today we're going to Install Python 3.6, Django and MariaDB on CentOS 7 and make Apache to serve our Django site using mod_wsgi.
We are setting Apache to use virtual environment so that you can serve multiple sites with your single Apache instance.

First we need to install Python 3.6.
As you might know. CentOS 7 doesn't officially support Python 3 versions, so we need a little workaround.

In this tutorial we are using the popular IUS repository to install Python and some relevant packages.

How to install PHP 7.2, MariaDB and Drupal 8 on CentOS 7

Submitted by aknnn on Sun, 10/07/2018 - 11:14

Install PHP 7.2 from Remi repository

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-config-manager
yum-config-manager --enable-remi-php72
yum update
yum install php
yum install php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc
yum install php-opcache php-mysql php-pdo

Configuring Django and MariaDB on CentOS 7

Submitted by aknnn on Mon, 10/01/2018 - 01:07

This tutorial will demonstrate how to install Django and MariaDB on CentOS 7

Preferably inside virtual environment execute:
pip3 install django

MariaDB is needed (If you want, you can use mysql instead)
for this you need to enable MariaDB repos.

Inside /etc/yum.repos.d/ create file MariaDB.repo with contents:

name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey = http://yum.madiadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1

Installing Python 3.7 on CentOS 7 (Python 3.7 not yet available on official repos)

Submitted by aknnn on Sun, 09/30/2018 - 21:26

At the time of writing this, Python 3.7 wasn't available on official repos so the installation process is a bit more nuanced. Still easy enough for beginners.
I would recommend you to login as root to do this since it makes it lot easier. Atleast for me it did.

Install all needed packages:
yum install libffi-devel zlib-devel openssl openssl-devel

yum groupinstall development

Make new directory somewhere for installation files and cd into that directory. You can remove this directory after installation is complete.

Customized ssh login message

Submitted by aknnn on Sat, 09/29/2018 - 17:59

Sometimes you may wan't to display customized welcome message when logging in to server via ssh.

I'm going to show you how you can do it with CentOS 7.

First open the file /etc/ssh/sshd_config and add this line to it:
PrintMotd no
This will disable the default message printed on login and let's you print your own.

Next you wan't to make your own customized message. This is done by creating a file in the folder named /etc/profile.d
It doesn't matter how you name the file, altought the extension must be .sh
I named mine login_message.sh