Setting Your Groups CMPE 451 Deployment Server on Amazon ...



Setting Your Groups CMPE 451 Deployment Server on Amazon Web ServicesMost of the material in these notes are from . However, we have updated files and linux commands to make the install process easier.Create an account with Amazon Web ServicesTo sign up for the 12 month free tier offer you will need to give address details, credit or debit card details and your telephone number. The sign up form is located at: ? and it takes just a few minutes to complete the process. As a security measure you will receive an automated telephone call and will be asked to enter a four digit number that appears on the screen into you phone.Select an instanceWith your newly created account you are ready to select an instance. Log into you account and from the list of Amazon Web Service select EC2.1452880470535You will enter the control panel of you EC2 instances. As yet you don’t have an instance installed. To install and instance click the button Launch Instance.You will be presented with a pop-up menu from which you can select the type of instance to install.I recommend choosing the free tier Amazon Linux AMI 64bit. Then choose the free tier options for storage.In security groups, make sure to enable port access for the ports 22(ssh), 80(http), 8080(tomcat), and 3306(mysql)Create a private key file with a unique name and make sure to download that file.Download and install PuttyPutty is an SSH client that allows remote access to the root of our Linux instance and can be downloaded from the??website. Select the appropriate version for you operating system. While you are there you must also download PuttyGen. This application converts the PEM (Privacy Enhanced Mail Security Certificate) file generated when creating a Key Pair to a PPK file for use in Putty. This file provides authentication when connecting to your instance from Putty.Once these two application are installed you can must convert the PEM file to a PPK file. Open up PuttyGen and load the PEM file then save it with a PPK extension.Connect via SSH using PuttyWe are now ready to connect to our instance via Putty.To configure Putty we need the following information:The public DNS of your instance;the PPK file we converted from PEM ealier andthe auto-login name.The DNS of your instance can be found on the EC2Dashboard and will be in the form: ec2-54-93-111-55.eu-central-pute. and will vary depending on the region that the instances is installed in.Public DNSThe auto-login name should be: ec2-userLaunch Putty and on the Session screen enter the Public DNS in the Host Name input box and a name in the Saved Sessions box.Putty ConfigurationSwitch to the Data screen which is under the Connection menu option and enter the user name in the login details box. Now switch to the Auth screen which is under SSH and Browse to the location where the PPK file is located.Return to the Session screen and save the configuration. Click Open to connect.Now you are logged into your instance of Linux on EC2.Transferring Files to Your Linux Instance Using WinSCPWinSCP is a GUI-based file manager for Windows that allows you to upload and transfer files to a remote computer using the SFTP, SCP, FTP, and FTPS protocols. WinSCP allows you to drag and drop files from your Windows machine to your Linux instance or synchronize entire directory structures between the two systems.To use WinSCP, you'll need the private key you generated in?Converting Your Private Key Using PuTTYgen. You'll also need the public DNS address of your Linux instance.Download and install WinSCP from?. For most users, the default installation options are OK.Start WinSCP.At the?WinSCP login?screen, for?Host name, enter the public DNS address for your instance.For?User name, enter the default user name for your AMI. For Amazon Linux AMIs, the user name is?ec2-user. For Red Hat AMIs the user name is?root, and for Ubuntu AMIs the user name is?ubuntu.Specify the private key for your instance. For?Private key, enter the path to your private key, or click the "…" button to browse for the file. For newer versions of WinSCP, you need to click?Advanced?to open the advanced site settings and then under?SSH, click?Authentication?to find the?Private key file?setting.NoteWinSCP requires a PuTTY private key file (.ppk). You can convert a?.pem?security key file to the?.ppkformat using PuTTYgen. For more information, see?Converting Your Private Key Using PuTTYgen.(Optional) In the left panel, click?Directories, and then, for?Remote directory, enter the path for the directory you want to add files to. For newer versions of WinSCP, you need to click?Advanced?to open the advanced site settings and then under?Environment, click?Directories?to find the?Remote directory?setting.Click?Login?to connect, and click?Yes?to add the host fingerprint to the host cache.After the connection is established, in the connection window your Linux instance is on the right and your local machine is on the left. You can drag and drop files directly into the remote file system from your local machine.?Download and install Java 7Now that we are logged in we will download Java 7. We will need root access so type?sudo -iand navigate to the top directory. We are going to download and install Java into a new directory under?usr. Create a new directory by doing:?mkdir /usr/java?and navigate to thejava?directory.wget through downloaded we need to unpack it using tar:?tar? zxpvf?jdk-8u60-linux-x64.gzNow we set the Java Home and will put Java into the path of our users using the following commands:JAVA_HOME= /usr/java/jdk1.8.0_60/export? JAVA_HOMEPATH=$JAVA_HOME/bin:$PATHexport PATHYou can verify that Java is installed by doing:?java -version?Download, install and configure Tomcat 8We are going to download and install Tomcat 8 in the?/usr/share?directory by running the following two commands:wget through Runtar zxpvf apache-tomcat-8.0.27.tar.gzTomcat will be unpacked and installed in the?apache-tomcat-8.0.27?directory. We will now finish by configuring the Tomcat users and setting tomcat to launch automatically whenever the server restarted.To configure Tomcat to launch automatically create a file called tomcat?in the directory/etc/rc.d/init.d/?with the following contents:!/bin/sh# Tomcat init script for Linux.## chkconfig: 2345 96 14# description: The Apache Tomcat servlet/JSP container.JAVA_HOME=/usr/java/jdk1.8.0_60/CATALINA_HOME=/usr/share/apache-tomcat-8.0.27export JAVA_HOME CATALINA_HOMEexec $CATALINA_HOME/bin/catalina.sh $*Then execute the following commands to set proper permissions and prep tomcat for auto-launch.chmod 755 /etc/rc.d/init.d/tomcatchkconfig --level 2345 tomcat onNow we need to set up the Tomcat users. This will allows access to the Manger Console in the Tomcat interface. The users are configured in a file called?tomcat-users.xml?which is stored in the?apache-tomcat-8.0.27/config?directory. Open this file using nano and edit the user permissions as below, changing the password as appropriate:<tomcat-users xmlns="" xmlns:xsi="" xsi:schemaLocation=" tomcat-users.xsd" version="1.0"> <role rolename="manager-gui"/> <role rolename="role1"/> <user username="demoUser" password="merhaba" roles="manager-gui"/></tomcat-users>We have now configure all that needs to be configured. Go back to the EC2 console and reboot the instance by right clicking on the instance and selecting reboot. This should not take more that a few minutes.Once the instance has rebooted, go to your browser and enter the public DNS of your instance followed by the port 8080. It should look something like this: . You will see the Tomcat Server Home Page. To access the manager application click on the Manager App button on the right-hand side. Enter the user name and password that you configured in the?tomcat-users.xml?file. You will see the web application manager console from which you can upload a WAR file. Scroll down to the Deploy section, from here you can select a WAR file and deploy it into Tomcat.The URL of your web application will look something like this: Up MySQLRun the commandsudo yum install mysql-serverthen start mysql by sudo /sbin/service mysqld startsudo /usr/bin/mysql_secure_installationFor further instructions please visit: ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download