In this tutorial we will quickly show you how to install Magento on a Centos server.
Magento is a widely used CMS (content management system) mainly used in setting up eCommerce or business websites.
It is basically an eCommerce software and platform.
Magento is highly customisable and there are a wide variety of themes and extensions supported by Magento which can be used to enhance the performance of the websites. Magento supports multiple levels of caching with which the websites can be made to load faster.
Magento is coded with PHP and it uses MySQL database management system or its replacements like Percona. It also uses Zend framework as the Service Manager component. Magento website are highly responsive (supports mobile devices), powerful, supports third-party integrations, highly customisable and versatile.
Setting up Magento on a Linux CentOS LAMP Server
Magento requires a Linux server or Linux VPS with LAMP stack for it to work. Since Magento has lot of in-built utilities and extensions, it requires high memory for full functionality. It is recommend to have atleast 2GB RAM for a normal Magento website.
This article is based on the assumption that these prerequisites are satisfied.
Since Magento requires high PHP memory limit, we’ll increase it in the php.ini (PHP configuration) file. To find the location of php.ini file, do:
php -i | grep php.ini
This will give an output similar like:
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
In this case, /etc/php.ini is the loaded configuration file and we need to make the changes there.
Open the said file and edit;
memory_limit = 512M
Magento also requires PHP mcrypt package, so you need to install it as well.
We need to enable REMI and EPEL repos to install php-mcrypt.
Download the repo rpms. and install it to configure the repos.
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
After configuring the REMI and EPEL repos, update yum repos
Then install PHP mcrypt package.
yum install php-mcrypt*
Now, restart Apache. and the new value should be in place.
Now, we can proceed with the installation of Magento.
First we need to download the Magento package in the Document Root of the website/domain. The domain in this tutorial is ‘domain.com’ and the Documet Root is ‘/home/test/public_html’.
So we need to change the working directory to the Document Root.
Now, download the Magento package.
The downloaded package is a zip archive. We need to unzip it into the Document root of the domain.
cp -rf magento/* /home/test/public_html
Now the Magento contents are copied in the Document Root.
Magento website needs a database to hold the data. So we need to create a MySQL database and a MySQL user who has the privilege to access that data.
Enter into MySQL prompt
We are now in the MySQL prompt. Create a database named ‘magento’.
mysql> CREATE DATABASE magento;
Create a MySQL ‘mageuser ‘ user who can access the database ‘magento’
mysql> CREATE USER [email protected];
Grant permissions for the MySQL user to access the database ‘magento’
mysql> GRANT ALL ON magento.* TO [email protected] IDENTIFIED BY ‘your_password’;
You may refer the screenshot for a detailed look.
You can configure your Magento website and admin panel from the frontend. Here is how to do this.
Load your website (http://domain.com) in a web browser. It will load the Magento Installation Wizard.
Specify the Locale settings, Time Zone and Default Currency, COntinue to next page. Then comes the database configuration page.
This is what for we created the MySQL database and the privileged MySQL user. Just enter those credentials and continue to Admin account creation page.
In this page, we need to provide Personal Information, Login Infomation and Encryption key. Then, continue to next page.
Magento setup is almost complete. We just have to enter a few questions regarding the business type and then YOU ARE SET!
This will take you to the Frontend (Website) or Backend (Dashboard) as you choose.
This is how a sample Magento website looks.
You can start building your website and the Magento Admin URL by default is http://domain.com/index.php/admin
This is how the default admin page looks like.
This tutorial just shows you how to install and configure Magento on a Centos server.
Thanks for reading and leave your questions below to keep the conversation going.