Actions

Help

Difference between revisions of "Install:Quick Install Magento"

From OpenLiteSpeed Wiki

Line 1: Line 1:
After you download and install OpenLiteSpeed, follow the instructions below to get your WordPress site working.
+
After you download and install OpenLiteSpeed, follow the instructions below to get your Magento site working.
 
__TOC__
 
__TOC__
<p><b>1. RPM install</b></p>
+
==== RPM install ====
<p>yum install curl-devel libmcrypt-devel</p>
+
<blockquote><code>yum install curl-devel libmcrypt-devel</code></blockquote>
<p><br></p>
+
 
<p><b>2. Build PHP</b> (5.3.24, for example)</p>
+
==== Build PHP ====
<p>Admin Console =&gt; Actions =&gt; Compile PHP</p>
+
Build PHP (5.3.24, for example) with additional modules.
<p>'--with-mysqli' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-mysql' '--with-libdir=lib64' '--with-litespeed' '--with-mcrypt' '--with-curl' '--with-pdo' '--with-pdo-mysql'</p>
+
Go to the WebAdmin Console > Actions > Compile PHP.
<p>Note: '--with-libdir=lib64' is for x86_64 systems.</p>
+
<blockquote><pre>'--with-mysqli' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-track-vars' '--enable-sockets'  
<p><br></p>
+
'--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-mysql'  
<p><b>3. Download and unpack Magento into /usr/local/lsws/DEFAULT/html/magento</b> (This is a subdirectory of the vhost "Example".)</p>
+
'--with-libdir=lib64' '--with-mcrypt' '--with-curl' '--with-pdo' '--with-pdo-mysql'</pre></blockquote>
<p>cd /usr/local/lsws/DEFAULT/html</p>
+
:: '''Note:''' '--with-libdir=lib64' is for x86_64 systems.
<p>wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz</p>
+
 
<p>tar -zxvf </p>
+
==== Download Magento ====
<p><br></p>
+
: 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".)
<p><b>4. Change ownership of all files in the Magento directory so that the web server has write permission during installation</b></p>
+
 
<p>chown -R nobody /usr/local/lsws/DEFAULT/html/magento</p>
+
<blockquote><pre>cd /usr/local/lsws/DEFAULT/html
<p><br></p>
+
wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz
<p><b>5. Set up Magento on a vhost</b> (Here we use the default virtual host "Example")</p>
+
tar -zxvf</pre></blockquote>
<p>Admin Console =&gt; Configuration =&gt; Virtual Hosts =&gt; Example =&gt; General =&gt; Index Files </p>
+
 
<p>Add "index.php"</p>
+
==== Change ownership of all files in the Magento directory so that the web server has write permission during installation ====
<p><br></p>
+
<blockquote><code>chown -R nobody /usr/local/lsws/DEFAULT/html/magento</code></blockquote>
<p><b>6. Set up a MySQL database for Magento</b></p>
+
 
<p>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</p>
+
==== Set up Magento on a vhost ====
<p><br></p>
+
: (Here we use the default virtual host "Example".)
<p><b>7. Add the following rewrite rules in your virtual host settings</b> (WebAdmin Console =&gt; Virtual Hosts =&gt; Example =&gt; Rewrite =&gt; Rewrite Rules) to make Magento work</p>
+
: Go to the WebAdmin Console > Configuration > Virtual Hosts > Example > General > Index Files.
<p>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 ==&gt; RewriteBase /", "RewriteRule .* /magento/index.php [L]</p>
+
: Add "index.php".
<p> =&gt; RewriteRule .* /index.php [L]")</p>
+
 
<p><br></p>
+
==== Set up a MySQL database for Magento ====
<p>============&gt;8============</p>
+
: 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
<p>    RewriteBase /magento</p>
+
 
<p><br></p>
+
==== Add the following rewrite rules in your virtual host settings to make Magento work ====
<p>############################################</p>
+
: Go to the WebAdmin console > Virtual Hosts > Example > Rewrite.
<p>## Uncomment out the next line to enable light API calls processing</p>
+
: Enable Rewrite > Yes.
<p><br></p>
+
: Rewrite Rules >
<p>#    RewriteRule ^/api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]</p>
+
:: '''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]").
<p><br></p>
+
 
<p>############################################</p>
+
<blockquote><pre>============>8============
<p>## Rewrite API2 calls to api.php (by now it is REST only)</p>
+
    RewriteBase /magento
<p><br></p>
+
 
<p>    RewriteRule ^/api/rest api.php?type=rest [QSA,L]</p>
+
############################################
<p><br></p>
+
## Uncomment out the next line to enable light API calls processing
<p>############################################</p>
+
 
<p>## Workaround for HTTP authorization in the CGI environment</p>
+
#    RewriteRule ^/api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]
<p><br></p>
+
 
<p>    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]</p>
+
############################################
<p><br></p>
+
## Rewrite API2 calls to api.php (by now it is REST only)
<p>############################################</p>
+
 
<p>## TRACE and TRACK HTTP methods disabled to prevent XSS attacks</p>
+
    RewriteRule ^/api/rest api.php?type=rest [QSA,L]
<p><br></p>
+
 
<p>    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]</p>
+
############################################
<p>    RewriteRule .* - [L,R=405]</p>
+
## Workaround for HTTP authorization in the CGI environment
<p><br></p>
+
 
<p>############################################</p>
+
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
<p>## Redirect for mobile user agents</p>
+
 
<p><br></p>
+
############################################
<p>    #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$</p>
+
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
<p>    #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]</p>
+
 
<p>    #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]</p>
+
    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
<p><br></p>
+
    RewriteRule .* - [L,R=405]
<p>############################################</p>
+
 
<p>## Always send 404 for missing files in these folders</p>
+
############################################
<p><br></p>
+
## Redirect for mobile user agents
<p>    RewriteCond %{REQUEST_URI} !^/magento/(media|skin|js)/</p>
+
 
<p><br></p>
+
    #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
<p>############################################</p>
+
    #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
<p>## Never rewrite for existing files, directories, and links</p>
+
    #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
<p><br></p>
+
 
<p>    RewriteCond %{REQUEST_FILENAME} !-f</p>
+
############################################
<p>    RewriteCond %{REQUEST_FILENAME} !-d</p>
+
## Always send 404 for missing files in these folders
<p>    RewriteCond %{REQUEST_FILENAME} !-l</p>
+
 
<p><br></p>
+
    RewriteCond %{REQUEST_URI} !^/magento/(media|skin|js)/
<p>############################################</p>
+
 
<p>## Rewrite everything else to index.php</p>
+
############################################
<p><br></p>
+
## Never rewrite for existing files, directories, and links
<p>    RewriteRule .* /magento/index.php [L]</p>
+
 
<p><br></p>
+
    RewriteCond %{REQUEST_FILENAME} !-f
<p>============&gt;8============</p>
+
    RewriteCond %{REQUEST_FILENAME} !-d
<p><br></p>
+
    RewriteCond %{REQUEST_FILENAME} !-l
<p><b>8. Graceful restart so the changes will take effect</b> (Actions =&gt; Graceful Restart)</p>
+
 
<p><br></p>
+
############################################
<p><b>9. Point your browser to http://server_ip:8088/magento and follow the instructions in the set up wizard</b></p>
+
## Rewrite everything else to index.php
 +
 
 +
    RewriteRule .* /magento/index.php [L]
 +
 
 +
============>8============</pre></blockquote>
 +
 
 +
==== 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
  
 
[[Category:Help]]
 
[[Category:Help]]

Revision as of 16:27, 29 May 2013

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

RPM install

yum install curl-devel libmcrypt-devel

Build PHP

Build PHP (5.3.24, for example) with additional modules. Go to the WebAdmin Console > Actions > Compile PHP.

'--with-mysqli' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-track-vars' '--enable-sockets' 
'--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-mysql' 
'--with-libdir=lib64' '--with-mcrypt' '--with-curl' '--with-pdo' '--with-pdo-mysql'
Note: '--with-libdir=lib64' is for x86_64 systems.

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