Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Install apache using Ubuntu package manager.

Once the installation is finished you need to allow the http traffic through firewall. Here UFW is different
application profile. Which can be help to allow the application traffic pass through the firewall.

To list all currently available UFW application profiles.


You can verify the changes with:

The configuration files of apache2 are located in  /etc/apache2 directory and main configuration are
located in  /etc/apache2/apache2.conf and the default document root for starting your web files is
 /var/www/html

You can confirm the apache2 service are up and enabled on boot using the following commands.

In order to remove the package from Ubuntu Server use the following command.

 sudo apt-get remove --purge mysql*

Now installing maria DB database on Ubuntu Server.

The mariaDB Configuration file are located in /etc/mysql directory

Now confirm that the mariaDB database services are up and enabled at boot.
On Production servers you need to enable some security measures for mariaDB database installation by
running the below command.

To access the mariaDB from shell run the below commands.

 Sudo mysql –u rot –p


Installing PHP in Ubuntu

To install PHP on Ubuntu 20.04 run the below commands.

PHP Configuration files will be located in :

 /etc/php/7.4/

In order to install the PHP extension required by the application use the following command.

To install the required php extensions use the below commands.

After installing the php extension you need to restart the apache server to do so, use the below
command.

To test if apache is working in conjunction with php. Create info.php page under Web document root.

 /var/www/html/info.php
Installing PHPmyadmin in Ubuntu 20.04

To install the phpmyadmin use the following command

Once the installation process is complete, the configuration files of phpmyadmin is located in

 /etc/phpmyadmin/
 /etc/phpmyadmin/config.inc.php (main configuration file)
 /etc/phpmyadmin/apache.conf (another main configuration file)

Next we need to configure the apache2 server to server the phpmyadmin dashboard.

Run the following command to syslink the file /etc/phpmyadmin/apache.conf to /etc/apache2/conf-


available/phpmyadmin.conf

Then enable the phpmyadmin.conf configuration files for Apache2 and restart the Apache2 service to
apply the recent changes.
 sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-
available/phpmyadmin.conf
 sudo a2enconf phpmyadmin.conf
 sudo systemctl reload apache2.service

Note: In MySQL 5.7 (released Oct 2015) and MySQL 8, the root MySQL user is set to authenticate using
the auth_socket or caching_sha2_password plugin rather than with mysql_native_password. This will
prevent programs like phpMyAdmin from logging in with the root account.

 Create a new super user for phpmyadmin


 sudo mysql -u root –p
 CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';
 GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
 FLUSH PRIVILEGES;

Now open the  sudo vim /etc/phpmyadmin/config-db.php and change the username and
password of new super user
Flask python virtual environment.

In Windows

Install the Python and VSC in Windows

Now Open the command prompt and create a directory called my_proj

Type the following commands to create a virtual environment in windows.

 Open the command prompt Run  cmd

 Go to the directory named “my_proj”


 Run the command py –m venv venv
 C:\my_proj>venv\Scripts\activate

Now Virtual Environment has been activated. After that install the Flask development environment
in this virtual environment. Follow the below commands.

 C:\my_proj>pip3 install flask

Step 1 Install python on Ubuntu 20.04

 sudo apt update


 sudo apt install software-properties-common
 sudo add-apt-repository ppa:deadsnakes/ppa
 sudo apt install python3.9
 sudo apt install python3-venv

Now Create a working directory where you want to install the virtual environment.

 Mkdir my_proj
 Cd my_proj
 python@ubuntu:~/my_proj$ python3 -m venv venv

Now activate the virtual environment

 python@ubuntu:~/my_proj$ source venv/bin/activate


 (venv) python@ubuntu:~/my_proj$ pip3 install flask

You might also like