How to set up AWS EC2 with apache

10,543

Solution 1

1) The package manager for Linux AMI is yum, the same one you use on RHEL/CentOS. So if you run something like that:

sudo yum install -y httpd php php-pear mysql mysql-server perl php-common php-dba php-pdo php-mysql php-xml php-xmlrpc

This will install all the LAMP stack. Check the console if was installed properly.

To start the service run:

service httpd start

Before doing that make sure to check the config file.

2) Eh the best think to try how it will work it to actually try ? :)

Solution 2

First, log in to your instance

ssh -i key.pem ec2-user@your-instance-address

Then you can install apache

sudo yum install httpd
sudo /etc/init.d/httpd start

You can check what is installed with RPM

rpm -qa

I am not that familiar with dynamodb but it should work the same from the EC2 instance as it does from your desktop.

Share:
10,543

Related videos on Youtube

Brian
Author by

Brian

Updated on September 18, 2022

Comments

  • Brian
    Brian over 1 year

    I am new to AWS and I have some basic set up questions that I can't find answers to.

    1) I have created an EC2 instance using the default Amazon Linux AMI. How can I install apache? Then how can I confirm what is installed?

    2) I have downloaded the Eclipse toolkit and SDK for the aws products. I have written some code that can take data and push it into my dynamoDB table. I can connect and run this successfully from my local PC. How will this work on the cloud? What do I need to do to get my application working on my EC2 instance?

    Thank you in advance

  • Brian
    Brian almost 12 years
    Thank you. It looks like apache is working and I was able to bring up a basic web page. If I create an S3 bucket/RDS/DynamoDB, will they all sit within my EC2 instance? I'm confused as to how it all goes together. Should my databases and applications run on my EC2 instance or just in conjunction with
  • Brian
    Brian almost 12 years
    :-) Thanks I have been trying. I'm not sure if I need to put source code on the EC2 instance, or run a jar, and if I need to install anything special to run a java app? Right now I'm stuck at the first stage - I can connect with WinSCP but I can't place any files on the server because it says access denied. Thoughts?
  • David Csonka
    David Csonka almost 12 years
    Brian, S3 and RDS are separate services from EC2, for file storage and data storage respectively. They can definitely work in conjunction with an EC2 server, but they do not reside on it. They are in essence, separate instances of their own.
  • MichaelB
    MichaelB almost 12 years
    Your applications will run on the ec2 machine but can call out to the other AWS services if you need to. They dont live "on" the ec2. They are just other things that aws provides.