You are on page 1of 49

PROJECT

REPORT

SUPERVISED BY :
NOUREDDINE MOTAKI

PRODUCED BY :
CHAKKAF ATIKA
CHERKAOUI MONSEF
BOUAMRAOUI ILYAS
BOUAJAJ BADR
Ilyas Bouamraoui
Monsef Cherkaoui

Badr Bo

Atika Chakkaf Badr Bouajaj


Table of contents :

➢ Introduction

➢ Chapter 1: Installation of ODOO in Google cloud


platform GCP.

➢ Chapter 2: Creating and hosting a static site.

➢ Chapter 3 : Creating and hosting a dynamic website

➢ Conclusion

➢ Table of Dependencies
INTRODUCTION

In the context of the web technology course, we completed three important projects. The
first project involved the successful installation and configuration of ODOO 8 in the Google
Cloud Platform (GCP) by creating a virtual machine using Ubuntu OS 20.04.

The second project focused on creating and hosting a static website containing group
members' photos with their names below each photo, serving as a link to another page
featuring their individual photos.

The third project revolved around establishing a dynamic website using WordPress and
hosting it in a virtual environment.

Each stage of these projects required meticulous planning, rigorous testing, and technical
adjustments to ensure smooth integration within the virtual environment. In this report, we
will detail step-by-step the various phases of their implementation, the challenges
encountered, and the solutions provided throughout these processes, highlighting the best
practices adopted to ensure the proper functioning of each element.
CHAPTER 1
INSTALLATION OF ODOO
8 IN GOOGLE CLOUD
PLATEFORM GCP
To install ODOO in GCP you need to follow a few simple steps:
✓ Step 1 : Enter Google cloud Platform
✓ Step 2 : Create an account with your own card so that you can benefit from the 300
dollars for free that will be sufficient for these projects.
 Note : Don't click on an Activate button so they can't access your balance when the
$300 runs out.
✓ Step3 : Create a virtual machine instance by following these instructions :

To create a virtual machine (VM) instance using Ubuntu OS 20.04 on Google Cloud Platform
(GCP), you can follow these steps :

• Click on Console.
• In the left-hand navigation pane, click on "Compute Engine" choose VM instances
• Create a new VM instance :
o Click the "Create instance " button to create a new VM instance.
• Configure the VM instance:
o Name : Provide a name for your VM instance.
o Region and Zone : Choose the region and zone where you want to
deploy your VM .In our case ,if you want you can leave it as default .
o Machine configuration : choose General purpose , clic on E2 fron series.
o Machine type: here we Select the desired machine type ,
choose e2-medium(2vCPU,1core,4 GB memory).
o Boot disk: Click on "Change" and select "Ubuntu" as the operating
system. Choose the version Ubuntu 20.04LTS, and you can select the
boot disk type standard or SSD it's better to choose SSD, and about size
you can choose any size you want 10GB it's good.
o Identity and API access: You can set up service account permissions if
needed but in our case just allow default access .
o Configure the firewall : Under the "Firewall" section choose to allow
HTTP and HTTPS traffic by checking the respective boxes.

these protocols are fundamental for web services and applications that

need to communicate over the internet.

Allowing HTTP traffic means that the VM will be able to receive and

respond to regular unencrypted web requests.

This is suitable for websites or applications where security and

encryption aren't a primary concern.

On the other hand, enabling HTTPS traffic allows for encrypted

communication between clients (such as web browsers) and our VM.

HTTPS is crucial for security-sensitive websites or applications

where data privacy and integrity are essential. It uses SSL/TLS

certificates to encrypt data, ensuring that sensitive information

remains secure during transmission.

After configuring the necessary settings:

✓ Step 4 : click the "Create" button at the bottom of the page.

✓ Step 5 : Connect to your VM instance


Once your VM instance is created, you can connect to it using SSH.

You can click the "SSH" button next to your VM instance in the Google Cloud Console.

Clicking on SSH allows you to establish a secure shell connection directly to the VM. It's a
convenient way to access the command line interface of the VM for configuration,
management, and execution of commands.

Now we move on to install odoo 8 using line commands , you should copy and paste order by
order.

 Note : Ubuntu is built upon the Linux kernel.

Now, now enter these commands on SSH


Commands for installing odoo 8 :

System update

sudo apt update &&


sudo apt dist-upgrade

These commands are used in Debian-based systems like Ubuntu, in our case, to update the
system and install the latest available software versions.

• sudo apt update: This command updates the list of packages available in the
repositories configured on your system. It checks for new versions of software without
actually installing them.
• sudo apt dist-upgrade: This command upgrades all installed packages on the system
to their latest versions. It considers new dependencies and can remove certain obsolete
packages if they interfere with the update.

Creating the odoo8 user

sudo useradd -m -d /opt/odoo8 -U -r -s /bin/bash odoo8

This command creates a new user named "odoo8" with specific attributes:

• sudo: Executes the command with administrative privileges.


• useradd: Command to create a new user.
• -m: Creates a home directory for the user if it doesn't exist.
• -d /opt/odoo8: Specifies the home directory for the user as /opt/odoo8.
• -U: Creates a group with the same name as the user.
• -r: Creates a system user, which is used for running services and daemons.
• -s /bin/bash: Sets the default shell for the user as /bin/bash.
• odoo8: The username being created.

Database server installation,Postgresql


Installing Postgresql without myVesta

sudo apt install postgresql -y

This command installs PostgreSQL using the package manager apt with administrative
privileges (sudo). Here's a breakdown:

• sudo: Executes the command with administrative/root privileges.


• apt: Package management command on Debian-based systems like Ubuntu.
• install postgresql: Instructs apt to install the PostgreSQL database system.
• -y: Automatically answers "yes" to prompts, allowing the installation to proceed
without manual confirmation.

So, this command will install PostgreSQL on the system without requiring manual
confirmation for the installation process.

sudo su - postgres -c "createuser -s odoo8" 2> /dev/null || true

This command utilizes sudo to switch to the user postgres and execute a command within
that user's environment:

• sudo su - postgres: Switches to the postgres user account.


• -c "createuser -s odoo8": Executes the command createuser -s odoo8 within the
postgres user context. This command creates a PostgreSQL user with the name odoo8
and grants it superuser privileges (-s flag).
• 2> /dev/null: Redirects error messages (stderr) to /dev/null, essentially suppressing
error output.
• || true: This construction allows the command to continue executing even if there is an
error, ensuring that the command doesn't stop the script's execution flow.

Overall, this command is creating a PostgreSQL user named odoo8 with superuser privileges
within the postgres user environment. Any errors from this command are suppressed, allowing
the script to proced without interruptions in case of failure.

Installation de WKHTMLTOPDF
To export PDFs, you need to install a speciOc program: WKHTMLTOPDF

• Download GitHub.Wkhtmltopdf from

sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-


1/wkhtmltox_0.12.6-1.bionic_amd64.deb

• Install Wkhtmltopdf

sudo apt install ./wkhtmltox_0.12.6-1.bionic_amd64.deb -y

Installing Python 2.7 and pip2 on Ubuntu 20.04


sudo add-apt-repository universe

• The command sudo add-apt-repository universe is used on Ubuntu systems to add


the "universe" software component to the package sources managed by apt.

sudo apt update &&


sudo apt install python2 -y
These commands accomplish the following:

• sudo apt update: This command updates the list of available packages and their
versions. It fetches information about the latest versions of packages from the
repositories configured on your Ubuntu system.
• sudo apt install python2 -y: This command attempts to install Python 2 on your
system. However, as of Ubuntu 20.04 and later versions, Python 2 has been deprecated
and is not available in the default repositories. If you're using an older version where
Python 2 is still available, this command will install Python 2 without prompting for
confirmation (-y flag automatically confirms installation prompts).

→ Then use curl to download the get-pip.py script and install pip2 to retrieve the
necessary the libraries required for Odoo.
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py &&
sudo python2 get-pip.py

→ Check that pip2 has been installed correctly with the command

pip2 --version

→ The answer must be :

pip 20.3.4 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

Installing the Odoo server


→ Create the logs folder

sudo mkdir -p /var/log/odoo8/ && sudo chown odoo8:odoo8 -R /var/log/odoo8


• sudo mkdir -p /var/log/odoo8/ :This command creates a new directory named odoo8
inside /var/log.
• sudo chown odoo8: -R /var/log/odoo8/: This command changes the ownership
(chown) of the /var/log/odoo8/ directory and its contents (-R for recursive) to the user
odoo8 and the default group of odoo8 (as no group is specified after the colon). The
sudo command is used to execute these commands with administrative privileges.

→ Then install Git

Git is a powerful and essential tool for modern software development, offering efficient version
control, collaboration, and management of codebases for projects of all sizes.

sudo apt install git -y


Executing this command installs Git on your system, allowing you to use Git commands to
manage version control for your projects.

→ Change bash user to odoo8

sudo su - odoo8

→ Install the necessary Python libraries using requirements.txt


pip2 install cups dateutils decorator feedparser gdata jinja2 \
mako mock passlib gevent pydot pyparsing reportlab requests \
simplejson unicodecsv unittest2 vatnumber vobject werkzeug xlwt babel \
decorator netplan image unittest2 reportlab mako Python-Chart pytz \
lxml psycopg2-binary pyyaml unittest2 python-chart psutil \
requests simplejson docutils python-openid pyPdf psycogreen html2text &&
pip2 install passlib==1.6.5 &&
pip2 install werkzeug==0.9.6

 Note: select all commands and execute them simultaneously


→ Clone the Odoo 8 branch (install it in /opt/odoo8)

mkdir /opt/odoo8/odoo-server &&


cd /opt/odoo8/odoo-server &&
git clone https://www.github.com/odoo/odoo --depth 1 --branch 8.0 --single-branch

These commands create a directory structure for the Odoo server and clone the specific 8.0
branch of the Odoo repository from GitHub into the odoo-server directory with only the latest
commit from that branch.

Odoo configuration

cp /opt/odoo8/odoo-server/odoo/debian/openerp-server.conf odoo-server.conf &&


chown odoo8: odoo-server.conf &&
chmod 640 odoo-server.conf

These commands perform the following actions:

• cp debian/openerp-server.conf odoo-server.conf: Copies the openerp-server.conf


file from the debian directory and renames it to odoo-server.conf. This creates a
duplicate of the configuration file.
• chown odoo8: odoo-server.conf: Changes the owner and group of the odoo-
server.conf file to both be odoo8. This determines who has specific rights over this
file.
• chmod 640 odoo-server.conf: Sets the permissions of the odoo-server.conf file to
640, which means the user (odoo8) has read and write permissions on the file, but
other users only have read permissions.

→ Edit the configuration file and change the lines as follows

nano odoo-server.conf
• This command opens the odoo-server.conf file in the nano text editor, allowing you to
view and modify its contents.

[options]
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo8
db_password = False
addons_path = /opt/odoo8/odoo-server/addons
logfile = /var/log/odoo8/odoo-server.log

 admin_passwd is Odoo's main (admin) password (for managing databases)


 click ctrl+o to register and Enter ,Ctrl +X to get out

Installer le script de démarrage


→ Quit the odoo8 user

exit
→ Then edit the systemctl configuration file

sudo nano /etc/systemd/system/odoo8.service


This command opens the odoo8.service file for editing using the nano text editor with
administrative privileges (sudo). The file is located in the /etc/systemd/system/ directory.

Editing this file allows you to define and configure a systemd service named odoo8. Systemd
services are used to manage processes in modern Linux distributions like Ubuntu. This
particular service is likely related to the Odoo 8 application and defines how it should be
managed by the system, including startup, shutdown, and other behaviors.

→ Edit the configuration file and change the lines as follows


[Unit]
Description=Odoo 8 startup script
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo8
PermissionsStartOnly=true
User=odoo8
Group=odoo8
ExecStart=python2 /opt/odoo8/odoo-server/odoo/openerp-server -c
/opt/odoo8/odoo-server/odoo/openerp-server.conf
ExecStop=/bin/kill $MAINPID
ExecStop=/bin/kill $MAINPID
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target

 click ctrl+o to register and Enter ,Ctrl +X to get out

→ Then start the service and run it on startup

sudo systemctl daemon-reload &&


sudo systemctl start odoo8.service &&
sudo systemctl enable odoo8

→ We check the state of the system

sudo systemctl status odoo8

→ The output should look something like below, showing that the service Odoo service is
active and running:
● odoo8.service - Odoo 8 startup script
Loaded: loaded (/etc/systemd/system/odoo8.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-05-15 12:12:12 UTC; 1min 33s ago

 These commands work without any problem but if in the last step ,you find that odoo
is not active like in the picture when it seems that the specified configuration file
(openerp-server.conf) does not exist in the specified location (/opt/odoo8/odoo-
server/odoo/).

To solve this problem, you can :

Create a configuration file :


If the configuration file doesn't exist, you can create a new configuration file for Odoo. Use
your favorite text editor to create an openerp-server.conf file:

sudo nano /opt/odoo8/odoo-server/odoo/openerp-server.conf

Inside this file, you'll need to specify the configuration parameters required for Odoo. Make
sure you fill in the appropriate values for your Odoo configuration :
[Unit]
Description=Odoo 8 startup script
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo8
PermissionsStartOnly=true
User=odoo8
Group=odoo8
ExecStart=python2 /opt/odoo8/odoo-server/odoo/openerp-server -c
/opt/odoo8/odoo-server/odoo/openerp-server.conf
ExecStop=/bin/kill $MAINPID
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Check file permissions :

After creating the configuration file, make sure that the odoo8 user has the necessary
permissions to access this file. You can use the chown command to change the owner of the
file in case it is not properly configured:

sudo chown odoo8:odoo8 /opt/odoo8/odoo-server/odoo/openerp-server.conf

Restarting the Odoo 8 service :


Use the following command to restart the Odoo 8 service:
sudo systemctl restart odoo8

Checking service status :


To check that the Odoo 8 service is starting correctly, use the command :
sudo systemctl status odoo8

 Finnally,the problem will be solved and you will get this :

→ Move to the final step when you shoud edit GCP firewall :

Edit GCP firewall setting


In google cloud plateform space ,followed the path :
VPC Network ->Firewall-> create firewall rule .
Then create a noun for the firewall rule, For logs click « ON »,for direction of trrafic
click on « Ingress » , for Action on match click on « Allow » ,For targets choose :
« Specified target tags » ,and write the name of your firewall in target tags , switched
the version IP4 ranges, and for the source filter write 0.0.0.0/0,on TCP write the
port 8069
Once that saves ,go back to the VM instances page , choose your instance click Edit
go to Network tags and add the name of firewall that you created .
Finally ,

The interface is accessed via the URL

http://IP_de_votre_serveur:8069

The port number 8069 is the default port used by Odoo for its web interface. It's the standard
configuration set by default when running Odoo.

 You will see this interface :

 If you create a database, you will see this interface :


CHAPTER 2
CREATING AND HOSTING
A STATIC SITE
Welcome to this exploration of the fascinating world of creating and hosting static
website.

Today, we'll navigate through three key tools that combine to bring your online presence to
life: Microsoft FrontPage, FileZilla, and PuTTY.

Imagine FrontPage as your virtual workshop where ideas and elements of your website come
to life. It's where you give shape to your vision, design your pages, and structure your content.

But once your creation takes form, it's time to take it beyond your personal computer. That's
where FileZilla comes into play, acting as a messenger that transports your files from the
local to the global. With FileZilla, the process of transferring your website to a remote server
becomes smooth and accessible.

But what happens once your site is on that remote server? , Enter PuTTY, and acts as the
virtual key that opens the door to your server, allowing you to manage and configure your site
remotely.

So the fondamental question is HOW TO USE THIS TOOLS TO CREATE AND HOST A
STATIC WEBSITE ?

That’s what we will explain in this following steps :

STEP 1 :

• Installing Microsoft FrontPage (link)

It allows us to visually design web pages without having to write HTML code
manually (WYSIWYG).

• Install PuTTY (link)


It is an open-source client software used to access remote systems.
• Install FileZilla (link)

It is an open-source FTP (File Transfer Protocol) client software. It provides a user-friendly


interface and enables file transfer between a local computer and a remote server via FTP.

STEP 2 :

In this step you should install Apache2


What is apach 2 ?

Apache2, often simply referred to as Apache, is one of the most popular and widely used web
servers in the world.

How to install apache ?

To install Apache2 on a Google Cloud Platform (GCP) instance, you can follow these
general steps. Make sure you have already created a GCP instance and have an established
SSH connection to that instance

• Use the GCP web console : Log in to the Google Cloud Console
• Click on the instance you created: Navigate to the "Compute Engine" section in the
console. Under "VM instances," you will see a list of instances. Click on the specific
instance you want to access.
• Click on the "SSH" button then authorize
• Update system packages: Enter the following command to update the list of available
packages on your system : « sudo apt update »
• Install Apache2:After the update, enter the following command to install Apache2:
« sudo apt install apache2 »
• Check Apache2 installation:To verify that Apache2 is properly installed, you can
enter the IP address of your instance into the Google search bar or a web browser. If
Apache2 is successfully installed, you should see the default Apache page.
STEP 3 :
Start by creating a folder on your desktop and naming it. Within this main folder, establish a
subfolder with a distinct name. Open Microsoft FrontPage to create new pages, giving you the
option to start with blank pages or predefined templates. FrontPage simplifies the process of
inserting elements like images, tables, forms, and hyperlinks. Managing hyperlinks is
straightforward, allowing you to effortlessly add and organize links to other pages, websites,
or files. The Inserting and Editing Images feature in FrontPage makes it easy to embed images
into your pages, offering functionalities to resize, align, and apply various visual effects for an
enhanced presentation.

STEP 4 :
PuTTY Key Generator, also known as PuTTYgen, is a tool included in the PuTTY software
package. Its primary role is to generate pairs of public and private keys for use in secure
communication systems, such as SSH (Secure Shell).

HOW ?
• Launch PuTTYgen: After installation, launch PuTTYgen.
• Click "Generate": Click the "Generate" button to start the key pair generation
process.
• Generate Entropy: While PuTTYgen generates the key, it will prompt you to
generate entropy by moving the mouse within the indicated area . This enhances the
random quality of the generated key
• Add a Passphrase (Optional): You have the option to add a passphrase to protect
your private key. Enter and confirm the passphrase if you choose to add one.
• Save Private Key: Once the key is generated, it will be displayed on the screen.
Choose a location and filename to save the private key (.ppk).
• AND CONGRATS You have successfully generated a public and private key pair
using PuTTYgen.
• Next step :
In PuTTYgen, copy the public key from the text area under the header "Public key for
pasting into OpenSSH authorized_keys file." Select the entire public key and copy it.
• Access the GCP Console:Log in to the Google Cloud Console.
• Navigate to the "VM instances" Section:In the navigation pane, click on "Compute
Engine" and then "VM instances."
• Click on the name of the instance to which you want to add the SSH key (wich
contain apache2)
• Click "Edit"
• Add the SSH Public Key :Scroll down to the "SSH Keys" section. Paste your SSH
public key into the corresponding field.
• Save Changes :Click "Save" to save the changes to the instance configuration.

STEP 5 :
• Open FileZilla :Launch FileZilla after installation.
• Open Site Manager: In the top toolbar, click on the "Open the Site Manager" icon or
go to "File" > "Site Manager."
• Add a New Site:In the Site Manager, click on the "New Site" button.
• Name the Site:Give a name to your new site in the "My Sites" field
• Configure Connection Settings: In the "General" tab, configure the connection
settings:

Host: Enter the IP address of your GCP instance.(wich contain apache2 install)

Port: Leave it blank

Protocol: Choose the protocol SFTP

Authentication Type: Choose "Key File" in the "Authentication Type"

Username: This is the username using in key comment in puttygen

Key File: copy the private key file (.ppk) that you generated with PuTTYgen.
• Click on conexion and add the password added in puttygen

STEP 6 :
• Open putty : launch putty after installation
• Enter the IP Address in PuTTY: When you launch PuTTY, it prompts you for the IP
address of the remote server you want to connect to. You enter the IP address of your
Google Cloud Platform (GCP) instance
• Select the SSH Protocol: After entering the IP address, you choose the connection
protocol. SSH (Secure Shell) then Authentication then Credentials then copy the
private key file (.ppk) that you generated with PuTTYgen. In « private key file for
authentication »
• Click on session then open
• enter the username and the password added in puttygen

and enter this commands :

cd /var/www/html : Changes the current working directory to "/var/www/html."

Ls : Lists the contents of the current directory ("/var/www/html").

cd .. : Moves up one level to the parent directory.

sudo chown -R username html/ : Recursively changes the ownership of all files and
directories under "html" to the specified username. Replace "username" with the actual
username.

sudo chmod 755 html/ : Changes the permissions of the "html" directory to give the
owner read, write, and execute permissions, and read and execute permissions to others.

« replace the username with the one using in puttygen and fillezilla »
STEP 7 :
Move the folder which contain you static website in file html using filezilla ( don’t
forget to name the principal page index)

FINALLY YOU CREATE AND HOST A STATIC WEBSITE


CHAPTER 3
CREATING AND HOSTING
A DYNAMIC WEBSITE
The development and hosting of dynamic websites are essential elements for
delivering interactive and engaging user experiences. In this chapter, we will explore the
creation of a dynamic website using the power of Google Cloud Platform (GCP), the
FileZilla FTP client for file transfer, and the WordPress content management platform.

The integration of these tools provides a comprehensive solution, ranging from setting
up the infrastructure on GCP to customizing content with WordPress. The combination
of the flexibility of GCP, the efficiency of FileZilla for file transfer, and the versatility of
WordPress for content management allows developers to create dynamic websites that
meet modern requirements for interactivity, security, and scalability.

Throughout this chapter, we will explore the various steps of configuration and
installation, emphasizing how these tools interact to create an environment conducive to
dynamic web development. From security considerations to performance optimization,
this chapter will lay the groundwork for creating a dynamic website, providing readers
with an in-depth perspective on the successful integration of GCP, FileZilla, and
WordPress in a modern web development project.

Installing Apache2, MySQL, PHP, and phpMyAdmin on Google Cloud Platform (GCP)
is often necessary to create an environment conducive to the development and hosting of
web applications, including dynamic sites built with technologies like WordPress. Here's
why each component is important:

❖ Apache2 (or Nginx):

➢ Web Server: Apache2 is a popular web server that serves static and dynamic web
pages. It plays a crucial role in hosting your website and handling HTTP requests.
❖ MySQL (or Cloud SQL on GCP):

➢ Relational Database Management System (RDBMS): MySQL is a relational


RDBMS that stores and manages the data for your website. It is used to store
information such as users, blog posts, comments, etc. On GCP, you might also use
Cloud SQL, a fully managed database service.

❖ PHP and phpMyAdmin:

➢ Server-Side Scripting Language and Administration Interface: PHP is a


commonly used server-side scripting language for dynamic web development. It is
essential for running PHP scripts that generate dynamic web pages. phpMyAdmin is
an administration interface that facilitates the management of MySQL databases
through a user-friendly web interface.

• In summary, installing Apache2, MySQL, PHP, and phpMyAdmin on GCP creates a


comprehensive development environment, offering customized control, configuration
flexibility, and compatibility with many common web applications. This is a crucial step
in building dynamic and interactive websites on the Google Cloud platform.

to install all the software required to run dynamic web applications,


use the following commands:(in the instance created):
1) installation of apache2 :

sudo apt update


sudo apt install apache2

2)installation of php :

sudo apt install php php-{mysql,mbstring,zip,gd}

➢ Cette commande installe PHP ainsi que quelques extensions couramment necessaires
pour des applications telles que phpMyAdmin. Les extensions comme mysql,
mbstring, zip, et gd sont souvent requises pour phpMyAdmin, mais verifiez toujours
les dependances specifiques de la version de phpMyAdmin que vous installez.

3)installation mysql

sudo apt install mysql-server


sudo mysql_secure_installation

 Note: When you enter this command ,you will have some questions to answer .
 Answer like in the picture :
4) Set a password for the 'root' user in MySQL

sudo mysql

 It will give you access to write to the mysql interface,to write the next commands :

USE mysql;

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new


password';

 Note: Remplace ‘new password’ with a password like you want.


Fluch privilegs;

➢ The FLUSH PRIVILEGES command in MySQL reloads privileges that have been
modified in the MySQL privileges table. This forces the MySQL server to reload the
privileges and apply them immediately, without having to restart the server.

exit;

➢ Exit: to quit the mysql interface.

3)installation of phpmyadmin

sudo apt update


sudo apt install phpmyadmin

 Note : During installation, it asks you to choose your server: choose apache2
➢ Setting up phpMyAdmin with Apache2 is a common approach to creating a web
development environment. Apache2 acts as a web server, providing an interface
between users and web applications, while phpMyAdmin offers a user-friendly web
interface for administering MySQL databases.

then :

then:
➢ Write a password that you shoud remember it

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-


available/phpmyadmin.conf
sudo a2enconf phpmyadmin
sudo systemctl restart apache2

➢ These commands perform the following actions:

• sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-


available/phpmyadmin.conf :

➢ creates a symbolic link (ln -s) between the phpMyAdmin configuration for Apache
(/etc/phpmyadmin/apache.conf) and a configuration file for Apache
(/etc/apache2/conf-available/phpmyadmin.conf). This allows Apache to load
phpMyAdmin-specific configuration.

• sudo a2enconf phpmyadmin:

➢ enables the configuration you created for phpMyAdmin in Apache. This tells Apache
to include this configuration when it is restarted.

• sudo systemctl restart apache2 :

➢ restarts the Apache service (apache2) to apply the configuration changes. This allows
Apache to load the new configuration for phpMyAdmin.
c/c : By performing these steps, you configure Apache to use the specific phpMyAdmin
configuration, then restart Apache to take these changes into account. This will allow you to
access phpMyAdmin via Apache..

4)PhpMyadmin configuration

➢ Type the IP address of our instance/phpmyadmin into our browser

You will get this interface

➢ Enter the code we put in for phpmyadmin and the mysql user name root ..

Then displays this interface


➢ Create a new database and name it "wordpress" because you'll need it for wordpress

Hosting dynamic website:

In the context of the chapter on creating and hosting a dynamic website with Google Cloud
Platform (GCP), FileZilla plays an essential role in facilitating the bidirectional transfer of
files between the developer's local computer and the virtual instance deployed on GCP.
FileZilla offers a user-friendly interface for configuring FTP connections, simplifies file
synchronization, facilitates authorization management, and provides diagnostic features to
quickly resolve potential file transfer problems. In short, FileZilla is an indispensable tool for
efficient file management when developing on GCP.

1. We'll use the same steps as for the web page in the previous project, using (puty and
filezella)

2. download wordpress folder from the official website https://wordpress.org/

3. Uncompress the download file and transfer the files to the ftp client (filezella) in the
location var /www /html

4. When the transfer is complete, the following page appears:


5. Clicking on let's go will bring up another wordpress page, the one below:
➢ On database name : this is the name of the database I created on php my admin

➢ On username :this is the name requested when inserting the previous commands. In
our case,it's root.Passord :le mdp du username choisi

➢ Datbasehost: we leave localhost ,this means that the database is hosted on the same
server as the website. In the case of installing WordPress on your own local machine,
both the web server and the database are on that machine, and you use "localhost" to
refer to the database.

➢ Table Prefix :wp¬_admin for example or the "table prefix" in WordPress is a prefix
added to the database table names used by WordPress

6. After entering all the data, it will display a new worpress page

Personal data to be filled in


7. Finally, access to our WordPress to create a website available on the Internet and
accessible to everyone. After creating the web page, simply type in the instance's IP

address to view our website.

Recapitulation about this chapter :


• At the close of this chapter dedicated to creating and hosting a dynamic website with
Google Cloud Platform (GCP), FileZilla, and WordPress, we've outlined the contours of a
robust, scalable infrastructure. Using GCP as a backdrop, we explore the steps involved in
deploying virtual instances, configuring essential services such as Apache2, MySQL (or
Cloud SQL), and PHP,

• FileZilla has been introduced as an essential tool for file transfer, facilitating bidirectional
synchronization between the local computer and the GCP instance. This crucial step
ensures the consistency of the files and data required to run the dynamic website.

• This chapter has thus laid the foundations for a complete solution for creating,
customizing and hosting a dynamic website on GCP. The tools and steps presented
provide an essential guide for developers aspiring to exploit the full benefits of Google's
cloud platform in modern web development.
CONCLUSION
In summary, our group's project has served as an extensive foray into web hosting, cloud
computing, and teamwork. Through the utilization of Google Cloud Platform (GCP) for
hosting both static and dynamic websites, we have acquired practical experience in the
deployment and management of web applications. Our selection of Ubuntu OS, in
conjunction with the use of WordPress for dynamic content and MS FrontPage for static
pages, has enabled us to engage with a diverse array of web development technologies. The
successful installation of ODOO 8 via command-line operations on GCP has further
augmented our expertise, demonstrating our adeptness in overseeing intricate systems and
applications within a cloud environment. This facet of the project not only showcased our
technical acumen but also underscored our capacity to adapt to varying technologies and
platforms. As a cohesive team of four, we encountered and surmounted numerous
challenges, underscoring the significance of effective communication, coordination, and task
allocation. This collective experience has not only enhanced our technical proficiencies but
also fostered our ability to collaborate harmoniously within a team framework. Throughout
the project, we have internalized pivotal values such as teamwork, problem-solving, and
adaptability. These values are not only indispensable in the technological sphere but also
contribute to our personal and professional development. As a team, we have not only
achieved the project's technical objectives but have also established the groundwork for
sustained learning and collaboration in future pursuits. This project stands as a testament to
our combined efforts, resilience, and the invaluable lessons assimilated along the way.
Table of appendices

Annexe 1 : Installation commands for ODOO 8_______________________________1

Annexe 2 : Creating and hosting a static website______________________________2

Annexe3: Creating and Hosting Dynamic website_____________________________3


Annexe 1 : Installation commands for Odoo 8
System update
sudo apt update &&
sudo apt dist-upgrade

sudo useradd -m -d /opt/odoo8 -U -r -s /bin/bash odoo8

Database server installation,Postgresql


Installing Postgresql without myVesta
sudo apt install postgresql -y

sudo su - postgres -c "createuser -s odoo8" 2> /dev/null || true

Installation de WKHTMLTOPDF
sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-
1/wkhtmltox_0.12.6-1.bionic_amd64.deb

sudo apt install ./wkhtmltox_0.12.6-1.bionic_amd64.deb -y

Installing Python 2.7 and pip2 on Ubuntu 20.04


sudo add-apt-repository universe

sudo apt update &&


sudo apt install python2 -y

pip2 --version

→ The answer must be :


pip 20.3.4 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
Installing the Odoo server

sudo mkdir -p /var/log/odoo8/ && sudo chown odoo8:odoo8 -R /var/log/odoo8

sudo apt install git -y

sudo su - odoo8

pip2 install cups dateutils decorator feedparser gdata jinja2 \


mako mock passlib gevent pydot pyparsing reportlab requests \
simplejson unicodecsv unittest2 vatnumber vobject werkzeug xlwt babel \
decorator netplan image unittest2 reportlab mako Python-Chart pytz \
lxml psycopg2-binary pyyaml unittest2 python-chart psutil \
requests simplejson docutils python-openid pyPdf psycogreen html2text &&
pip2 install passlib==1.6.5 &&
pip2 install werkzeug==0.9.6

mkdir /opt/odoo8/odoo-server &&


cd /opt/odoo8/odoo-server &&
git clone https://www.github.com/odoo/odoo --depth 1 --branch 8.0 --single-branch

Odoo configuration

cp /opt/odoo8/odoo-server/odoo/debian/openerp-server.conf odoo-server.conf &&


chown odoo8: odoo-server.conf &&
chmod 640 odoo-server.conf

nano odoo-server.conf

[options]
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo8
db_password = False
addons_path = /opt/odoo8/odoo-server/addons
logfile = /var/log/odoo8/odoo-server.log
Installer le script de démarrage
exit

sudo nano /etc/systemd/system/odoo8.service

[Unit]
Description=Odoo 8 startup script
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo8
PermissionsStartOnly=true
User=odoo8
Group=odoo8
ExecStart=python2 /opt/odoo8/odoo-server/odoo/openerp-server -c /opt/odoo8/odoo-server/odoo/openerp-
server.conf
ExecStop=/bin/kill $MAINPID
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload &&


sudo systemctl start odoo8.service &&
sudo systemctl enable odoo8

sudo systemctl status odoo8

→ The output should look something like below, showing that the service Odoo service is
active and running:

● odoo8.service - Odoo 8 startup script


Loaded: loaded (/etc/systemd/system/odoo8.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-05-15 12:12:12 UTC; 1min 33s ago
Edit GCP firewall setting
In google cloud plateform space ,followed the path :
VPC Network ->Firewall-> create firewall rule .
Then create a noun for the firewall rule, For logs click « ON »,for direction of
trrafic click on « Ingress » , for Action on match click on « Allow » ,For
targets choose : « Specified target tags » ,and write the name of your
firewall in target tags , switched the version IP4 ranges, and for the source
filter write 0.0.0.0/0,on TCP write the port 8069
Once that saves ,go back to the VM instances page , choose your instance click
Edit go to Network tags and add the name of firewall that you created .

To solve the problem mentionned before :


sudo nano /opt/odoo8/odoo-server/odoo/openerp-server.conf

[Unit]
Description=Odoo 8 startup script
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo8
PermissionsStartOnly=true
User=odoo8
Group=odoo8
ExecStart=python2 /opt/odoo8/odoo-server/odoo/openerp-server -c /opt/odoo8/odoo-server/odoo/openerp-
server.conf
ExecStop=/bin/kill $MAINPID
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

sudo chown odoo8:odoo8 /opt/odoo8/odoo-server/odoo/openerp-server.conf

sudo systemctl restart odoo8

sudo systemctl status odoo8


Annexe 2 : Creating and hosting a static website

All the commands using in chapter 2

Installation of Apache on Ubuntu


sudo apt update
sudo apt install apache2

Navigate to the HTML Directory

cd /var/www/html

List the Contents of the Directory

ls

Navigate Back One Level

cd ..

Assign Ownership to the HTML Directory

sudo chown –R username html/

Configure Permissions for the HTML Directory

sudo chmod 755 html


Annexe 3 : Creating and hosting a dynamic website

All the commands using in chapter 3

installation of Apache2 :
sudo apt update
sudo apt install apache2

installation of Php :
sudo apt install php php-{mysql,mbstring,zip,gd}

installation Mysql
sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY
'new password';
Fluch privilegs;
exit;

installation of Phpmyadmin

sudo apt update


sudo apt install phpmyadmin
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-
available/phpmyadmin.conf
sudo a2enconf phpmyadmin
sudo systemctl restart apache2

You might also like