Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore Assignment_ramkumar

Assignment_ramkumar

Published by ramkumar.chelliah, 2018-06-16 05:07:35

Description: Assignment_ramkumar

Search

Read the Text Version

Step 4: Click the Next button on the subsequent screen.Step 5: Choose the appropriate folder location and click the Next button. 145

Step 6: Click Next on the subsequent screen.Step 7: Click the „Yes‟ button on the next screen to proceed ahead with the installation. 146

Step 8: Click Install on the next screen.Step 9: After the installation is complete, launch Oracle VirtualBox. On the Launch screen, clickthe „New‟ menu option. 147

Step 10: Give a name for the virtual machine and give the type as Ubuntu and then click theNext button.Step 11: In the next screen, keep the recommended RAM as it is and click the Next button. 148

Step 12: Accept the default setting for the virtual hard disk and click the Create button.Step 13: Accept the hard disk type and click the Next button. 149

Step 14: Accept the default type of physical hard disk allocation and click the Next button.Step 15: Accept the default file location and click the Create button. 150

Step 16: Now that the Virtual Machine has been created, click the Settings Menu option.Step 17: Go to the Storage option, click the Empty disk icon and browse for the Ubuntu iso image.Then click the OK button. 151

Finally click the Start button. The system prompts to install Ubuntu. Follow the steps in theInstallation chapter and we will have a Virtual Machine hosting Ubuntu. 152

23. Ubuntu − Installing MySQL & PythonMySQL and Python are famous database and development software respectively. These arenormally installed on Linux-based systems. Let‟s see how we can get them installed on Ubuntuserver environments.Installing PythonThe first thing to do is to find out what is the version of Python installed on the system. We canfind this issuing the following command. Python –vWhere the –v option specifies to show what is the version of Python installed. The followingscreenshot shows a sample of the output of the above command.From the above output, we can see that the version of Python installed is version 2.7. 153

There is another way to see if Python is installed via the following commands. Python –V Python3 –VThe later command is used to see the version 3 of Python installed.If we want to have the latest version of Python installed, then we need to issue the followingstatement. sudo apt-get install python3The above command will download the necessary packages for Python and have it installed. 154

Installing MySQLTo install MySQL, the following steps need to be followed.Step 1: Issue the apt-get command to ensure all operating system packages are up to date. sudo apt-get updateStep 2: Once all the packages have been updated, it is time to get the packages for MySQL. sudo apt-get install mysql-serverThe above command will start the download of all the relevant packages for MySQL.Once the download completes and the installation starts, the installer will first ask to configure aroot password. 155

Step 3: Enter the required password and click the OK button. It will also prompt to re-enter thepassword. 156

Step 4: To see the MySQL process running, run the following command. ps –ef | grep mysqlThe following screenshot shows mysqld which is the daemon process for mysql running in thebackground.Step 5: To configure mysql, run the following command. /usr/bin/mysql_secure_installationIt prompts to enter the root password which was entered during the installation process. 157

Step 6: Enter the password and hit Enter.Now, it prompts on whether we want to change the root password.Step 7: Enter „N‟ for No and proceed.Again, it prompts on whether we want to remove the Anonymous access. 158

Step 8: When connecting from other machines on this database, it is advised to keep the defaultoptions as „N‟ for both anonymous users and disallow root login remotely.Step 9: It is advised to provide the option as No for the options of Remove test database as well.We can enter „Y‟ to reload the privileges table.Finally, the configuration of MySQL will be complete. 159

24. Ubuntu − Node.jsNode.js is a popular JavaScript framework used for developing server side applications. In thischapter, we will see how to get Node.js installed on Ubuntu.Following are the steps to get Node.js installed.Step 1: Run the following command. sudo apt-get install nodejsThis will install all the necessary packages for Node.jsNext, we need to install the Node package manager which is required for Node.js applications. 160

Step 2: Run the following command. sudo apt-get install npmAll the necessary packages for the node package manager will be installed.Step 3: Next, create a symbolic link to the Node.js folder. Then, run the Node –v command andnpm –v to see the Node and npm version installed. 161

25. Ubuntu − DockerDocker is a container service which allows one to run applications or even operating systems ona host operating system as containers. Containers are a new and exciting technology that hasevolved over the last couple of years and being adopted by a lot of key organizations.Docker is a company that develops these special containers for applications. The official websitefor Docker is https://www.docker.com/ 162

As an exercise, let‟s install a CentOS container on an Ubuntu system. CentOS is a Linux-basedoperating system from Red Hat. Thus, we will be running the CentOS system on top of Ubuntu.Following are the steps to have this in place.Step 1: The first step is to install the Docker application on Ubuntu server. Thus on the Ubuntutest server, run the following command to ensure that OS updates are in place. sudo apt-get update 163

Step 2: Once all updates have been processed, issue the following command to get Dockerinstalled. sudo apt-get install -y docker.ioStep 3: Once the Docker packages are installed, we should receive an output message statingthat the Docker process has started and is running. The Docker process is known as the Dockerengine or Docker daemon. 164

Step 4: To view the version of Docker running, issue the Docker info command.Step 5: The next step is to install our CentOS image on Ubuntu.Docker has a special site called the Docker hub, which is used to store pre-built images forDocker. The link to the site is https://hub.docker.com/Step 6: Do a quick and simple sign-in process to be able to log into the site and see all theavailable Docker images. 165

Step 7: Once logged in, click the Explore button to see all the available Docker images. 166

The two important points to note are -  The Docker pull command. This is the command to install the Docker image on Linux box.  The Docker details for the various versions of CentOS.Step 8: On Ubuntu box, run the command sudo docker pull centos:latestThe download of the Docker component starts and the CentOS Docker is downloaded. The nameof the Docker image is centos:latest, which means that we have the latest Docker image forCentOS.Step 9: To see all the Docker images installed, issue the command sudo docker images 167

In the following screenshot, we can see that the Docker image is just 196.8 MB in size, and thisis the subset of the CentOS which now runs on Ubuntu system.Step 10: To start CentOS, we need to issue a command to the OS to get a thread started. Wecan do this by running the following command. sudo docker run -it centos /bin/bashThe above command does the following things -  Runs the CentOS Docker image.  Runs the image in interactive mode by using the -it option.  Runs the /bin/bash command as the initial process. 168

26. Ubuntu − Ubuntu On the CloudWe can also install Ubuntu on various cloud environments such as Google Cloud, Amazon webservices, and Azure web services. In this chapter, we will see how to get Ubuntu up and runningon Amazon web services. Following are the steps to get this in place.Step 1: One can get a free account with Amazon web services. All we need to do is register withAWS on the following url - https://aws.amazon.com/console/

169

Step 2: Click the Sign in to the Console and it presents the following dialog box.Step 3: Click the option „I am a new user‟ and enter the required email id of an existing Gmailaccount. Then click the „Sign in using our secure server‟ button. We will then need to give someinformation in the subsequent screen to create an account. 170

Step 4: Once an account has been created, we can log into the console. Once logged in, click theEC2 option. This option is used for creating virtual machines on the cloud.Step 5: In the following screenshot, click the Launch Instance button. 171

Step 6: The next screen prompts to select an appropriate AMI. An AMI is a pre-built image for anoperating system in Amazon. Scroll down until to the Ubuntu option and click the Select button. 172

Step 7: In the next screen, choose the configuration of the machine. Choose the General purpose– t2.micro option and then click the „Next: Configure Instance Details‟ button. 173

Step 8: In the next screen, enter the following details as shown in the screenshot.  The number of instances to launch – Keep 1 as the default.  VPC – If there is no existing VPC, choose the option to create a new one. 174

Now, if we choose the option to create a new subnet, we need to perform the following sub steps.Click the Create VPC button. (Note: The VPC is known as a virtual private network which is usedto store all AWS objects in an isolated environment.)In the Create VPC dialog box, enter the following details and click the „Yes Create‟ button. 175

  For the subnet, keep the default setting as it is.  For the Auto-assign Public IP option, choose „use subnet setting(Enable)‟.  Keep the IAM Role as „none‟.  Keep the Shutdown behavior as „none‟.  The remaining settings can remain as by default.Click the Next: Add Storage button.Step 9: In the next screen, keep the default storage as is and click the Review and Launch button. 176

Step 10: The review screen will pop up. Click the Launch button.Step 11: The next screen prompts to create a new key pair. This is required to log into theinstance when it is created. Enter a key name and click the download Key pair button. 177

Step 12: Once download is complete, click the Launch Instances button.Step 13: Click the „View Instances‟ button. 178

Step 14: Once the state of the instance is running, click the Connect button.The next dialog box presents the steps to log into the Ubuntu server machine. 179

Step 15: Perform the steps as we would normally do, using a SSH client to log into the machine. 180


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook