Content

                                                  Content How to create an AWS free Account? Lab 1: To launch amazon Linux EC2 instance Lab 2: To Connect to the instance from Linux client Operating System Lab 3:To Launch amazon windows instance Lab 4: Installing apache in EC2 instance Lab 5: Installing Nginx in EC2 instance Lab 6: Changing Host Name Lab 7: Creating a user and making as a sudoer Lab 8:Assigning an Elastic ip Lab 9:Creating ebs,attach and detach the volumn to the instance Lab 10:Creating an S3 Bucket and creating cross replication in another region Lab 11:Load Balancer Lab 12:Two instances with Application Load Balancer Lab 13:Launching two instances with load Balancer Lab:14 Creating Own VPC  Lab 15: Two instances which classic load Balance with own VPC Lab 16:Two instances with Application load Balancer with own VPC Lab 17: Relational Data B...

Lab 18: LAMP(Drupal and wordpress)

                                                     LAMP(Drupal and wordpress)



Pre-Requirements :

Launch an Ec2 Instance

Install apache

Install Mysql

Install Php

Install drupal

Step 1: Launch an EC2 instance

Refer above how you launch an EC2 instance

Next Connect to instance public IP address

#ssh –i<pemfile>ec2-user@ipaddress

 


Install apache

#yum install http

#systemctl start httpd

#systemctl enable httpd

 

 


Apache installed

Now start and enable apache

#systemctl enable httpd

 

Check whether apache is running or not

 

Now to test whether the server is running,open your web browsera nd enter you ip address

 

 


Page is there

Step 2:install maria db data base servers

To install maria db database, you need to add the following official maria db respository to file /etc/yum.resposas shown.

Name=mariadb

Baseurl:http://yum.mariadb.org/10.1/centos7-amd64

Gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-mariaDB

Gpgcheck=1

 


Save and quit the vi editor

Now install the maria db

#yum install maria db –server maria db

 

#systemctl start maria db

#systemctl enable  maria db

 


Now run the command

#mysql_secure _installation

 

It will ask current password for root..you just enter

 

Now set a password

Click on yes and set the password

 


Click when it asked remove anonymous user-yes

 

Enter yes disallow root login remotely




Step 3:install php

Rpm-uvhhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

#yum install php*

 


To test if php is working in collaboration with the web server, we need to create a info.php file inside/var/www/html/info/.php

 


It will open vi editor and the below line

<?php

Phpinfo

?>

 


Save and come out of from vi editor

Restart the httpd

#systemctl restart httpd

Now check the php page in the browser

<ipaddress>/info.php

 

You will get php page like this

Step 4:install drupal

Install wget and gzip

#yum install wgetgzip

Wget -c https://ftp.drupal.org/files/protects/drupal-8.2.6.tar.gz


After wards iet s extract the tar file and move the drupal folder into the/var/www/html

#tar-zxvf drupal-8.2.6.tar.g2

#mvdrupal-8.2.6/var/www/html/drupal


 

Files un zip

Now to the /var/www/html

Then create the settings file settings .php,from the sample settings file defaultsettings .php in the folder

(/var/www/html/drupal/sites/default)and then set the appropriate permission on the drupal site directoiry,including sub directories and files as follows  :

#cd/var/www/html/drupal/sites/default/

#cpdefault. Settings.php settings .php

#chown-R root:root /var/www/html/drupal/

 

Now we have to create a database and user for the Drupal site to manage.

#mysql –u root –p

 

It will ask the password


Now create a database

Give a data base name drupal

Then create a username  and provide a password

And again all the permission to the user

 


Now finally ,open the url://http://server _ip/drupal/ to start the web installer.

And choose your preferred installation language and click save to continue


Click continue

Select standard one and click on continue

 

Click on Continue

 


You will get a page like this

Provide required data

Give your database name and username and password

 


Click on continue

Drupal is installing

 


After installing you will get a page like this

Provide the details and click on continue

 

 

 


Click on save and continue


You will get a drupal website

Lab :Lamp with wordpress:

Pre-Requirements:

Launch an instance

Install php

Install mysql client

Install wordpress

Refer above up to installation of maria DB

Step 4 : Install wordpress

Download the latest wordpress package and extract it by issuing the commands below on the terminal:

#wget –c http://wordpress.org/latest.tar.gz

And unzip the zip

tar –xzvf latest.tar.gz

 

Now unzip the file

 

Then move the wordpress files from the Extracted folder to the apache default root directory,/var/www/html/:

Sudo rsync –av wordpress/*/var/www/html/

 

Files moved

Next,set the correct permissions on the website directory that is give ownership of the wordpress files to the webserver as follows:

#sudo chown –R root:root/var/www/html/

#sudo chown –R 755/var/www/html/

Now create a data base in the name of wordpress

Login to the mysql server

My sql –u root –p

And enter the password

 

Create the database

Then grant all the permissions to the user

Create DATABASE word press:

Grant ALL PRIVLIEGES ON word press.*To root ‘@’localhost’IDENTIFIED By ‘Login@123’;

FLUSH PRIVLIEGES;

Exit;

 

Go the /var/www/html/directory and rename existing wp –config-sample.php to wp-config.php:

 

Now open the wp-config.php and provide the below details

Data base name:wordpress

Username:root

Password:********

#vi wp-config-php

 



Then restart the httpd and mysqld

#systemctl restart httpd

Open your web browser,then enter your server address:http//server-address to get the welcome

Page below.

 


Provide the details

Site title :wordpress

Username as root

Give the password

Give the email id

And again click on install wordpress

 


You will get a page like this

Click on login

 



Provide the details and click on login in

 


Reference:https://www.tecmint.com/install-drupal-in-centos-rhel-fedora/

https://www.tecmint.com/install-on-ubuntu-16-04-with-lamp/

 

Execrise:Create lamp using mysql client mysql client.(Both drupal and wordpress)

Create a lamp using magentodb..

 

 

 

 

 

 

Comments

Popular posts from this blog

Lab 21:Installing docker in instance and build an image

Lab 22:Pushing a docker image to docker hub

Lab 5: Installing Nginx in EC2 instance