Professional Documents
Culture Documents
REPORT
SUPERVISED BY :
NOUREDDINE MOTAKI
PRODUCED BY :
CHAKKAF ATIKA
CHERKAOUI MONSEF
BOUAMRAOUI ILYAS
BOUAJAJ BADR
Ilyas Bouamraoui
Monsef Cherkaoui
Badr Bo
➢ Introduction
➢ 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
Allowing HTTP traffic means that the VM will be able to receive and
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.
System update
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.
This command creates a new user named "odoo8" with specific attributes:
This command installs PostgreSQL using the package manager apt with administrative
privileges (sudo). Here's a breakdown:
So, this command will install PostgreSQL on the system without requiring manual
confirmation for the installation process.
This command utilizes sudo to switch to the user postgres and execute a command within
that user's environment:
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
• Install Wkhtmltopdf
• 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
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 su - odoo8
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
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
exit
→ Then edit the systemctl configuration file
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.
→ 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/).
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
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:
→ Move to the final step when you shoud edit GCP firewall :
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.
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 ?
STEP 1 :
It allows us to visually design web pages without having to write HTML code
manually (WYSIWYG).
STEP 2 :
Apache2, often simply referred to as Apache, is one of the most popular and widely used web
servers in the world.
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)
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
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)
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:
➢ 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):
2)installation of php :
➢ 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
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;
➢ 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;
3)installation of 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
➢ 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.
➢ enables the configuration you created for phpMyAdmin in Apache. This tells Apache
to include this configuration when it is restarted.
➢ 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
➢ Enter the code we put in for phpmyadmin and the mysql user name root ..
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)
3. Uncompress the download file and transfer the files to the ftp client (filezella) in the
location var /www /html
➢ 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
• 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
Installation de WKHTMLTOPDF
sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-
1/wkhtmltox_0.12.6-1.bionic_amd64.deb
pip2 --version
sudo su - odoo8
Odoo configuration
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
[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
→ The output should look something like below, showing that the service Odoo service is
active and running:
[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
cd /var/www/html
ls
cd ..
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