How to Install Magento Open Source on OpenSUSE Latest
This tutorial will guide you through the process of installing Magento Open Source on the latest version of openSUSE using the source code from GitHub.
Requirements
Before proceeding with the installation, make sure that your system meets the following requirements:
- openSUSE Latest
- Apache web server
- MySQL/MariaDB database server
- PHP 7.4 or higher with the required PHP extensions
Step 1: Install Required Dependencies
To begin, we need to install Apache, MySQL/MariaDB, and PHP along with the required extensions. Open the terminal and enter the following command:
sudo zypper install apache2 mariadb php7 php7-mysqlnd php7-mbstring php7-intl php7-xsl php7-zip php7-gd php7-curl php7-json php7-ctype php7-iconv php7-bcmath
After the installation, start the Apache and MySQL/MariaDB services, and enable them to start at boot time:
sudo systemctl start apache2
sudo systemctl start mariadb
sudo systemctl enable apache2
sudo systemctl enable mariadb
Step 2: Download and Extract Magento Source Code
Next, we need to download and extract the Magento source code from GitHub. Change to the webserver root directory and run the following commands:
cd /srv/www/htdocs/
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
sudo git clone https://github.com/magento/magento2.git
cd magento2
Now, we need to install the dependencies using Composer:
sudo composer install
Step 3: Create a Database and User
Before we can proceed with the installation, we need to create a database and user for Magento. Open the MySQL/MariaDB command-line client:
sudo mysql -u root -p
Enter your MySQL/MariaDB root password and create the database and user:
CREATE DATABASE magento2;
CREATE USER 'magento2'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON magento2.* TO 'magento2'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 4: Magento Installation
Now we are ready to start the Magento installation process. Open your web browser and navigate to http://localhost/magento2/ or your webserver IP address if you are installing remotely.
- Choose the language and click on "Next".
- Magento will check the readiness of the system for the installation. Make sure that all the prerequisites are met and click on "Start Readiness Check".
- If everything is okay, you will see a green message at the bottom. Click on "Next".
- On the next page, enter the database details that we created in step 3 and click on "Next".
- Configure the basic store settings such as Store Name, Default Time Zone, and Admin Account.
- Click on "Install Now" to start the installation process.
Step 5: Post-Installation Tasks
After the installation is complete, you need to do the following:
- Change the ownership of the Magento files to the webserver user:
sudo chown -R wwwrun:www /srv/www/htdocs/magento2/
- Disable Magento built-in caches:
sudo php /srv/www/htdocs/magento2/bin/magento cache:disable
- Configure the Apache webserver by adding the following lines to the
/etc/apache2/httpd.conffile:
<Directory "/srv/www/htdocs/magento2">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
- Restart the Apache webserver:
sudo systemctl restart apache2
Congratulations! You have successfully installed Magento Open Source on your openSUSE system. You can now access your Magento store by navigating to http://localhost/magento2/ in your web browser.