Monday, April 28, 2008

How to install Magento from scratch

This page is written for reference to install Magento software in a system starting from the scratch.

System Requirements:
Apache 2.2 or higher server
PHP 5.2.5
MySql server.

Installing and configuring Apache 2.2 software. The installation file for Apache 2.2.8 version is provided at http://httpd.apache.org/download.cgi.

The Apache 2.2.8 server for windows is required for a virtual in-house server to be run on a system. This enables to test and experience the functionalities and features of the solution.
While installing, the setup will prompt for a Domain Name Server. Type localhost to ensure that your system only is acting as a server.
This will install Apache 2.2.8 server into the system.

To start the server, one needs to know of the location in which the server is installed. Go to the location of the server folder.
It is usually “C:\Program Files\Apache Software Foundation\Apache2.2\bin” in the command prompt. Type “httpd.exe” excluding the double quotes.
Now the server will look for a domain or the host which is set at the installation. If not found the server uses the present system itself as a default.

Uploading files onto the server: Locate the folder named htdocs in Apacha2.2 folder.
The folder displays all the documents that need to be there for display on the browser.
“Index.html “ is a test page given for testing the server’s action.

Go to internet browser and type: http://localhost:8080/index.html. The page shows that the server is working.
This completes the installation and configuration of Apache server 2.2

Installing and configuring PHP 5.2.5
Download site for PHP 5.2.5 is http://www.php.net/downloads.php Get the msi installation file for easy setup.
Magento needs support of PHP to execute certain scripts. Basic Apache server supports only html. Hence it needs to be enhanced with PHP to run certain modules and files in Magento.
The installer will ask for the type of server to be looking for to enable the inclusions. Select Apache 2.2 from the list. The setup will usually configure itself to be included in the server. Try to locate the download as “C:\PHP\” which makes life easier as the configuration file has the default location as that only.


Go to php.ini file in the php folder and open with Wordpad

Look for Short_open_tag and set it to On.
Look for magic_quotes_gpc and set it to On.
Look for display_errors and set to On.
Look for extension_dir and type as extension_dir=”c:\php\ext\”
Look for extension= statements in the file and remove the semicolon(;) for the following files:
Php_pdo_mysql.dll
Php_mcrypt.dll
Php_curl.dll
This specific requirement is for magento to run.

This finishes configuring PHP for apache server.

Apache server configuring.
Locate the file httpd.conf in Apache2.2/conf folder. Open it with Wordpad or any text editor.
Look for LoadModule statements and add
LoadModule php5_module “C:/php/php5apache2_2.dll” at the end of these statements.
Look for AddType statements in the file.
Type: AddType application/x-httpd-php .php
Don’t forget the space after the pre-final “php” and the “.” After that.
Ensure PHPIniDir “c:/php”. This will be the location of the folder php.
Look for DirectoryIndex in the file and update it to
DirectoryIndex index.php index.html
Restart the apache server and run the test php file.
All the files to be located in htdocs folder only.

Refer to http://www.thesitewizard.com/php/install-php-5-apache-windows.shtml for configuring both PHP and Apache to be linked.

This will complete the configuration and linking of both apache server and PHP.

MySql Server Installation and configuring:
Download Mysql 5.0.51b fromhttp://dev.mysql.com/downloads/mysql/5.0.html. Download the community server for windows.

Get the zip file for installation from any of the download sites. Unzip the file and installation will ask for the username and configuration setup. A standard setup will suffice the settings. The port number for the sql server is 3306. This will be required for further installation of magento. Remember the password of the sql for further usage.
Once the SQL is installed, go to Programs>Mysql> mysql. This will start a command prompt with my sql collan. The password given will be the password for the root.
Type CREATE DATABASE magento.
This will create the database with name magento.

4.Installing and setting Magento:
Download from http://www.magentocommerce.com/download and the file name is "magento-1.0.19700.zip"
Download the msi setup file for Magenta’s latest version. All the files and setup is to be shifted to htdocs folder of apache. Now run both apache and mysql server.
Type http://localhost:8080/install.php in the address bar. An installation guide will take you to the rest of the steps in Magento. Note that this works only once for the system
The last page of installation will ask the user to move to either frontend or the backend of the software. Please store the last page for any reference or if anything goes wrong. Frontend represents the usual look and feel of a customer on the site. All the items/articles/goods for sale and discount/offers/ carts/shopping lists etc will be visible in the front end.
The backend goes to the administrative part of the system where one can manage with the admin account all the access to change the way the front end looks.It involves adding catalogues, products, product types etc.
This completes the installation of Magento.
How to restart Magento:
Once the server is shutdown, the access to the frontend and the backend of Magento is not known.
Heres how:
Start apache server as well as mysql server.
Open the browser and type http://localhost:8080/magento/index.php
this will take you to the front end of the application
To open in admin's account, type http://localhost:8080/magento/index.php/admin
This will go to the admin's login page and further accessed.
Happy Developping.

Problems:
1. Not able to see index.php file (shows cannot find server)
This usual problem is mainly due to the change of parameters in mage.php which index.php refers to. The only solution being to replace the whole magento setup.
Delete all the files related to magento in the htdocs folder.
Go to sql server and type "drop database magento"
This will delete the database magento which was appended by magento. Again create another database by name magento which has no values.
Install all the files from magento setup to htdocs folder of apache server.
Redo the same steps for installation of magento (From step 4)
This will fix the problem

No comments: