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
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187