Establish Connection between MySQL and Apache in a Containerized Web Application

This blog is the continuation of the previous blog of build a Containerized Web Application on Azure (Click here to read the previous blog) . In this blog, we will establish a connection between mysql-container and apache-container.

Now watch those containers with this command:

watch 'sudo docker ps -a'

If mysql-container stops then restart it using following command:

sudo docker start mysql-container

Open the mysql-container shell using the following command and check the status of the mySQL service.

sudo docker exec -it mysql-container bash
service mysql status

If MySQL service is not running then start it using the following command:

service mysql start

We have installed the network tools in the apache-container. Now install the network tools in the mysql-container.

apt install inetutils-ping net-tools -y

Checking Connection

Check network cards in the mysql-container.

ifconfig

And note down the IPaddress of the mysql-container and exit from this container and move to host machine. In my case, It is 172.17.0.2.

Read More »

Build a Containerized Web Application on Azure

In this blog, I am going to setup MySQL server in one container and apache2 in other container and If you are not familiar with Docker, read my this blog first(Click here to read the blog). Moreover, this all will be done on Azure virtual machine, If you are not familiar with Azure virtual machine, please read my this blog first to create the virtual machine on Azure(Click here to read the blog).

Setting Up Docker

To install Docker, use the following command:

sudo apt install docker.io

To start docker, command is given below:

sudo systemctl start docker

To start docker, when you start the ubuntu use this command:

sudo systemctl enable docker

To view current images, use the following command:

sudo docker images

To pull images, use the following command:

sudo docker pull ubuntu

Creating MySQL Container

We have already downloaded the ubuntu images. Now using this ubuntu image we will create the container and named it mysql-container. Because we are going to install MySQL database in it.

sudo docker run --name mysql-container -it ubuntu

Now you are in mysql-container, execute the following comand to set the environment and install the vim for editing.

apt update
apt install vim -y
exit

If you want to see which container in running on your host machine use this command:

Read More »

Flask Website Deployment using Docker Compose on Azure Cloud

In this blog, I will deploy FLASK app on nginx using Docker Compose. If you don’t have any idea how Docker Compose works, read my previous blog first (Click here to read the previous blog).
Before we move to work, I will give you brief intro the things which I am going to use. I created a virtual machine on Azure Cloud Platform. If you don’t know, how to create virtual machine on Azure, go to my this blog create virtual machine easily with few simple steps (Click here to read the blog).
After creating virtual machine just ssh into your machine using simple command.

ssh halcyoona@40.114.31.5

Installation

To install Docker the in your virtual machine, type the command in terminal and press enter:

sudo apt install docker.io
sudo apt install docker-compose

Create a directory with the name of your app, like I am creating my_flask_app.

mkdir my_flask_app
cd my_flask_app

In this floder create two more directory with the nginx and flask. Nginx is entry point of the app, where we get request and then we redirect those request to flask app.

mkdir flask
mkdir nginx

Flask App Setting

Now move into flask directory and create python virtual environment but first install package that is required to create the virtual environment i.e venv first then create virtual environment using following command:

cd flask
sudo apt install python3-venv
python3 -m venv env

Now activate the environment with the simple command:

soure env/bin/activate

And then install flask and uwsgi.

pip install flask uwsgi

flask package is used to create the applications.
uwsgi is a Web Server Gateway Interface used to communicate to nginx server.

Read More »

Module Development In Odoo

In this blog, I will tell you about how to develop your own module in Odoo.

Creating Directory:

Create a directory to place your newly developed application using the following command :

 mkdir myaddons

Add this directory to your odoo configuration file (odoo.conf) so that the odoo server can detect all the applications within this directory.

sudo subl /etc/odoo/odoo.conf

Edit the addons_path variable by adding the full path of the new directory preceded by a comma ( , ) as shown below:

addons_path = /usr/lib/python3/dist-packages/odoo/addons

Configuration:

The odoo.conf file would look like this:

[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /usr/lib/python3/dist-packages/odoo/addons,/home/halcyoona/myaddons

Create the skeleton for your new Application using the command below ! I am calling this application: myconferences.

odoo scaffold myconferences

Read More »

Odoo Installation

Hello everyone,Below you will find the easiest installation guide of odoo 11.Let’s start.

odoo.jpeg

First you run these two command:

sudo apt update
sudo apt upgrade

Python dependencies:

Then install python3-pip using following command:

sudo apt-get install python3-pip

Then install the python  dependencies for Odoo 11 using pip3:

pip3 install Babel decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycogreen psycopg2 pydot pyparsing PyPDF2 pyserial python-dateutil python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrd

Read More »

WordPress Installation

In this blog, I will show you how to develop WordPress on your localhost and start working with WordPress.

Basic tool Installation

First you have to install MySQL, Apache and PHP. The following command install the apache2, MySQL-Server  and  PHP in your system.

sudo apt-get install apache2 mysql-server php libapache2-mod-php

Then you need to check packages are working as your desire.

For apache2, run the following commands to ensure that mod_rewrite is enabled:

sudo a2enmod status

If it isn’t already enabled, enable a2enmod and restart Apache:

sudo a2enmod rewrite
sudo systemctl restart apache2

DataBase Creation

Log in to the MySQL command line as the root user:

sudo mysql -u root

Create wordpress database:

CREATE DATABASE wordpress;

Read More »