Perfomed Student: Nguyen Tran Quoc Khanh 1... Perfomed Student: Nguyen Tran Quoc Khanh 2... Perfomed Student: Nguyen Tran Quoc Khanh 4... It can't include leading or trailing spaces Key
Trang 1STUDENT : NGUYEN TRAN QUOC KHANH CLASS > 1716101
STUDENT ID =: BDAF200028 SUPERVISOR =: NGUYEN THE XUAN LY
DaNang, August 2022
Trang 3
ASSIGNMENT 2 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and
Unit : Cloud Computing title
Date received Submission date 22/8/2022 22/8/2022
(1st submission)
Date received
Re-submission date (2nd
submission)
Student name Nguyen Tran Quoc Khanh Student ID BDAF200028
Class 1T16101 Assessor name Nguyen The Xuan Ly
Student declaration
| certify that the assignment submission is entirely my own work and | fully understand the consequences of plagiarism | understand that making a false declaration is a form of malpractice
Trang 4Grade: Assessor Signature:
Internal Verifier’s Comments:
Signature & Date:
Date:
Trang 5TABLE OF CONTENT
TABLE OF CONTENT cà HH TH HH Kha nh TH ĐH Ha xin in ha xe iii LIST OF TABLES AND FIGUREES - - 2mm HH TH nh nh TH nh TH HH iv INTRODUCTION - . - cọ HH HH TH TH HH TH TH TH TH HH SH 1 CHAPTER 1 DEVELOP CLOUD COMPUTING SOLUTIONS USING SERVICE PROVIDER'”S FRAMEWORKS AND OPEN-SOURCE TOOLS 2 1.1 Cloud computing platform configuration (P9®) c n cn c HH na 2 CHAPTER 2_ CLOUD PLATFORM IMPLEMENTATION (P6) - 14 2.1 How to install Apache on Ubuntu Linux 111 1n nhe 14 2.2 _ How to install MariaDB on Ubuntu LinUx nh nh HH He 15 2.3 How to install PHP on Ubuntu LINUX ch nh nhà nh nhào 18 2.4 How to create WordPress database on UbUNIU nhe 20 2.5 How to download WordPress i rr Hà kg Hà Ha 23 2.6 How to configure Apache for VWVordPress che 23 2.7 Some functions of the Website nh nhà HH HH Ho Ho kg ki 39 2.8 lssues and constraints during the development process (M3) 48 CHAPTER 3 ANALYZE THE TECHNICAL CHALLENGES FOR’ CLOUD APPLICATIONS AND ASSESS THEIR RISKS ccccssssssssseeneessessseseneeeseneessnensensnesneans 50 3.1 Cloud Computing platform most common problems and appropriate solutions (P7)
3.2 Common security issues in cloud environments (P8) ca 52 3.3 Discuss how to overcome these security issues when building a secure cloud
in 54 CRITICAL EVALUATION HH“ HH TH" HH KH TH HH HP HH HP 57 CONCLUSION .-.- HH" HH KH HH HH HH KH KẾ HH HT KH BH HH HP 58 REFERENCES -. SH“ HH KH HH HH HH KH KH HD HH hư 59
Trang 6LIST OF TABLES AND FIGURES
Figure 1: Amazon Web Services Qnnn nh nh nh hà na te nuờu 2 Figure 2: The AWS home page L0 ch nh nh Hà gay 3 loi cisei070ie0s-s- T0 a4 3 Figure 4: AWS confirmation mail - c2 211111110 k1 nà Ha te huàu 4 Figure 5: Interface of AWS login page 0L nnn nh HH Heo 4 Figure 6: Interface of ser page Lọ nh nh nh nà Ta Hy sen Hryện 5 Figure 7: Interface of Console home LL L0 20011111 nh nh ng kh ưu 5 Figure 8: Routers of AVVS Quà nà ke ĐH tk Hà nà tà tu ta 6 Figure 9: The upper part of the VPC settings (che hao 6 Figure 10: Lower part of VPC settings nh nh nh Huy 7 Figure 11: Create VPC Workflow 0.cccccccccceececcessteeesecteteeeeeeeeseaeeeeeseaeeeseneretetene ey 8 Figure 12: Interface of EC2 dashboard Lọc né HH He 8 Figure 13: Launch an instance ch nh nh nh nh HH kh Hà Ha Hàn 9 Figure 14: Create key pair WlndOW ch nh Hà HH hà nh Ha tk uuờu 9 Figure 15: Network setfings WindOW ch Hà HH nh He 10 Figure 16: Successful installation notification 2n nén Hee 11 Figure 17: Instances InferÏace ch nh nh nh HH ke HH HH tay 11 Figure 18: PuTTY Configuration window cán nh Ha uàu 12 Figure 19: PuTTY Security Alert c2 vn Hs nh HH Hà tha tàu 13 Figure 20: Successful login notification ác c2 cv n1 nh HH He 13 Figure 21: The message successfully installed Apache co no 14 Figure 22: Interface of Apache in localhost ch nh HH Hena 15 Figure 23: The syntax and notification after MariaDB was installed 16 Figure 24: The question when enable secure of MariaDB -‹-ị 16 Figure 25: The result when MariaDB was installed on Ubuntu 17
Trang 7IP address of VVeb serV@r LH Hành HH kh 24 The file after add commaands nhu he 25 Successfully accessing the WordPress Admin site 26 Requires login to the created database: che 26 Enter the basic information of the websile eee 27 The website has been created successfully -ác 27
Go back to the login interface and proceed to login 27 Figure 44: The interface of the admin page after successfully logging into the website
; 2 default files of New Zone iret do 30 : Add New Host file to New Zone nh nh Hài 31 Enter the IP address in New Host nhe 31
Trang 82 default files of NeW ZONE te Ha nh He 33 Add New Pointer (PTR) to the newly created Zone 34 The newly created Pointer has the IP address of the Web Server 34 Configure IPv4 for DNS S@rvel ccccccccccccesseseccccecsseeeesessessesaeesesenaness 35 Ping from Web server to DNS server successfully 35 The site is already accessible from the outside 36 General settings page of the websile neo 36 Change the IP address to the website's address 37 Save changes nh HH HH kh Hà ta 37 After saving changes, the site will not be found cài: 37 Change SN and SA address of Wordpress.conf file 38 The website can now be accessed using the changed address 38 Home page Interface nh nh nh nh TH Khen kg 39 Product page nh nh nh nh HT hn ng KH th khe ty 39 Home page in tablet ch HH kh trêu 40 Home page In smartphone nh nh nh nh Han 40 Car† page ch nh HH Hành Hà kh Hà Ha ta 41 0e 00s ‹aaa 41 Payment methods ch nh nh HH kg kg trà 42 Order details successfully ordered c che 42 Add product reVI©W nh nh kg TT ky Tra 43 Reviews Of prOdUCI c nh HH na 43 The order page after successfully ordered cà con nhe 44
50-0 ccc cccceeccessescreeessseeeeesensseeeesseneseesnsevessuseaeeteeauuaeeevua sense gees 44
Trang 9Services of SOAR 0000 HH nh nhe nhe HE ky 56
Iiel1¡- 850 -NHHrídiỊAIidiiiiiiii 56
vil
Trang 10
INTRODUCTION KVFone mobile phone store chain is one of the reputable genuine Apple phone distributors in Vietnam In Vietnam today, owning a trendy Iphone is an increasingly popular trend among young people This shows the level of the user as well as their tolerance to play However, not all mobile phone stores sell good iPhones and are authorized by Apple Therefore, the demand to buy genuine Iphone is increasing, with warranty policies to help users feel secure when using the phone KVFone is a big brand, but the management of the chain of many stores of the company faces many difficulties when they do not have the same database, making it difficult to summarize and evaluate This report will cover several e-commerce website design and development processes Specifically, they consist of three parts as follows:
CHAPTER 1: D ođ§È oup COMPUTING SOWUTIONS USING SERVICE PROVIDER'S FRAMEWORKS AND opeN\Aébrce ToỂÏÌss lll
CHAPTER 2: etouŠ PLATFORM IMPLEMENTATION = ie CHAPTER + acs gh Bees GOR CLOUD APPLI-
CATIONS ANDIASSESS THEIR R % 6
Specific tasks in each Chapter | will briefly introduce as follows:
In Chapter 1, | will configure AWS cloud computing platform routing
In Chapter 2, | will install and configure Ubuntu, Apache, Wordpress After the installation and configuration is complete, | proceed to install the basic information of the website and design the interface as well as e-commerce site functions
In Chapter 3, | will analyze the technical challenges facing cloud computing, assess
their risks, and then offer solutions to address those risks
Perfomed Student: Nguyen Tran Quoc Khanh 1
Trang 11CHAPTER 1 DEVELOP CLOUD COMPUTING SOLUTIONS USING SERVICE
AWS Free Tier
fet Choi Orr GH
interruptions and guarantee system reliability, Te US East, US West
Ireland, Singapore, Japan, and Australia are the hubs of these areas The availability zones are a collection of several smaller geographic areas thatmake up each region
Explore Top Product Categories
3 Database 8 Storage B Continers ý Web & Mobile Apps ữ Servertes & Machine Learning ©
Figure 1: Amazon Web Services
« - Phere are-the-services of AWS,-including: eer Oe OS?
e Users may download and view documents, photographs, music, and videos from web-connected devices usifid’EloudDrive Users may stream music to their devices via the service as well
Sign up for AWS
e Custom search fu ctionality, Xplore Free Tier products With a may be,.integrated into other applications using
CloudSearch, aR % spaifidable search engine
e «+ The strengths of Dynamo Databasé} "a fully managed NoSQL database
service, are low latencand scalability
e » Memcached, añ-Bðef3ource, high performance distributed object caching technology for boosting dynamic Web'applications by offloading database operations, is compatible with Elastic Compute Cloud, which enables corporate subscribers to run applications
se RedShift links to common SQL-based clients and business intelligence programs For analytical work-loads, it is a petabyte-scale data warehouse
service
Perfomed Student: Nguyen Tran Quoc Khanh 2
Trang 12® A low-speed, high-speed service called Simple Storage Service (S3) is intended for online data backup and application program storage
+ , Step, 1; Qpen a web browser and visit https://aws.amazon.com/en/ The AWS home page: wilb appeanon: the-browser screen am
the Free Tier
Gct Sewtcd Today [or Free »
Securely Unrestricted Seamlessly
Add ap!
Figure 2: The AWS home page
“* Step 2: Click the Create an AWS Account button on the left corner of the screen to
create an account if you don't have an account or the Sign In line if you already haye,an
account | do not haye an account here, so | will register for an account AWS registration
Trang 13Figure 4: AWS confirmation mail
“* Step 4: Return to the login page, select "IAM user’ and enter the registered account
in the "Account ID (12 digits) or account alias" line and then log in
Console Home in Reset to default layout
Figure 5: Interface of AWS login page
“+ Step 5: After logging in, the user interface will display as shown in Figure 5
Perfomed Student: Nguyen Tran Quoc Khanh 4
Trang 14Asia Pacific Jakarta)
Ñ Asia Pacfic (Mumbai) Asia Pacfic (Osaka) Asia Pacific (Seoul) View all services
SE aay}
Figure 6: Interface of User page
Step 6: Click the Console button, the Console home page will appear as shown in Figure 6 There are VPC (Virtual Private Cloud), EC2 (Elastic Compute Cloud) and AWS Cost Explorer functions
- The main function of VPC is to allow internet access by creating virtual routers and switches
- The function of EC2 is to allow the creation of servers
A VPC is an isolated portion of the AWS Cloud populated by bjects, such as Amazon EC2 instances Mouse over a resource to highlight the related resources
© ee HP Ferenc, AWS, cost is to allow, viewing and management of user expénses ‘We've designed the new create VPC to make it easier to use The changes include a new visualization of the resource pe create
Resources to create info
VPC show detaits Subnets (4) Route tables (3)
VPC only 5 W sš
tmy-project-subnet-public 1-ap- Name tag auto-generation info ~ F c in hit +
ap-southeast-1b Auto-generate
10.0.0.0/24
IPv6 CIDR block info
No IPv6 CIDR block
© Amazon-provided IPv6 CIOR block
Figure 7: Interface of Console home
Step 7: On the right corner of the screen, there are AWS routers Because the server is located in Vietnam, | chose Singapore to be closest to Vietnam
Perfomed Student: Nguyen Tran Quoc Khanh 5
Trang 152
> Customize subnets CIDR blocks
ap-southeast-1a my-peoject-#i-publ
None in 1 AZ 1 per AZ
re ie ae ee my-project-rtb-privat Egress only internet gateway info
ap-southeast-1b
No
my-project-subnet-public2-ap VPC endpoints info
None $3 Gateway
DNS options info
Enable DNS hostnames
@ Enable DNS resolution
Figure 8: Routers of AWS
+» Step 8: After selecting the Router, click on VPC The interface of the VPC settings page is as shown in Figure 8 and Figure 9 Here, | perform the following installation steps:
- Select VPC and More in the Resources to create section
- In the Name tag auto-generation section, select Auto-generation and enter the name of my project
VPC Your VPCs Create VPC Create VPC resources
- In the IPv4 CIDR block section, enter the desired IP address and subnet If not
Createing PRvanaetdcfhtpAPv6 CIDR block
| @® - The rest of the functions | keep default
© Create S3 endpoint: vpce-07e30aGc70a9d9f21
© Create subnet: subnet-Oecfd276355443f2f [4
© Create subnet: subnet-0048586ed25597686 [4
© Create subnet: subnet-Obb53403b8f404f25 J
© Create subnet: subnet-033ba3709387b4a82 [J
© Create internet gateway: igw-0070ee339822bdc2c [4
© Attach internet gatewk gue Qed he upper part of the VPC settings
© Create route table: rtb-06645dd98ce9dddec Y
Trang 16© Create $3 endpoint: vpce-07e30a6c70a9d9f21 [F
© Create subnet: subnet-Oecfd276355443f2f [J
© Create subnet: subnet-0048586ed25597686 [4
© Create subnet: subnet-Obb53403b8f404f25 [A
© Create subnet: subnet-033ba3709387b4a82 [J
© Create internet gateway: igw-0070ee339822bdc2c [J
© Attach internet gateway to the VPC
© Create route table: rtb-06645dd98ce9dddec [4
© Create route
© Create route
© Associate route table
“@Step 2: After.clicking create VPC, the successfully created notification page will be
sisplge aS noe ‘in Figures’ 70-Atter checking the functions and information of the ssociate route tab!
crealed VPC, Glick View, VEC d51a29d5 [2
© Associate route table
Figure 10: Lower part of VPC settings
© Verifying route table creation
© Associate $3 endpoint with private subnet route tables: vpce-07e30a6c70a9d9f21 [J
@ New EC2 Experience x
mn Steen Resources EC2 Global view [4 | | œ | |@ |
Instances New
Instance Types
Perfomed Student: Nguyen Tran Quoc Khanh 7
Trang 17Launch an instance tor
Amazon EC2 allows you to create virtual machines, or instances, that run on the AWS Cloud Quickly get started by Number of instances info
following the simple steps below
1
Canonical, Ubuntu, 18.04 LTS, .read more
v Application and OS Images (Amazon Machine Image) info New security group
An AMI i at contair ftware configuration (operating system, application server, and applications) required to
launch you Search or Browse for AMIs if you don’t see what you are looking for below Storage (volumes)
1 volume(s) - 8 GiB
Q Search our full catalog including 1000s of application and OS images
® Free tier: in your first year includes750 3X
hours of t2.micro (or t3.micro in the
Regions in which t2.micro is
AMIs per month, 30 GIB of E8S storage,
2 millian Ie 1 ER nFenanchnte and
Cancel Peet ale
Amazon Ubuntu Windows Red Hat SUSE Linux Q
Linux
> Browse more AMIs
Create key pair x
Key pairs allow you to connect to your instance securely
Figure 11: Create VPC workflow
Enter the name of the key pair below When prompted, store the private key in a secure
Step 10: Pen ade ythenyPC chad "beebhtecreated tagushown in Figure 11
stance Learn more [4
Continue to click the Launch instance button
Key pair name
| my key-pair|
The name can include upto 255 ASCII characters It can't include leading or trailing spaces
Key pair type
O RSA RSA encrypted private and public key pair ED25519
£D25519 encrypted private and public key pair (Not supported for Windows instances)
Private key file format pem
For use with OpenSSH
© ppk
For use with PuTTY
Figure 12: Interface of EC2 dashboard
Perfomed Student: Nguyen Tran Quoc Khanh 8
Trang 18+» Step 11: l proceed to Install Launch an Instance Name my server, choose Ubuntu
OS (my account is free for 12 months) Then | continued to configure the server
v Network settings Get guidance
Availability Zone: ap-southeast-1a IP addresses available: 11
Auto-assign public IP Info
Auto-assign IPv6 IP Info
Ÿ Security group rule 2 (TCP, 80,Hfgiie(E3;olLuaankh an instance Remove
“+ Step 12: Name the key pair (my key pair) Then choose the RSA code and format
the :RPR extension for remote access Finally, click Create key pair
Source type Info Source Info Description - optional Info
¥ Security group rule 3 (TCP, 443, Multiple sources) Remove
Source type Info Source Info Description - optional info
Figure 14: Create key pair window
Perfomed Student: Nguyen Tran Quoc Khanh 9
Trang 19Get notified of estimated charges
Create billing alerts to get an email notification when estimated charges on your AWS bill exceed an amount you define (for example, if you exceed the free usage tier)
How to connect to your instance
Your instance is launching and it might be a tew minutes until it is in the running state, when it will be ready for you to use
Click View instances to monitor your instance's status Once your instance is in the ‘running’ state, you can connect toit from the Instances screen Find out how to connect to your instance View more resources to get you started
C2 Experience và Instances (1/1) into CG Connect
Name Instance ID Instance state Instance type
My Server i-0ada0089ece157636 min QQ = t2miao @hiti
HN Details Security Networking Storage Status checks Monitoring Tags
¥ Instance summary info ed
¥ Elastic Block Store Hostname ty Private IP DNS name (IPv4 only
bu IP name: ip-10-0-0-9.ap-southeast-1.compute.internal ip-10-0-0-9.ap-southeast-1.compute internal
Figure 15: Network settings window
“* Step 14: After selecting all the requirements, click View
Instance state ¥
Status check ing
View all instances
Actions W Peer) ’
1 © Alarm status AvailabilityZone v Public Noalarms + ap-southeast-a ec2-1
® x
176-96 ap-southeast-
naws.com | open address (J
instance At the Instances
page interface, | see the IP pubic address Copy that IP address to install Putty later
Perfomed Student: Nguyen Tran Quoc Khanh
Trang 20fig? PUTTY Configuration ? x
Bell [_]Bypass authentication entirely (SSH-2 only)
Features
=) Window Authentication methods
Appearance Attempt authentication using Pageant
vena [_]Attempt TIS or CryptoCard auth (SSH-1)
t#I-Selection Attempt "keyboard-interactive" auth (SSH-2)
i Colours Authentication parameters Connection
Data [_] Allow agent forwarding Proxy [_]Allow attempted changes of username in SSH-2
a — Private key file for authentication:
Hostkdigure 16: Suceast SAU ARURUSEfication _ L#sse |
Cipher Auth TTY X11 Tunnels Bugs More bugs v
fig? PuTTY Configuration ? x
Category:
=) Session A Basic options for your PuTTY session
Œ- Terminal Specify the destination you wantto connectto
| Keyboard Host Name (or IP address) Port
Bell |13.215.176.96 | |22
Window Connection type:
Appearance @SSH ()Seral ()Otlher Telnet v Behaviour
Translation Load, save or delete a stored session (Selection | Saved Sessions
Colours Figur :
p 15: Atahe Putty interflacecthedkeygaddress has been downlgaded to drive D for 5 È
lon; Agcess the SSH session, paste the public IP ddress copied above
x11 Close window on exit
Tunnels OAways C)Never @ Only on clean exit
~~ Bugs v
Perfomed Student: Nguyen Tran Quoc Khanh 11
Trang 21PuTTY Security Alert x
The server's host key is not cached in the registry You have no guarantee that the server is the computer you think itis
The server's ssh-ed25519 key fingerprintis:
ssh-ed25519 255 SHA256:iR7o22KtjbhnITWAn7/tp9ZwnCwlMMCM2F0tOw4i3xA Ifyou trust this host, press "Accept" to add the key to PuTTY's
cache and carry on connecting
If you want to carry on connecting just once without adding the key
to the cache, press "Connect Once"
Ifyou do nottrust this host, press "Cancel" to abandon the connection
Trang 22+» Step 16: After Initialization, the program will ask for access rights as shown Select accept and enter the Ubuntu account
sudo apt update
sudo apt install apache2
B osboxes@osboxes: ~ - +x
File Edit Tabs Help
Enabling module mime
Enabling module negotiation
Enabling module setenvif
Enabling module filter
Enabling module deflate
Enabling module status
Enaks Step7- After successful login, the successful login interface appears This window
Enabling conf charset
displayssthe generatedzinformationadhen | proceeded to install Ubuntu
Enabling conf other-vhosts-—access-log
Enabling conf security
Enabling conf serve-cgi-bin
Enabling site 000-default
Created symlink /etc/systemd/system/multi-user.target wants/apache2.service —~/1
ib/systemd/system/apache2.service
Created symlink /etc/systemd/system/multi-user.target wants/apache-htcacheclean service —~ /1lib/systemd/system/apache—-htcacheclean service
Processing triggers for libc-bin (2.27-3ubuntul)
Processing triggers for ureadahead (0.100.0-21)
Processing triggers for systemd (237-3ubuntul0.24)
Processing aah ufw (0.36-0ubuntu0.18.04.1)
osboxes@osboxes: ~$
Figure 19: PuTTY Security Alert
Figure 20: Successful login notification
sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
Perfomed Student: Nguyen Tran Quoc Khanh 13
Trang 23CHAPTER 2 CLOUD PLATFORM IMPLEMENTATION (P6)
2.1 How to install Apache on Ubuntu Linux
8 | wIll install Apache web server:to-berable›to ran:VWWordpress Apache Is considered
Apache2 Ubuntu Default x
one of the best open-source servers today and is widely used The following is the syntax
to install Apache on ey" Apache2 Ubuntu Default Page
This is the default welcome page used to test the correct operation of the Apache2 server after installation on Ubuntu systems It is based on the equivalent page on Debian, from which the Ubuntu Apache packaging is derived If you can read this page, it means that the Apache HTTP server installed at this site is working properly You should replace this file (located at fver/www/htm1 =x html) before continuing to operate your HTTP server
If you are a normal user of this web site and don't know what this page is about this probably means that the site is currently unavailable due to maintenanes If the problem persists, please contact the site's administrator
Configuration Overview Ubuntu's Apache? default configuration is different from the upstream default configuration, and split into several files
optimized for interaction with Ubuntu tools The configuration system is fully documented in /usr/share/doc/apache2 (README Debian.gz Refer to this for the full documentation Documentation for the web server itself can be found by accessing the manual if the apache2-doc package was installed on this server
The configuration layout for an Apache2 web server installation on Ubuntu systems is as follows:
spache2.conr is the main configuration file It puts the pieces together by including all remaining configuration
files when starting up the web server
sudo apt install mariadb-server
sudo apt install mariadb-client
Figure 21: The message successfully installed Apache
The message successfully installed Apache is displayed as shown above Once the installation was done, | was able to enable, stop and enable Apache with the following command thenctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Perfomed Student: Nguyen Tran Quoc Khanh 14
Trang 24@ make sure that Apache was:nstalledsuccessfully, | opened my-browser and entere the a ‘as ddress “http://ocalhost", The interface that has successfully installed Apache will ap
sudo
by a Tol ving st version (1:10.1.48-Qubuntu0.18.04.1)
_ wih ithe low 5 Figure and 409 not upgraded
osboxesfosboxes :~$
b @osb :~$ sudo apt install mariadb-client Reading package lists Done
Building dependency tree
Reading state information Done
The following NEW packages will be installed:
mariadb-client
0 upgraded, 1 newly installed, 0 to remove and 409 not upgraded
Need to get 12.8 kB of archives
After this operation, 66.6 kB of additional disk space will be used
Get :1 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb- client all 1:10.1.48-Oubuntu0.18.04.1 [12.8 kB]
Fetched 12.8 kB in 2s (5,830 B/s)
Selecting previously unselected package mariadb-client
(Reading database 118482 files and directories currently installed.)
Preparing to unpack ./mariadb-client 1$3a10.1.48-0ubuntu0.18.04.1 all.deb Unpacking mariadb-client (1:10.1.48-0ubuntu0.18.04.1)
Setting up mariadb-client (1:10.1.48-0ubuntu0.18.04.1)
Figure 22: Interface of Apache in localhost
2.2 How to install MariaDB on Ubuntu Linux
MariaPB.is considered the most popular database server supporting Wordpress
data storagé°taday? TS'inistallWatiaD Bon UBUTItU, | use the syntax:
0 upgraded, 1 newly installed, 0 to remove and 409 not upgraded
Need to get 12.8 kB of archives
After this operation, 66.6 kB of additional disk space will be used
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb- client all 1:10.1.48-0ubuntu0.18.04.1 [12.8 kB]
Fetched 12.8 kB in 2s (5,830 B/s)
Selecting previously unselected package mariadb-client
(Reading database 118482 files and directories currently installed.)
Similar-to thenApache/mmstallaton;-MariaDB: can berstarted;sstopped:»and enabled
Unpacking mariadb-client (1:10.1.48-Oubuntu0.18.04.1)
with thesfolowing commantdient (1:10.1.48-0ubuntu0.18.04.1)
osboxes@osboxes :~$ sudo mysql _ secure installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here
Enter current password for root (enter for none): i i
Perfomed Student: Nguyen Tran Quoc Khanh 15
Trang 25Enter current password for root (enter for none): PRESS ENTER
Switch to unix_socket authentication [Y/n] n
Change the root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Figure 23: The syntax and notification after MariaDB was installed
All done!
To enable protection for the database server, | use the following syntax:
sudo AWAPaGtiVAfIGh, the system will ask questions to help you install MariaDB And the
Trang 26File Edit Tabs Help
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately
Reload privilege tables now? [Y/n] y
- Success!
Cleaning up
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure
Thanks for using MariaDB!
osboxes@osboxes:~$ sudo mysql -u root -p
Enter password:
Welcome to the MariaDB monitor Commands end with ; or \g-
Your MariaDB connection id is 47
Server version: 10.1.48-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others
Type 'help;' or '\h' for help Type '\c' to clear the current input statement
MariaDB [(none)]> fj
Use the following syntax to check if MariaDB has been installed successfully:
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
Theiinterface forssuccessfully logging into MariaDB is as follows:
an http: //us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2 mm ốc ẽ.ẽ bionic/main Translation-en [37 m http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [1,
Reading package lists Done
Figure 25: The result when MariaDB was installed on Ubuntu
Perfomed Student: Nguyen Tran Quoc Khanh
Trang 27File Edit Tabs Hel \
To run Wordpress, you need to install PHP | will proceed to install PHP on Ubuntu
Specificat’a $ follow i a ORES EOE CƠN ng bionic-updates/universe i386 Package Get:17 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe Translation-
Reading package lists Done
osboxes@osboxes:~$ sudo apt update
Hit:1 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists Done
Building dependency tree
Reading state information Done
410 packages can be upgraded Run ‘apt list upgradable' to see them
sudo apt install php8.@ php8.@-common php8.@-mysql php8.@-gmp phps.@-curl php8.Q-intl php8.@-mbstring php8.0-xmlrpc php8.0-gd php8.@-xml php8.0@-cli php8.@-zip
mù: ae Tức 6 «pF igure 26: The result after implement the syntax
Creating config file /etc/php/8.0/mods-available/gd.ini with new version
Setting up php8.0-xmlrpc (3:1.0.0~rc3-4+ubuntu18 04 1+deb sury.org+10)
Setting up libapache2-mod-php8.0 (1:8.0.22-1+ubuntu18 04 1+deb sury org+1)
Creating config file /etc/php/8.0/apache2/php.ini with new version
Module mpm event disabled
Enabling module mpm prefork
apache2 switch mpm Switch to prefork
apache2 invoke: Enable module php8.0
Setting up php8.0 (1:8.0.22-1+ubuntu18 04 1+deb sury org+1)
Processing triggers for libc-bin (2.27-3ubuntul) :
Processing triggers for php8.0-cli (1:8.0.22-1+ubuntul18.04.1+deb sury.org+1)
Processing triggers for libapache2-mod-php8.0 (1:8.0.22-1+ubuntul8.04.1+deb sury org+1)
Figure 27: The result after implement the syntax update
- To install PHP version 8.0 and required modules, the syntax used is:
sudo nano /etc/php/8.@/apache2/php.ini
Perfomed Student: Nguyen Tran Quoc Khanh 18
Trang 28File Edit Tabs Help
GNU nano 2.9.3 /etc/php/8 0/apache2/php.ini
; About php.ini i
; PHP's initialization file, generally called php.ini, is responsible for
configuring many of the aspects of PHP's behavior
; The following is a summary of its search order:
SAPI module specific location
The PHPRC environment variable (As of PHP 5.2.0)
A number of predefined registry keys on Windows (As of PHP 5.2.0) Current working directory (except CLI)
; 5 The web server's directory (for SAPI modules), or directory of PHP
(otherwise in Windows)
Windows directory (usually C:\windows)
See the PHP docs for more specific information
© Get Help ° Figure 28: AST A ean plement synlax:, me Cur Pos
lac me Uncut Text
- Proceed to configure P to be able to meet
Figure 29: PHP's default file
PHP attempts to find and load this configuration from a number of locations
6 The directory from the with-config-file-path compile time option, or the To Spell l Go To Line
requirements by openin g the
Perfomed Student: Nguyen Tran Quoc Khanh
Trang 29fe Get Help fe Write Out @) Where Is « Cut Text fy Justify me Cur Pos
¢ Exit š Read File BÀI Replace Uncut Textilh: To Spell (gi Go To Line
sudo mysql -u root -p
CREATE DATABASE Figuing 30: PHP's default file after add statements
2.4How to create WordPress database on Ubuntu
In this step, | will proceed to create a database for Wordpress Specifically, the commands are as follows:
Perfomed Student: Nguyen Tran Quoc Khanh 20
Trang 30
we osboxes@osboxes: ~
File Edit Tabs Help
Reload privilege tables now? [Y/n] y
Success!
Cleaning up
[All done! If you've completed all of the above steps, your MariaDB
installation should now be secure
Thanks for using MariaDB!
ljosboxes@osboxes:~$ sudo mysql -u root -p
Enter password:
Welcome to the MariaDB monitor Commands end with ; or \g
Your MariaDB connection id is 47
Server version: 10.1.48-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others
Type "help;' or '\h' for help Type '\c' to clear the current input statement
IMariaDB [(none)]> CREATE DATABASE wpdb;
Query OK, 1 row affected (0.01 sec)
Figure 31: Database has been created successfully
CREATE USER 'wpdbuser'@'localhost' IDENTIFIED BY ‘new_password_here';
| osboxes@osboxes: ~ - +x
File Edit Tabs Help
Cleaning up
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure
Thanks for using MariaDB!
osboxes@osboxes:~$ sudo mysql -u root -p
Enter password:
Welcome to the MariaDB monitor Commands end with ; or \g-
Your MariaDB connection id is 47
Server version: 10.1.48-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others
Type 'help;' or '\h' for help Type '\c' to clear the current input statement
MariaDB [(none)]> CREATE DATABASE wpdb;
Query OK, 1 row affected (0.01 sec)
MariaDB [(none)]> CREATE USER 'wpdbuser'@'localhost' IDENTIFIED BY 'new_password _here';
Query OK, 0 rows affected (0.01 sec)
Figure 32: The database account and password have been created successfully
GRANT ALL ON wpdb.* TO ‘wpdbuser'@'localhost' WITH GRANT OPTION;
Perfomed Student: Nguyen Tran Quoc Khanh 21
Trang 31File Edit Tabs Help
Thanks for using MariaDB!
osboxes@osboxes:~$ sudo mysql -u root -p
Enter password:
Welcome to the MariaDB monitor Commands end with ; or \g-
Your MariaDB connection id is 47
Server version: 10.1.48-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others
Type 'help;' or '\h' for help Type '\c' to clear the current input statement
MariaDB [(none)]> CREATE DATABASE wpdb;
Query OK, 1 row affected (0.01 sec)
MariaDB [(none)]> CREATE USER 'wpdbuser'@'localhost' IDENTIFIED BY 'new_password _here';
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> GRANT ALL ON wpdb.* TO 'wpdbuser'@'localhost' WITH GRANT OPTIO
N;
Query OK, 0 rows affected (0.01 sec)
MariaDB [ (none) ]> q
Figure 33: Grant access to the created account
Save and exit
FLUSH PRIVILEGES;
EXIT;
File Edit Tabs Help
Server version: 10.1.48-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others
Type ‘help;' or '\h' for help Type '\c' to clear the current input statement
MariaDB [(none)]> CREATE DATABASE wpdb;
Query OK, 1 row affected (0.01 sec)
MariaDB [(none)]> CREATE USER 'wpdbuser'@'localhost' IDENTIFIED BY 'new_password _here';
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> GRANT ALL ON wpdb.* TO 'wpdbuser'@'localhost' WITH GRANT OPTIO N;
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
MariaDB [ (none) ]>
MariaDB [(none)]> EXIT;
Bye
Figure 34: Exit MariaDB installation
Perfomed Student: Nguyen Tran Quoc Khanh 22
Trang 32To be able to proceed with creating the website, | have to download Wordpress on
Ubuntu first The commands and results are as follows:
File Edit Tabs Help
Processing triggers for php8.0-cli (1:8.0.22-1+ubuntul8.04.1+deb sury.org+1)
Processing triggers for libapache2-mod-php8.0 (1:8.0.22-1+ubuntul8.04.1+deb sury
.org+1)
osboxes@osbomes:~$ sudo nano /etc/php/8.0/apache2/php.ini
osboxes@osboxes:~$ cd /tmp
osboxes@osboxes: /tmp$
osboxes@osboxes:/tmp$ wget https://wordpress.org/latest tar.gz
ta 2022-08-19 02:25:56-—- https://wordpress.org/latest tar.gzr
-xvzf latestResolving wordpress.org (wordpress.org) tar.gz
sudo mv wordpress /var/www/wordpress
failed: Temporary failure in name resolution
wget: unable to resolve host address ‘wordpress.org’
osboxesfosboxes : /tmp$
osboxes@osboxes:/tmp$ tar -xvzf latest.tar.gz
tar (child): latest.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
osboxes@osboxes : /tmp$
osboxes@osboxes:/tmp$ sudo mv wordpress /var/www/wordpress
my: cannot stat 'wordpress': No such file or directory
osboxesfosboxes: /tmp$ | 1
Figure 35: The result of command
sudo chown -R www-data:www-data /var/www/wordpress/
sudo chmod -R 755 /var/www/wordpress/
2.6 How to configure Apache for WordPress
The next step is to configure Apache for Wordpress once it has finished loading by creating a configuration file and adding the following commands to complete the configuration In there in the ServerName and ServerAlias sections, | will change to the IP address of the web server so that | can use the IP address to access the Wordpress
website
Perfomed Student: Nguyen Tran Quoc Khanh 23
Trang 33a osboxes@osboxes: /tmp
File Edit Tabs Help
GNU nano 2.9.3 /etc/apache2/sites—available/wordpress.conf
© Get Help e Write Out 4ˆ Where Is 4 Cut Text fy Justify
¢ Exit 3 Read File gi) Replace Uncut Text To Spell
Figure 36: The default file
Perfomed Student: Nguyen Tran Quoc Khanh
Trang 34ji Active Network Connections
Wired connection 1 (default) General
Interface: Ethernet (ens33) Hardware Address: 00:0C:29:CF:5E:06 Driver: pcnet32 Speed: 10 Mb/s Security: None
IPv4
IP Address: 192.168.6.6
Broadcast Address: 192.168.6.255 Subnet Mask: 255.255.255.0 Default Route: 192.168.6.2 Primary DNS: 8.8.8.8
</VirtualHost>
Perfomed Student: Nguyen Tran Quoc Khanh 25