Actions

Help

Difference between revisions of "Install:Quick Install Magento"

From OpenLiteSpeed Wiki

Line 15: Line 15:
  
 
If you are not using RedHat or CentOS, or you prefer to build PHP by yourself, see our [[Help:Building PHP for Magento|instructions for building PHP for Magento]] here.
 
If you are not using RedHat or CentOS, or you prefer to build PHP by yourself, see our [[Help:Building PHP for Magento|instructions for building PHP for Magento]] here.
 
==== Build PHP ====
 
:Setup build environment:
 
<blockquote><code>yum install curl-devel libmcrypt-devel</code></blockquote>
 
 
Build PHP (5.3.24, for example) with additional modules.
 
Go to the WebAdmin Console > Actions > Compile PHP.
 
<blockquote><pre>'--with-mysqli' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-sockets'
 
'--enable-sysvsem' '--enable-sysvshm' '--enable-mbstring' '--with-iconv' '--with-mysql'
 
'--with-libdir=lib64' '--with-mcrypt' '--with-curl' '--with-pdo' '--with-pdo-mysql'</pre></blockquote>
 
:: '''Note:''' '--with-libdir=lib64' is for x86_64 systems.
 
  
 
==== Download Magento ====
 
==== Download Magento ====

Revision as of 19:26, 12 November 2014

After you download and install OpenLiteSpeed, follow the instructions below to get your Magento site working.

Install PHP modules

The easiest way to install PHP for OpenLiteSpeed is through our CentOS repository. If the LiteSpeed Repository was not installed and enabled during the web server installation, follow this guide to install and enable the LiteSpeed Repository.

Use the following command to install PHP with the modules required:

yum install lsphp55 lsphp55-common lsphp55-gd lsphp55-process lsphp55-mbstring lsphp55-mysql
Note: There are four versions of LSPHP (lsphp53, lsphp54, lsphp55, lsphp56) available.

Direct LSWS to the location of the installed PHP. (In this example, PHP 5.5 is installed by default in /usr/local/lsws/lsphp55/bin/lsphp. Change the value of the WebAdmin console > External App > your external application > Command setting to reflect that.)

If you are not using RedHat or CentOS, or you prefer to build PHP by yourself, see our instructions for building PHP for Magento here.

Download Magento

Put Magento in a subdirectory of the virtual host /usr/local/lsws/DEFAULT/html/magento (This puts all the files in the right directory for running Magento on the virtual host "Example".)
cd /usr/local/lsws/DEFAULT/html
wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz
tar -zxvf

Change ownership of all files in the Magento directory so that the web server has write permission during installation

chown -R nobody /usr/local/lsws/DEFAULT/html/magento

Set up Magento on a vhost

(Here we use the default virtual host "Example".)
Go to the WebAdmin Console > Configuration > Virtual Hosts > Example > General > Index Files.
Add "index.php".

Set up a MySQL database for Magento

The Magento site does not have instructions for this, but a good example can be found on the WordPress site: http://codex.wordpress.org/Installing_WordPress#Detailed_Instructions

Add the following rewrite rules in your virtual host settings to make Magento work

Go to the WebAdmin console > Virtual Hosts > Example > Rewrite.
Enable Rewrite > Yes.
Rewrite Rules >
Note: These rewrite rules are taken directly from the official Magento site. Any questions about them would be best directed to Magento forums. These rules are also written for installation in the subdirectory "magento". If you are installing in the docroot, remove "magento" from the rules containing it (such as "RewriteBase /magento ==> RewriteBase /", "RewriteRule .* /magento/index.php [L] ==> RewriteRule .* /index.php [L]").
============>8============
    RewriteBase /magento

############################################
## Uncomment out the next line to enable light API calls processing

#    RewriteRule ^/api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]

############################################
## Rewrite API2 calls to api.php (by now it is REST only)

    RewriteRule ^/api/rest api.php?type=rest [QSA,L]

############################################
## Workaround for HTTP authorization in the CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks

    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]

############################################
## Redirect for mobile user agents

    #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
    #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
    #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]

############################################
## Always send 404 for missing files in these folders

    RewriteCond %{REQUEST_URI} !^/magento/(media|skin|js)/

############################################
## Never rewrite for existing files, directories, and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## Rewrite everything else to index.php

    RewriteRule .* /magento/index.php [L]

============>8============

Graceful restart

So the changes will take effect (Actions > Graceful Restart).

Run the set up wizard

Point your browser to http://server_ip:8088/magento and follow the instructions