Dhwanit

Posted: Dec 8, 2010
By: Dhwanit | 0 comments
Category: Apps

amazon aws, apache, aws, httpd, php

HomeBlogphp → Setting up Apache (httpd), PHP with APC on an Amazon AWS Basic AMI
Share/Bookmark
From our Design blog

How we built the Horlicks WizKids website

Horlicks WizKids is South Asia's largest interschool fiesta with over 200,000 children...

HTML and CSS tricks for good website design

Even the most experienced and best CSS/HTML designer out there does not have the vast myriad sets...

HTML 5: The future of rich-media web

In the ever-changing world of the web, its surprising to see how long HTML 4.x has held on to its...

From our Apps blog

Calculate your Amazon AWS Hosting Costs using Excel

One of the most common questions that come up whenever we recommend Amazon AWS as a hosting...

Drupal in the Amazon AWS Cloud

Recently, we worked on and delivered a user voting web application, hosted on the Amazon Web...

Apache (httpd) and lighttpd on an Amazon AWS Basic AMI

Over the last couple of days we did some intensive work on comparing execution of a complex...

Setting up Apache (httpd), PHP with APC on an Amazon AWS Basic AMI

Disclaimer #1: This post is more of an online reference for me to be able to set up an Apache web server and PHP with Alternative PHP Cache (APC) enabled on a basic Amazon Web Services AMI (clean Linux box). Most of the commands don't have explanations -- I'm sure you'll be able to understand more by issuing "man <command>" at the Linux prompt.

Disclaimer #2: Commands provided here may be time sensitive if some apps or paths are changed over the due course of time. Don't leave a comment that something's not working if you're viewing this in 2015 :)

The commands

This post assumes that you are able to log into the Amazon AWS console, create instances and log in via SSH to those instances you've created. The commands below are all typed into an SSH terminal as root. None of the outputs have been recorded (including the prompt) -- makes it easy to copy off the commands one-by-one instead of scanning through the output to find the next command to copy.

yum -y install httpd
yum -y install httpd-devel
yum -y install mysql
yum -y install mysql-server
yum -y install php
yum -y install php-mysql
yum -y install php-devel
yum -y install php-gd
yum -y install php-xml
yum -y install php-bcmath
yum -y install php-xmlrpc
yum -y install php-pear

Before installing APC, the following may be needed. Its safe to try the APC installation before you install the modules below. If the APC installation fails, you can run the commands below to see if it'll help:

yum -y install pcre
yum -y install pcre-devel

To install APC, run the commands below:

pear install pecl/apc

Post installation commands: This ensures that Apache and MySQL run during startup if you ever reboot or stop/start your Amazon instance.

chkconfig httpd on
chkconfig mysqld on

Check if Apache and MySQL are scheduled to run at startup:

chkconfig --list

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <h2> <img>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Make the web work for you!

If you're a business owner who wants to use the web as a major foundation, look no further. If you're looking for a great, dynamic web presence handling all major aspects of your operations, get in touch with us today...