How To Install Magento Community Edition
Introduction
Magento is 1 of the well-nigh popular open-source east-commerce platform written in PHP powered past Zend framework. In this tutorial, you will larn the steps required to install and setup Magento on your Linux/Ubuntu 18.04 server.
Prerequisites
- PHP v.six.xix +
- MySQL v.six +
- Apache
- Recommended 2GB of RAM
Installation
Step 1: Showtime step is to install Apache2
To install and setup Apache use the following commands:
$ sudo apt install apache2 $ sudo systemctl start apache2 $ sudo systemctl enable apache2
Footstep 2: Create a new Apache virtual host and configure it.
Create a new configuration file name magento.conf
$ sudo vim /etc/apache2/sites-bachelor/magento.conf
Paste the following code into the newly created config file
<VirtualHost *:eighty> ServerAdmin [e-mail protected] DocumentRoot /var/world wide web/html/magento/ ServerName domain.com ServerAlias www.domain.com <Directory /var/world wide web/html/magento/> Options Indexes FollowSymLinks MultiViews AllowOverride All Society permit,deny permit from all </Directory> ErrorLog ${APACHE_LOG_DIR}/magento_error.log CustomLog ${APACHE_LOG_DIR}/magento_access.log combined </VirtualHost> Now with this, you will be debugging all the Magento setup related errors in the magento_error.log and magento_access.log
Pace 3: Enable Rewrite mod
$ sudo a2ensite magento.conf $ sudo a2enmod rewrite
Step iv: Installing PHP and dependencies
Employ the below command to install all required PHP dependencies:
$ sudo apt install php7.2 libapache2-mod-php7.ii php7.2-common php7.ii-gmp php7.ii-curl php7.2-soap php7.2-bcmath php7.ii-intl php7.2-mbstring php7.2-xmlrpc php7.2-mcrypt php7.2-mysql php7.2-gd php7.two-xml php7.ii-cli php7.two-nil
Open the php.ini file
$ sudo vim /etc/php/7.2/apache2/php.ini
Change the post-obit credentials:
file_uploads = On allow_url_fopen = On short_open_tag = On memory_limit = 512M upload_max_filesize = 128M max_execution_time = 3600
Restart Apache service.
$ sudo systemctl restart apache2
Pace 5: Setting up MySQL Server
- Install MySQL server
$ sudo apt install mysql-server
- Set MySQL root password
- After the installation a temporary password will exist generated in the mysqld.log file you can admission this password past the following command
$ sudo grep 'temporary password' /var/log/mysqld.log
- Now you lot will get a message something like this
[Note] A temporary password is generated for [email protected]: b*-rkuIR4Zasd
- Copy this password for the next stride
- Enter this command
$ sudo mysql_secure_installation
- This will prompt you to validate your password enter Y
- Later on this, you will be prompted to set your password forcefulness. Enter your choice betwixt LOW, MEDIUM and STRONG.
- Enter new countersign
- You can say aye to all the other prompts that come after this
- You will now be prompted with multiple questions on how to gear up up the MySQL installation. You can set Y to all the prompts
- You will be able to login with the user root and a blank password
- Login to MySQL
$ sudo mysql -u root -p
- Create a Magento database and add together User
mysql > create database magento; mysql > CREATE USER 'magentouser'@'localhost' IDENTIFIED Past 'password'; mysql > GRANT ALL PRIVILEGES ON * . * TO 'magentouser'@'localhost'; mysql > FLUSH PRIVILEGES; mysql > exit;
Step 6: Install composer
You lot need Composer to install all the Magento and its dependencies
Use the beneath command to install composer globally on your Ubuntu system:
$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" $ sudo php composer-setup.php --install-dir=/usr/bin/ --filename=composer Check the composer installation using the below command:
$ composer -v
Pace seven: Larn / Generate secret keys from your Magento marketplace place user account. (Required only for installation through composer)
In order to install Magento in the next footstep, you volition have to specify Public and Private keys from your Magento market-identify business relationship. If you lot oasis't registered notwithstanding you can register here.
- Login to Magento Marketplace here.
- Click on your username dropdown in the elevation navbar > My Profile
- Click on [Access Keys]
- Click on [Create A New Access Cardinal]
- Enter a key name and generate
After this, your Public and Private key will exist generated. Utilize these for installation in the side by side step.
Step 8: Install Magento
- Installation using Composer
Enter your servers root directory
cd /var/www/html
Run the composer command to install Magento
$ sudo composer create-project --repository=https://repo.magento.com/ magento/projection-community-edition magento
You will be prompted to provide a username password for this. Put your public key as the username and the individual key equally the password. It volition take some time for the Composer to download and install all the required dependencies so be patient.
- Installation using the zip file
Open up this link. In the download tab, select your preferred version and click on download.
Follow these commands
$ sudo mkdir /var/www/html/magento/ $ sudo tar -zxvf ~/Downloads/Magento-CE*.tar.gz -C /var/www/html/magento/
For copying from local to the remote machine
# On local car $ scp -r magento2-ce.aught [email protected]<your-domain-proper name/ip-address>:/var/www/html/magento/magento.zero # On remote motorcar $ cd /var/world wide web/html $ mkdir magento $ sudo tar -zxvf magento.zip -C magento/
Install dependencies from using composer
$ cd /var/www/html/magento/ $ composer install
Later on post-obit the installation steps we tin at present open up the Magento setup in your specified domain proper name or server IP accost.
Common Errors & Exceptions
If you are getting 500 mistake after the installation please follow these steps:
- This problem is probably due to directory access problems. To solve that use the following commands:
$ sudo chown -R www-information:world wide web-information /var/www/html/magento $ sudo chmod -R 755/var/www/html/magento
You have to set the user group according to your setup.
Your user group volition depend on your Http server instance. In our instance it was world wide web-data it might be nginx or apache by default, depending on the setup. Y'all can check that by using these commands
$ ps aux | grep apache $ groups <apache-user>
If you lot are nonetheless getting errors you can debug those errors by referring the following logs
$ tail -f /var/log/apache2/magento_error.log $ tail -f /var/log/apache2/magento_access.log
Step 9: Magento Setup
- Later accessing your URL this screen volition be displayed
- Click on Agree and Setup Magento
- On the side by side screen click on Start Readiness Check
- Make sure that all the checks are positive if there are any dependencies that are missing, it will be displayed with the cherry-red cantankerous mark then y'all can install it and try again. After confirmation, go to the next step.
- Enter the database credentials for Magento yous've had created earlier in this tutorial and click on adjacent.
- In the next step, you lot can set the web configuration details as per your requirements.
- Next footstep you will configure your timezone, language, and currency settings. You can select or unselect the modules y'all desire from the list in advanced configuration.
- In the next stride, yous will set your admin login credentials
- After clicking on the Adjacent button, your Magento setup is ready to be installed so click on the Install At present push button.
Now you just accept to wait for the installation to complete.
After the successful installation, all of your Magento setup details will be shown, you lot can note these and click on Launch Magento Admin.
This will open up the login panel for Magento and you tin log in with your admin credentials.
Setting up Cron Jobs
Cronjob is nothing but a scheduler that runs a specified file path at a specified interval. Magento needs some of these Cron Jobs to be ready in gild to function properly.
To add these Crons follow this command.
$ cd /var/world wide web/html/magento $ sudo php bin/magento cron:install
You tin can check the installed Magento Cron Jobs by using this control
$ sudo crontab -l
You should notice theses settings in your Cron
* * * * * /usr/bin/php /var/www/html/magento/bin/magento cron:run ii>&1 | grep -v "Ran jobs by schedule" >> /var/www/html/magento/var/log/magento.cron.log * * * * * /usr/bin/php /var/www/html/magento/update/cron.php >> /var/www/html/magento/var/log/update.cron.log * * * * * /usr/bin/php /var/www/html/magento/bin/magento setup:cron:run >> /var/www/html/magento/var/log/setup.cron.log
And with this, your Magento setup is up and ready to exist used for your E-Commerce site.
Conclusion
By following the above-mentioned steps you are at present ready to create your due east-commerce platform with a working Magento installation. In case y'all have encountered something, which is non covered equally a part of this tutorial, and so please experience free to share those below in the comments.
Source: https://netcorecloud.com/tutorials/how-to-install-magento-on-ubuntu-18-04/
Posted by: gainesoweig1963.blogspot.com

0 Response to "How To Install Magento Community Edition"
Post a Comment