What Is Project Management?

An official definition of project management, courtesy of the Project Management
Institute, defines the term as: “the application of knowledge, skills, tools and techniques
to project activities to meet project requirements.”1
A more tangible (but less interesting) description is that project management is
everything you need to make a project happen on time and within budget to deliver
the needed scope and quality.

In order to really get our heads around these definitions, we need to discuss some
of the terms. A project is distinguished from regular work in that it’s a one-time effort
to change things in some way. So the creation of a new web site would be a project;
ongoing maintenance and minor updates would not.
Time and budget are familiar terms—perhaps the project is intended to take six
weeks and have a budget of $20,000. Scope refers to the list of deliverables or features
that have been agreed—this is where the scale of the required solution is identified.
For instance, creating a new web site for the company may realistically be possible
in six weeks, but rewriting all the accounting software isn’t. Quality is exactly what
it says on the tin, but in project-speak, quality may include not only the quality of
the finished product, but also the approach. Some industries require that particular
quality management approaches be used—for instance, factories producing automotive
parts have to meet particular international standards.


These four aspects (time, budget, scope, and
quality) make up what’s known as the balance
quadrant, which is pictured in Figure 1.1. The
balance quadrant demonstrates the interrelationship
between the four aspects and how a change
to one aspect will unbalance the quadrant. For
instance, an increase in the project’s scope will
have an impact on the time, the cost, and the
quality of the project.2 In practice, any project
decision you or your clients make will have an
impact on these four aspects—will it make the
project more expensive, take longer, be of lower
or higher quality, or affect its scope? Figure 1.1. The balance quadrant
Essentially, project management is a set of skills and tools that will help you get
the project right in every way.

Planning, Executing, and Managing Projects

1. Planning, Executing, and Managing Your Project

Most students have no idea how to begin their project. This is understandable: it is the
first time they will have had to tackle a large amount of work that is probably poorly
defined (the project descriptions provided by lecturers are rarely complete!) To get
started, it helps to know the key activities that result in a successful project. They are:
1. Problem identification
2. Requirements elicitation
3. Problem modelling
4. System analysis and specification
5. System design
6. Module implementation and system integration
7. System test and evaluation
8. Documentation
9. Project management

1.1 Problem Identification

Problem Identification involves a lot of background work in the general area of the
problem. Normally it calls for the use of prior experience, typically experience you may
not yet have. It requires an ability to look at a domain (e.g. telecommunications or
engine control) and to identify the issue that needs to be addressed and the problem to
be solved (e.g. elimination of noise or cross-talk on a communication channel, or
engine control for temperature-dependent fuel efficiency). It also required an
understanding of the theoretical issues by which we can model the problem. So, the
first thing you need to do in your project is become an expert in the problem at hand: a
problem-domain expert.

At the same time, you also need to know how to handle the tools that will enable you to
solve the problem. These might include the operating system, the programming
language, the application programming interface (API) definitions, class libraries,
toolkits, or any application-specific analysis utilities. That is, you also need to become
a solution-domain expert.
The only way to become an expert in both the problem domain and the solution
domain is to learn as much as possible about the area and to learn it as quickly and
efficiently as possible. Many people come unstuck at this first step and they launch
themselves into a frenzy of unstructured research, reading much but learning little.
Here are some tips to avoid this happening.
􀂉 Collect any papers, articles, book chapters you can on the area and make a copy
for your own personal archive.
􀂉 Make sure you keep a full citation index, i.e., you must record exactly where every
article you copy comes from. Typically, you need to record the title of the article,
the authors, the name of the magazine/journal/book, the volume and number of
the journal or magazine, and the page numbers. If it’s a chapter in a book and the
author of the chapter is different from the editor of the book, you need to record
both sets of names.
􀂉 Not all the articles you collect will be equally relevant or important. Consequently,
it’s not efficient to give each of them the same attention. But it’s not easy to know

how relevant it is until you read it. So how do you proceed? To solve this dilemma,
you should know that there are three levels of reading:
1. Shallow Reading: you just read the article quickly to get an impression of the
general idea. Read it twice. This should take a half-an-hour to an hour.
2. Moderate Reading: Read the article in detail and understand all of the main
concepts; this will probably require you to read it several times and take a
couple of hours to assimilate.
3. Deep Reading: Here you make an in-depth study of the article. This may take
you several hours or even a couple of days. After many careful readings, you
should know as much about the topic as the author.
The way to proceed with your ‘reading in’ is to
♦ Shallow read everything and write a 5-line summary of the article
♦ If you think the article is directly relevant to your project, label it, and put it on
a list of articles to be read at the next level, i.e. Moderate Reading.
♦ Read all the labelled articles and write a 1-page summary.
♦ If the article is going to be used directly in the project, e.g. as a basis for a
hardware design or a software algorithm, then you need to add it to your list of
articles to be read at the next level, i.e. Deep Reading.
♦ Read all the Deep-Read articles and write extensive notes on them.

Note that the ‘reading in’ phase of the project can last quite a long time (there’s a lot of
reading and writing to be done) and it can overlap partially with some of the other early
tasks, such as requirement elicitation, the topic of the next section.
Finally, it is very important that you realize that, in order to fully understand anything
that you read, you must write it up in your own words. If you can’t express or speak
about a given idea, then you haven’t truly understood it in any useful way. This is so
important that it’s worth saying a third time:
Writing is an Essential Part of Understanding
This is why, in all of the above guidelines, you see recommendations to write things

top vegetables for Diet

Vegetables are any flowers, seeds, leaves, buds,
stems, tubers, or roots that can be eaten. A diet
high in vegetables reduces the risk of chronic
diseases including cardiovascular diseases, diabetes,
hypertension, stroke, Alzheimer’s, digestive
disorders, cataracts, and cancer. Vegetables are rich
sources of vitamins, minerals, protein, carbohydrates,
and fiber and contain a relatively new category of
nutrients called phytonutrients or phytochemicals.
These are found in all vegetables and have
antioxidant, antibacterial, antifungal, antiviral, and
anticarcinogenic properties, depending on the plant.
The highest concentrations of phytochemicals are
found in vegetables with rich colors, intense flavors,
and enticing aromas. Brief steaming or rapid boiling
in the least possible amount of water results in the
smallest loss of nutrients. Notable exceptions are
tomatoes and carrots—their nutrient levels are
increased with cooking

1.Avocado(14 g fiber/medium)

A favorite of the Aztecs, the avocado is native
to Central America, with evidence of avocado
cultivation in Mexico for thousands of years.
Avocados were first cultivated in the United States
in the mid-1800s. California produces nearly 90% of
the domestic crop.
Avocados will not ripen on the
tree. This delay in ripening is a
boon to growers, who can
leave avocados on the
tree for up to 7 months
if market conditions
aren’t favorable when
the fruit is first ready
to harvest.

health benefits of avocado

  1. cholesterol-lowering food, second
    only to olives in monounsaturated
    (good) fat
  2. contains lots of heart-healthy
    folate and oleic acid
  3. rich in E, K, and B vitamins, with more
    potassium than bananas
  4. helps guard against high blood
    pressure, heart disease, and stroke



Broccoli is native to the shores of the Mediterranean.
The Italians were the first to cultivate broccoli, and it
quickly became a favorite food in ancient Rome.
It was introduced to France in the 1500s, and
then to England in the mid-18th century.
Broccoli arrived in America during
colonial times. George Washington
and Thomas Jefferson both grew
it in their kitchen gardens.
California and Arizona
produce 99% of the U.S.
broccoli crop.

health benefits of broccoli

  1. supplies vitamin C, necessary for
    building healthy blood vessels and
  2. prevents anemia by enhancing the
    absorption of iron from other foods
  3. assists in making thyroxin, which
    regulates the metabolic rate
  4. a gold mine of potent cancer-fighting
    chemicals such as beta carotene


Spinach was the favorite vegetable of Catherine
de Medici during the Renaissance. When she left
Florence, Italy, to marry the king of France,
she brought along her own cooks so they
could prepare spinach in the ways she
preferred. Since that time, dishes
prepared on a bed of spinach are
referred to as “à la Florentine.”
The United States and the
Netherlands are the largest
producers of spinach.
Varieties include baby
spoon, flat or smooth leaf,
red, savoy, and semi savoy.

health benefits of spinch

  1. calorie for calorie, provides more
    nutrients than any other food
  2. high in lutein, a carotenoid that
    protects against macular degeneration
    and cataracts
  3. an excellent source of iron, especially
    important for women
  4. reduces symptoms of asthma,
    osteoarthritis, osteoporosis, and
    rheumatoid arthritis

4.sweat patato(4g/cop)

Sweet potatoes aren’t related to white potatoes at
all, but are in the morning glory family. One of the
oldest known vegetables, the sweet potato is native
to the New World and has been found in pre-Incan
ruins in Peru. Columbus brought sweet potatoes
to Europe after his first voyage in 1492. They
were a popular aphrodisiac
in Shakespeare’s day.
North Carolina is
the leading sweet
potato producer in
the U.S., followed
by California,
Louisiana, and

health benefits of sweat patatoes

  1. ranked by food scientists as the most
    nutritious of all vegetables
  2. excellent source of minerals such
    as potassium, iron, manganese, and
  3. a perfect blend of everything needed
    for long-lasting energy
  4. abundant in the “cancer-fighting
    ninjas”—quercetin and chlorogenic acid


Carrots were esteemed for their medicinal value
prior to the time of Christ. Settlers arriving in
Virginia were the first to bring carrot seeds to
America. Originally, purple carrots came from the
region now known as Afghanistan 5000 years ago.
Beta III carrots have 5 times the beta carotene of
regular carrots. Maroon carrots are sweeter than
regular carrots and have a porous texture like
celery or apples. Look for leafy tops that
are crisp and green, an indication of

health benefits of carrots

  1. supplies calcium pectate, a soluble
    fiber that helps remove LDL (bad)
    cholesterol from the body
  2. high in beta carotene, from which the
    body makes vitamin A
  3. very low in calories, with virtually no
    fat—a superlative diet food
  4. antioxidant and anti-cancer
    properties in beta carotene

top 5 fruits for Diet(how to be healthy)

Most fruits develop from a plant’s flower. There
are thousands of fruits. Most taste sweet, are low
in calories, and have virtually no fat. Fruits deliver
a combination of sugars—fructose, glucose, and
sucrose—in varying proportions. Fructose is the
principal sugar and is the sweetest, although sucrose
(common table sugar) is the main sugar in fruits like
oranges, melons, and peaches. The calorie content of
fruit is kept low by water, which makes up 80–95% of
most fruits and gives them their refreshing juiciness.
Ripeness is the key to good fruit. As fruit ripens,
its color changes, the vitamin content increases,
acidic content decreases, and the starch changes to
sugar, giving fruit its mild, sweet flavor and aroma.
These changes are caused by enzymes that continue
to act on the fruit even after harvesting. Fruit has
excellent nutritional value and touches the human
spirit, fostering joy and happiness through rich
tastes and beautiful colors.

1.Raspberries/Blackberries (8 g fiber/cup)

There are more than 200 species of raspberries
grown from the Arctic to the equator. They range in
color from yellow to orange to red, purple, and black.
Fragrantly sweet and with a subtle, tart overtone,
raspberries are a taste sensation. Technically,
both the raspberry and blackberry are
aggregate fruits—each berry
a collection of dozens
of tiny fruits. As
bramble fruits,
raspberries and
are members
of the rose

Health Benefits of  blackberry

  1. 1abundant vitamin C protects body
    against oxidative damage
  2. rich source of vitamin B (folate) to guard against heart disease
  3. fiber content of raspberries and
    blackberries is twice that of
  4. anthocyanin pigments provide antiinflammatory
    and antioxidant benefits

2.Pears(6g fiber/medium)

The pear’s delicate flavor and buttery texture
have earned it the nickname “butter fruit” in Europe.
The Greeks loved pears so much that Homer refers
to them in The Odyssey.
Pears are picked unripe; if
left to ripen on the tree,
they will have a gritty texture.
Pears need to be soft to attain
optimum flavor. To speed
ripening, place pears in a
perforated bag, turning
frequently to ensure
even ripening. There
are more than 5,000
varieties of pears.

Health Benefits of  pears

  1. rich source of vitamin A, known to
    be good for visual acuity, immune
    function, and healthy skin
  2. high vitamin C content acts as
    antioxidant and bolsters immune
  3. contains vitamins and nutrients
    especially good for health of bones
    and skin
  4. known as one of the most
    hypoallergenic foods, those least likely
    to produce allergic reactions


3.Apples(4g fiber/medium)

With about 7500 varieties worldwide, apples
are among the most widely consumed fruits on
earth, second only to the banana in America.
Most of the 2500 varieties grown
in the U.S. are hybrids of the apples
first brought to America by early
colonists who established orchards
in Massachusetts and Virginia.
Johnny Appleseed was a real
person who traveled America
in the early 1800s planting
apple seeds as he went.
(His real name was
Johnny Chapman.)
Apples float because
25% of their
volume is air.

Health Benefits of  apple

  1. contains quercetin, a strong antioxidant
    and anti-inflammatory flavonoid
  2. one of the best foods available to ward
    off cancer and harmful viruses
  3. high fructose content requires less
    insulin to digest, forestalling diabetic
  4. fibrous, juicy, and nonsticky, apples
    are excellent for health of teeth
    and gums

4.Oranges(3 g fiber/medium)

of the most popular fruits in the world, the
orange is actually a modified berry with a tough,
leathery rind. Rarely found in cooler climates, it was
long considered a rare and expensive delicacy. Like
all citrus fruits, the orange is acidic, with a pH
level of around 2.5 to 3—as strong as vinegar,
though not as strong as the lemon.
Americans consume most of their
oranges in the form of juice. This
processing removes most, or
all, of the fiber.

Health Benefits of  orrange

  1. high in herperidin, a flavonone
    thought to lower high blood pressure
    and cholesterol
  2. ich in flavonoids that inhibit blood
    clotting and guard against stroke
  3. full of limonoids, compounds
    that fight cancers of the entire
    digestive tract
  4. with over 170 phytonutrients, a
    rich source of daily nutritional


5.Bananas(3g fiber/medium)

Americans eat more bananas than any other fruit—
about 33 pounds per person annually. Although
there are more than 500 varieties of bananas, most
bananas sold in the U.S. are of the Cavendish variety.
Banana trees aren’t really trees, botanically speaking,
but are classified as the world’s largest herb,
Musa sapientium. Bananas were introduced
to the United States in 1876 at its first
centennial celebration.

Health Benefits of  banana

  1. rich in vitamin B6, which improves
    mental function and performance
  2. helps stimulate production of
    serotonin, elevating mood and
    alleviating depression
  3. a well-known source of potassium,
    excellent for lowering blood pressure
    and plaque in blood vessels
  4. concentrated source of carbohydrates
    for quick energy and endurance


What is EAV within magento?

In order to understand what EAV is and what its role within Magento is, we need to
break down it into the parts of the EAV model.

• Entity: The entity represents the data items (objects) inside Magento
products, customers, categories, and orders. Each entity is stored in the
database with a unique ID.
• Attribute: These are our object properties. Instead of having one column per
attribute on the product table, attributes are stored on separates sets of tables.
• Value: As the name implies, it is simply the value link to a particular attribute.
This design pattern is the secret behind Magento’s flexibility and power, allowing
entities to add and remove new properties without having to do any changes to the
code or templates.
Whereas model can be seen as a vertical way of growing our database (new
attributes add more rows), the traditional model would involve a horizontal grow
pattern (new attributes add more columns) that would result in a schema redesign
every time new attributes are added.
The EAV model not only allows the fast evolution of our database, but also, it is
more efficient, because it only works with non-empty attributes, avoiding the need
to reserve additional space in the database for null values.
Adding a new product attribute is as simple as going to the Magento backend
and specifying the new attribute type, be it color, size, brand, and so on. The
opposite is also true, because we can get rid of unused attributes on our products
or customer models.
Magento Community Edition currently has eight different types of EAV objects:
• Customer
• Customer address
• Products
• Product categories
• Orders
• Invoices
• Credit memos
• Shipments

All this flexibility and power is not free, and there is a price to pay; implementing the
EAV model results in having our entity data distributed on a large number of tables,
for example, just the Product Model is distributed on around 40 different tables.
The following diagram only shows a few of the tables involved in saving the
information of Magento products:

Another major downside of EAV is the loss of performance when retrieving large
collections of EAV objects and an increase on the database query complexity.
Since the data is more fragmented (stored in more tables), selecting a single record
involves several joins.
Let’s continue using Magento products as our example and manually build the query
for retrieving a single product.


The first table that we will need to use is the catalog_product_entity. We can
consider this as our main product EAV table since it contains the main entity recordsfor our products:

Let’s query the table by running the following SQL query:
SELECT * FROM `catalog_product_entity`;
The table contains the following fields:
• entity_id: This is our product unique identifier and is used internally
by Magento.
• entity_type_id: Magento has several different types of EAV models,
products, customers, and orders, and these are just some of them. Identifying
each by type allows Magento to retrieve the attributes and values from the
appropriate tables.
• attribute_set_id: Products attributes can be grouped locally into attribute
sets. Attribute sets allow even further flexibility on the product structure
since products are not forced to use all available attributes.
• type_id: There are several different types of products in Magento: simple,
configurable, bundled, downloadable, and grouped products, each with
unique settings and functionality.
• sku: Stock Keeping Unit (SKU) is a number or code used to identify each
unique product or item for sale in a store. This is a user-defined value.

• has_options: This is used to identify if a product has custom options.
• required_options: This is used to identify if any of the custom options
are required.
• created_at: This is a row creation date.
• updated_at: This shows the last time the row was modified.
Now we have a basic understanding of the product entity table, and we also know
that each record represents a single product in our Magento store, but we don’t have
much information about that product beyond the SKU and the product type.
So, where are the attributes stored? And how does Magento know the difference
between a product attribute and a customer attribute?
For that, we need to take a look at the eav_attribute table by running the following
SQL query:
SELECT * FROM `eav_attribute`;
As a result, we will not only see the product attributes but also attributes
corresponding to the customer model, order model, and so on. Fortunately,
we already have a key for filtering the attributes from this table. Let’s run the
following query:
SELECT * FROM `eav_attribute`
WHERE entity_type_id = 4;
This query is telling the database to only retrieve the attributes where the
entity_type_id columns are equal to the product entity_type_id(4). Before
moving on, let’s analyze the most important fields inside the eav_attribute table:
• attribute_id: This is the unique identifier for each attribute and primary
key of the table.
• entity_type_id: This field relates each attribute to a specific EAV
model type.
• attribute_code: This field is the name or key of our attribute and is used to
generate the getters and setters for our magic methods.
• backend_model: The backend model manages loading and storing data into
the database.
• backend_type: This field specifies the type of value stored into the
backend (database).
• backend_table: This field is used to specify if the attribute should be stored
on a special table instead of the default EAV tables.

• frontend_model: The frontend model handles the rendering of the attribute
element into a web browser.
• frontend_input: Similar to the frontend model, the frontend input specifies
the type of input field the web browser should render.
• frontend_label: This field is the label/name of the attribute as it should be
rendered by the browser.
• source_model: The source models are used to populate an attribute with
possible values. Magento comes with several predefined

Understanding and Setting Up Magento Development Environment

Getting VirtualBox

VirtualBox is open source, and it is supported across all platforms. It can be
downloaded directly from www.virtualbox.org/wiki/Downloads.
Now, we will proceed to setting up a Linux virtual machine. We have selected
Ubuntu Server 12.04.2 LTS for its ease of use and widely available support. First,
download the ISO file from www.ubuntu.com/download/server; both 64-bit and
32-bit versions will work.

To create a new Linux virtual machine, perform the following steps:
1. Start VirtualBox Manager and click on the New button in the upper-left corner, as shown in the following screenshot:

2. A wizard dialog will pop up and will guide us through the steps for creating
a bare virtual machine. The wizard will ask us for the basic information for
setting up the virtual machine:
*  VM Name: How shall we name our virtual machine? Let’s name it
Magento_dev 01.
*  Memory: This is the value of system memory that will be assigned
to the guest operating system when our VM starts; for running a full
LAMP server, 1 GB or more is recommended.

°° Operating System Type: This is the type of OS that we will be
installing later; in our case, we want to select Linux/Ubuntu, and
depending on our selection, VirtualBox will enable or disable certain
VM options.
3. Next, we need to specify a virtual hard disk. Select Create a virtual hard
drive now, as shown in the following screenshot:


4. There are many hard disk options available, but for most purposes, selecting
VirtualBox Disk Image (VDI) will suffice. This will create a single file on our
host operating system.
5. We now need to select the type of storage on the physical drive. We are
provided with the following two options:
°° Dynamically Allocated: The disk image will grow automatically as
the number of files and usage on our guest operating system grows
°° Fixed Size: This option will limit the size of the virtual disk from
the start
6. Next, we will need to specify the size of our virtual hard disk. We want
to adjust the size depending on how many Magento installations we
plan to use.

The newly created box will appear on the left-hand side navigation menu,
but before starting our recently created VM, we need to make some changes,
as follows:
i. Select our newly created VM and click on the Settings button at
the top.
ii. Open the Network menu and select Adapter 2. We will set
Attached to to Bridged Adapter as we want to set this up as a
bridged adapter to our main network

iii. Go to the System menu and change the boot order so that the
CD/DVD-ROM boots first.
iv. On the Storage menu, select one of the empty IDE controllers and
mount our previously downloaded Ubuntu ISO image.

Booting our virtual machine

At this point, we have successfully installed and configured our VirtualBox instance,
and we are now ready to boot our new virtual machine for the first time. To do this,
just select the VM in the left sidebar and click on the Start button at the top.
A new window will pop up with an interface to the VM. Ubuntu will take a few
minutes to boot up.

Once Ubuntu has finished booting up, we will see two menus. The first menu
will allow us to select the language, and the second one is the main menu, which
provides several options. In our case, we just want to proceed with the Install Ubuntu Server option.

We should now see the Ubuntu installation wizard, which will ask for our language
and keyboard settings; after selecting the appropriate settings for our country and
language, the installer will proceed to load all the necessary packages in memory.
This can take up a few minutes.
Ubuntu will proceed to configure our main network adapter, and once the automatic
configuration is done, we will be asked to set up the hostname for the virtual
machine. We can leave the hostname to default settings.

The next screen will request us to enter the full name of our user; for this example,
let’s use Magento Developer:

Next, we will be asked to create a username and password. Let’s use magedev as
our username:

And let’s use magento2013 as our password:

On the next screens, we will be asked to confirm our password and set up the
correct time zone; after entering the right values, the installation wizard will
show the following screen asking about our partition settings:


In our case, we select Guided – use entire disk and set up LVM; let’s now confirm
that we are partitioning our virtual disk:

We will be asked to confirm our changes a final time; select Finish partitioning and
write changes to disk,

The installation wizard will ask us to select predefined packages to install; one of the
options available is LAMP server.
Although this is highly convenient, we don’t want to install the LAMP server that
comes pre-packaged with our Ubuntu CD; we will be installing all the LAMP
components manually to guarantee that they are set up according to specific needs
and are up to date with the latest patches.
Next, for this, we will need an SSH server; select OpenSSH server from the list and
click on Continue:

Now, installation of Ubuntu is complete and it will reboot into our newly installed
virtual box.
We are almost ready to proceed with the installation of the rest of our environment,
but first we need to update our package manager repository definitions, log in to the
console and run the following command:
$ sudo apt-get update
APT stands for Advanced Packaging Tool and is one of the core libraries included
with most Debian GNU/Linux distributions; apt greatly simplifies the process of
installing and maintaining software on our systems.
Once apt-get has finished updating all the repository sources, we can proceed with
the installation of the other components of our LAMP server.

Installing Apache2

Apache is an HTTP server. Currently, it is used to host over 60 percent of the
websites on the Web and is the accepted standard for running Magento stores.
There are many guides and tutorials available online for fine-tuning and tweaking
Apache2 for increasing Magento performance.
Installing Apache is as simple as running the following command:
$ sudo apt-get install apache2 -y
This will take care of installing Apache2 and all the required dependencies for us. If
everything has been installed correctly, we can now test by opening our browser and
Apache by default runs as a service and can be controlled with the following commands:
$ sudo apache2ctl stop
$ sudo apache2ctl start
$ sudo apache2ctl restart
You should now see Apache’s default web page with the message It Works!.

Installing PHP

PHP is a server-side scripting language and stands for PHP Hypertext Processor.
Magento is implemented on PHP5 and Zend Framework, and we would need to
install PHP and some additional libraries in order to run it.
Let’s use apt-get again and run the following commands to get php5 and all the
necessary libraries installed:
$ sudo apt-get install php5 php5-curl php5-gd php5-imagick php5-imap
php5-mcrypt php5-mysql -y
$ sudo apt-get install php-pear php5-memcache -y
$ sudo apt-get install libapache2-mod-php5 -y
The first command installed, not only php5, but also additional packages required by
Magento to connect with our database and manipulate images.

Installing MySQL

MySQL is a popular choice of database for many web applications, and Magento is
no exception. We will need to install and set up MySQL as part of development stack
using the following command:
$ sudo apt-get install mysql-server mysql-client -y
During installation, we will be asked to enter a root password; use magento2013.
Once the installer has finished, we should have a mysql service instance running
in the background. We can test it by trying to connect to the mysql server using the
following command:
$ sudo mysql -uroot -pmagento2013
If everything has been installed correctly, we should see the following mysql
server prompt:
At this point, we have a fully functional LAMP environment that can be used not
only for developing and working on Magento websites but also for any other kind
of PHP development.

Putting everything together

At this point, we have a basic LAMP set up and running. However, for working with
Magento, we would need to do some configuration changes and additional setup.
The first thing that we will need to do is to create a location to store our development
site’s files, so we will run the following commands:
$ sudo mkdir -p /srv/www/magento_dev/public_html/
$ sudo mkdir /srv/www/magento_dev/logs/
$ sudo mkdir /srv/www/magento_dev/ssl/
This will create the necessary folder structure for our first Magento site. Now
we need to check out the latest version of Magento. We can quickly get the files
by using SVN.
We would first need to install SVN on our server with the following command:
$ sudo apt-get install subversion -y
Once the installer has finished, open the magento_dev directory and run the svn
command to get the latest version files:
$ cd /srv/www/magento_dev
$ sudo svn export –force http://svn.magentocommerce.com/source/
branches/1.7 public_html/
We will also need to fix some of the permissions on our new Magento copy:
$ sudo chown -R www-data:www-data public_html/
$ sudo chmod -R 755 public_html/var/
$ sudo chmod -R 755 public_html/media/
$ sudo chmod -R 755 public_html/app/etc/
Next, we need to create a new database for our Magento installation. Let’s open our
mysql shell:
$ sudo mysql -uroot -pmagento2013
Once in the mysql shell, we can use the create command, which should be followed
by the type of entity (database, table) we want to create and the database name to
create a new database:
mysql> create database magento_dev;

Although we could use the root credentials for accessing our development database,
this is not a recommended practice to follow because it could compromise not only a
single site but also the full database server. MySQL accounts are restricted based on
privileges. We want to create a new set of credentials that has limited privileges to
only our working database:
mysql> GRANT ALL PRIVILEGES ON magento_dev.* TO ‘mage’@’localhost’
IDENTIFIED BY ‘dev2013$#’;
Now, we need to properly set up Apache2 and enable some additional modules;
fortunately, this version of Apache comes with a set of useful commands:
• a2ensite: This creates symlinks between the vhost files in the
sites-available and the sites-enabled folders to allow the
Apache Server to read those files.
• a2dissite: This removes the symlinks created by the a2ensite command.
This effectively disables the site.
• a2enmod: This is used to create symlinks between the mods-enabled
directory and the module configuration files.
• a2dismod: This will remove the symlinks from mods-enabled directory. This
command will prevent the module from being loaded by Apache.
Magento uses the mod_rewrite module for generating the URLs. mod_rewrite uses
a rule-based rewriting engine to rewrite request URLs on the fly.
We can enable mod_rewrite with the a2enmod command:
$ sudo a2enmod rewrite
The next step will require that we create a new virtual host file under the
sites-available directory:
$ sudo nano /etc/apache2/sites-available/magento.localhost.com
The nano command will open a shell text editor where we can set up the
configuration for our virtual domain:
<VirtualHost *:80>
ServerAdmin magento@locahost.com
ServerName magento.localhost.com
DocumentRoot /srv/www/magento_dev/public_html
<Directory /srv/www/magento_dev/public_html/>
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny

allow from all
ErrorLog /srv/www/magento_dev/logs/error.log
LogLevel warn
To save the new virtual host file, press Ctrl + O and then Ctrl + X. The virtual host
file will tell Apache where it can find the site files and what permissions to give
them. In order for the new configuration changes to take effect, we need to enable
the new site and restart Apache. We can use the following commands to do so:
$ sudo a2ensite magento.localhost.com
$ sudo apache2ctl restart
We are nearly ready to install Magento. We just need to set up a local mapping into
our host system host file by using any of the following:
• Windows
i. Open C:\system32\drivers\etc\hosts in notepad
ii. Add the following line at the end of the file: magento.localhost.com
• Unix/Linux/OSX
i. Open /etc/hosts using nano:
$ sudo nano /etc/hosts
ii. Add the following line at the end of the file: magento.localhost.com