Aws amazon ec2

15
AWS Amazon EC2 presented by Abdun Nur Tomal [email protected]

description

PHP5, MySQL, phpmyadmin, File access point

Transcript of Aws amazon ec2

Page 1: Aws amazon ec2

AWS Amazon EC2

presented by Abdun Nur Tomal [email protected]

Page 2: Aws amazon ec2

AWS Amazon EC2● Amazon free tier page

http://aws.amazon.com/free/

● After login on aws.amazon.com goto the ec2 management console.

● On the left sidebar select instances and click on the Launch Instance button, after continue select the quick start tab.

● Choose desire os and click on the select button● Now choose launch into and select subnet and continue● Define a tag with key = Name and value = Webserver● Create or load the existing keypair file● Create or Load the existing security group [for defining the

protocol name and port address]

● New Instance will be loaded on the table.

Page 3: Aws amazon ec2

Use PuTTy for Login

● Using PuTTy.exe for session and SSH● Use Host Name -

ec2-54-213-113-233.us-west-2.compute.amazonaws.com

● Use Port Address – 22 and save the session with name.● Download location for WinSCP -

http://the.earth.li/~sgtatham/putty/0.62/x86/putty-0.62-installer.exe

● On the connection category, expand SSH and select Auth, browse private key file for authentication

Page 4: Aws amazon ec2

Use PuTTygen for key converssion

● From the File menue load private key.● Save the file as private key.

Use Pageant.exe for SSH authentication

● This is an windows agent after clicking on it, silently it is locate on the system tray.

● Right click on the icon and press add key load the [.ppk] file. Close it.

● Press the saved sessions and click on the session name. Now login console will be start.

Page 5: Aws amazon ec2

Using OpenSSH

● Download link for Binary packagehttp://sourceforge.

net/projects/sshwindows/files/OpenSSH%20for%20Windows%20-%20Release/

● from cmd:ssh -i yourkeyname.pem ubuntu@elasticip

(if you have public DNS then just replace elasticip)

Page 6: Aws amazon ec2

Uploading Files to Amazon EC2 Server using WinSCP

● Using file Protocol - SCP● Host Name [Public DNS on AWS] as like ec2-54-213-113-233.

us-west 2.compute.amazonaws.com● Port Number [22]● Private Key File [.ppk file] ● Save the session and login● Download location for WinSCP -

http://garr.dl.sourceforge.net/project/winscp/WinSCP/5.1.6/winscp516setup.exe

Page 7: Aws amazon ec2

Installation command for Linux

● Update the Ubuntu package manager and the installed packages:

sudo apt-get updatesudo apt-get dist-upgrade

● Updating your serversudo apt-get install build-essential

Page 8: Aws amazon ec2

● Install Apache: sudo apt-get install apache2

● Enable .htaccess files by editing the /etc/apache2/sites-available/default file with vim editor

(Look for the /var/www directory and make sure it contains AllowOverride All)

● Restart Apache:sudo /etc/init.d/apache2 restart

Apache

Page 9: Aws amazon ec2

Apache 2.4 from source

testing ….

Page 10: Aws amazon ec2

PHP5

● Install

sudo apt-get install libapache2-mod-php5

● PHP5 with memcache

sudo apt-get install php5-memcache

Page 11: Aws amazon ec2

PHP5 from source

testing ….

Page 12: Aws amazon ec2

Work with /var/www/

● Allow the Ubuntu user to work with the /var/www folder:

sudo adduser ubuntu www-datasudo chown -R www-data:www-data /var/wwwsudo chmod -R g+rw /var/www

Page 13: Aws amazon ec2

MySQL:

● Install MySQL:

sudo apt-get install mysql-serversudo apt-get install php5-mysql

● Insert root password for the database and remember it.

Page 14: Aws amazon ec2

PHPMyAdmin:

● Install

sudo apt-get install phpmyadmin

Page 15: Aws amazon ec2

Memcache: