329
edits
Changes
Edited for spelling and grammar. Improved content. Added new links.
After you download [[Help:Installation|downloading and install installing OpenLiteSpeed]], follow the instructions below to get your Magento site working. The installation process for Magento 1.x and Magento 2.0 's installation processes are slightly differenct. Please pay attention to different, so please ensure that you are following that steps for the the right version and right stepsyou wish to install.
__TOC__
== Install PHP modules Modules ==
The easiest way to install PHP for OpenLiteSpeed is through our CentOS repository. If the LiteSpeed Repository was not already installed and enabled during the web server installation, follow [http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php:rpm this guide] to install and enable the LiteSpeed Repositorydo so.
Use the following command to install PHP with the required modules required:
<blockquote><pre>yum install lsphp56 lsphp56-common lsphp56-gd lsphp56-process lsphp56-mbstring lsphp56-mysql lsphp56-mcrypt lsphp56-pdo lsphp56-xml lsphp56-intl</pre></blockquote>
:: '''Note:''' There are different versions of LSPHP (lsphp53, lsphp54, lsphp55, lsphp56, lsphp70, lsphp71) available. Please check your magento Magento version for PHP requirmentrequirements.
[http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php:rpm#direct_lsws_to_the_location_of_the_installed_php Direct LSWS to the location of the installed PHPbinary.] (In this example, PHP 5.6 is installed by default in <code>/usr/local/lsws/lsphp56/bin/lsphp</code>. Change In the WebAdmin Console, change the value of the WebAdmin console > '''External App > your external application your_external_application > Command ''' setting to reflect thatthe PHP version you are using.)
If you are not using RedHat or CentOS, or you prefer to build PHP by yourselfmanually, see our instructions on [[Help:Building PHP for Magento|instructions for building Building PHP for Magento]] here.
''For Example:''
memory_limit = 768M
max_execution_time = 18000
session.auto_start = 0
== Set up Up Magento on a vhost On A Vhost ==: (Here we will use the default virtual host "Example".): Go to # In the WebAdmin Console > , navigate to '''Configuration > Virtual Hosts > Example > General > Index Files'''.: # Add "index.php".
== Set up a MySQL database for Magento ==
<blockquote><code>yum install mysql mysql-server</code></blockquote>
service mysql start
mysql -u root -p
mysql>create database magento;
mysql>GRANT ALL ON magento.* TO 'magento'@'localhost' IDENTIFIED BY 'magento';
== Magento 1 Installation ==
=== Download Magento 1 ===
# Register or log in to [https: Put //account.magento.com/customer/account/login/ Magento .com].# [https://magento.com/tech-resources/download Download Magento from their release archive].# copy/ftp the downloaded files into your server's document root. Magento should be put in a subdirectory of the virtual host . For example, <code>/usr/local/lsws/DEFAULTExample/html/magento </code>. (This puts all the files in the right directory for running Magento on the virtual host "Example".)# Using Magento 1.9.3.1 as an example, uncompress the downloaded files with the following command: <code>tar -zxvf magento-1.9.3.1.tar.gz</code>
=== Change Ownership Of All Files In The Magento used Directory ===In order for the web server to provide direct download linkhave write permissions during installation, such as http://www.magentocommerce.com/downloads/assets/1.9.0.1/magento-1.9.0.1.tar.gzbut seems not anymore. you will need ownership of the uncompressed Magento Files must be changed to register a the "nobody" user from https://magento.com/tech-resources/download and download from magento release archiveUsing the "Example" virtual host as an example, then ftp do so with the file to your server document root location.following command:
<blockquote><pre>============>8============
============>8============</pre></blockquote>
'''IMPORTANT :''' These rules are written for installations located in subdirectory "magento". If your Magento installation is located in the server docroot instead of the suggested <code>/magento</code> subdirectory, remove "magento" from the rewrite rules containing it. For example, <code>RewriteBase /magento</code> would become <code>RewriteBase /</code>, and <code>RewriteRule .* /magento/index.php [L]</code> would become <code>RewriteRule .* /index.php [L]</code>. '''Note:''' These rewrite rules are taken directly from Magento's official site. Any questions regarding these rules would be best directed to the [https://community.magento.com/ Official Magento Forums]. === Perform A Graceful restart Restart ===So To make the previous server changes will take effect (affect, we must perform a graceful restart. In the WebAdmin Console, navigate to '''Actions > Graceful Restart)'''.
=== Run the set up wizard The Magento Setup Wizard ===Point In your browser to , visit http://server_ipyour_server_ip:8088/magento and follow the instructions.
== Magento 2 Installation ==
The following command instruction will run as root userwalk you through installing a basic Magento 2 site on OpenLiteSpeed. Please also If you would like more in depth information on installing and configuring Magento 2, please refer to the [http://devdocs.magento.com/guides/v2.0/install-gde/install-flow-diagram.html Official Magento 2's installation guideInstallation Guide].
=== Add new php path to $PATH Install Composer === Composer will check php at system default location such as /usr/bin/php, not installed location /usr/local/lsws/lsphp56/bin/php, which may cause Install composer version checking fail.with the following command:
<code>yum install composer</code> === Add The Correct PHP Path To The $Path Environment Variable === Add righ By default, Composer will check for PHP path at system default location - usually <code>/usr/bin/php</code>. This can sometimes cause Composer's version checking to fail. To avoid this, we will add our PHP installation directory the $PATH env will fix environment variable. Using LSPHP-56 as an example, run the problem.following command:
export PATH="/usr/local/lsws/lsphp56/bin/:$PATH"
=== Choose An Installation Directory For Magento 2 ===Using the installation default "Example" virtual host, we create a directory for our Magento 2 ===installation and enter it.
cd /usr/local/lsws/Example/html
mkdir magento2
cd magento2
=== Get magento software The Magento Software === Using Composer, we will now get the most recent Magento 2 package. <code>composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition . </code> It You will prompt you then be prompted to enter your username and password for repo.magento.com.
Authentication required (repo.magento.com):
password:
=== Add the following rewrite rules in your virtual host settings to make Magento work The Required Rewrite Rules To Your Virtual Host Settings ===: Go to # In the WebAdmin console > Console, navigate to '''Virtual Hosts > Example > Rewrite'''.: # Set '''Enable Rewrite > ''' to '''Yes'''.: # Add the following to the '''Rewrite Rules >:: '''Notesetting:''' 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]").
Options +FollowSymLinks
RewriteRule .* /magento2/index.php [L]
'''IMPORTANT :''' These rules are written for installations located in subdirectory "magento2". If your Magento installation is located in the server docroot instead of the suggested <code>/magento2</code> subdirectory, remove "magento2" from the rewrite rules containing it. For example, <code>RewriteBase /magento2/</code> would become <code>RewriteBase /</code>, and <code>RewriteRule .* /magento2/index.php [L]</code> would become <code>RewriteRule .* /index.php [L]</code>. '''Note:''' These rewrite rules are taken directly from Magento's official site. Any questions regarding these rules would be best directed to the [https://community.magento.com/ Official Magento Forums]. === Perform A Graceful restart Restart ===So To make the previous server changes will take effect (affect, we must perform a graceful restart. In the WebAdmin Console, navigate to '''Actions > Graceful Restart)'''. === Run The Magento Setup Wizard ===In your browser, visit http://your_server_ip:8088/magento and follow the instructions.
=== Run the set up wizard Fix css Loading Issue For Magento 2 Frontend/Backend ===Point The last step is to fix a css loading issue present in new Magento 2 installations. Using the "Example" virtual host and assuming your browser to http://server_ip:8088Magento 2 installation is located under the <code>/magento2</ and follow code> subdirectory, we can do this with the instructions following set of commands:
cd /usr/local/lsws/Example/html/magento2/
php bin/magento setup:static-content:deploy
rm -rf var/cache/*
chown -R nobody:nobody .
[[Category:Help]]