Bagisto is a powerful and flexible eCommerce framework that allows businesses to build and scale their online stores. With its wide range of functionality and easy-to-use interface, Bagisto is an ideal choice for both tech-savvy individuals and non-technical users. In this article, we will guide you through the step-by-step process of installing Bagisto on AlmaLinux 8, ensuring that you have complete control over your store’s operations.
Prerequisites
Before we dive into the installation process, let’s make sure we have all the necessary prerequisites in place. Here’s what you’ll need:
- A system with AlmaLinux 8 installed and running.
- Root access to the system.
- Composer installed and running. If you haven’t installed Composer yet, you can refer to our guide on installing Composer on AlmaLinux 8.
- LAMP Stack (Apache, MariaDB, and PHP) installed and running. If you haven’t set up LAMP Stack yet, you can follow our guide on installing the LAMP Stack on AlmaLinux 8.
Once you have these prerequisites ready, we can proceed with the installation and configuration of Bagisto.
Step 1: Create a Database
First, let’s create a database and a user for Bagisto. We will then grant the necessary privileges to the user to interact with the database. Open the terminal and enter the following commands:
mysql -u root CREATE DATABASE bagisto; CREATE USER 'shapehost'@'localhost' IDENTIFIED BY 'YOUR-PASSWORD-HERE'; GRANT ALL PRIVILEGES ON bagisto.* TO 'shapehost'@'localhost'; FLUSH PRIVILEGES; QUIT
Make sure to replace ‘YOUR-PASSWORD-HERE’ with a strong and secure password.
Step 2: Install Let’s Encrypt SSL Certificate
To ensure secure communication with your Bagisto store, we will install a Let’s Encrypt SSL certificate. This will enable HTTPS for your domain. For detailed instructions on how to install Let’s Encrypt, you can refer to the official documentation.
Step 3: Download and Extract Bagisto
Next, we need to download and extract the Bagisto framework. Open the terminal and navigate to the appropriate directory:
cd /var/www/html wget https://github.com/bagisto/bagisto/archive/v1.3.2.zip unzip v1.3.2.zip mv bagisto-1.3.2 bagisto
Step 4: Set File Permissions
To ensure proper functioning of Bagisto, we need to set the correct file permissions. Run the following commands:
chmod -R 755 /var/www/html/bagisto chown -R apache:apache /var/www/html/bagisto chcon -R -t httpd_sys_content_rw_t /var/www/html/bagisto
Step 5: Install Bagisto
Now, let’s install Bagisto and its dependencies using Composer. Run the following commands:
cd /var/www/html/bagisto composer install composer create-project bagisto/bagisto
This will install Bagisto and all the necessary packages.
Step 6: Configure Apache Virtual Host
To serve Bagisto through your domain, we need to configure an Apache virtual host. Create a new configuration file for your domain by running the following command:
vi /etc/httpd/conf.d/your-domain.conf
Replace ‘your-domain’ with your actual domain name. Then, add the following configuration to the file:
<VirtualHost *:80>
ServerName your-domain.com
ServerAlias www.your-domain.com
DocumentRoot /var/www/html/bagisto/public
<Directory /var/www/html/bagisto/public/>
Options -Indexes +FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/your-domain-error.log
CustomLog /var/log/httpd/your-domain-access.log combined
</VirtualHost>
Save the file and exit the editor.
Step 7: Restart Apache and Enable Firewall
To apply the changes, restart the Apache web server:
systemctl restart httpd
Next, we need to enable the necessary firewall rules to allow HTTP and HTTPS traffic. Run the following commands:
firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=https firewall-cmd --zone=public --permanent --add-port 8000/tcp firewall-cmd --reload
Step 8: Access Bagisto
Congratulations! You have successfully installed Bagisto with LAMP Stack on AlmaLinux 8. You can now access your Bagisto store by opening your browser and entering your domain name or IP address followed by ‘/public’. For example:
http://your-domain.com/public
Replace ‘your-domain.com’ with your actual domain name or IP address.
Conclusion
In this article, we have walked you through the installation process of Bagisto on AlmaLinux 8. By following these steps, you can set up a powerful and flexible eCommerce store using Bagisto. Enjoy the features and functionalities offered by this open-source framework and start scaling your online business today!
If you need any assistance or have any questions, feel free to reach out to our 24×7 in-house customer support at Shape.host. We provide reliable and secure Cloud VPS services to empower businesses with efficient hosting solutions.