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 gives users total control over their store and enables fast time-to-market for products. In this article, we will guide you through the process of installing Bagisto on Rocky Linux 8, using the LAMP stack. By the end of this tutorial, you’ll have a fully functional Bagisto store up and running on your server.
Prerequisites
Before we begin, make sure you have the following prerequisites in place:
- A system running Rocky Linux 8 with root access.
- Composer installed and running on your server. If you haven’t installed Composer yet, you can refer to our guide on how to install Composer on Rocky Linux 8.
- The LAMP stack (Apache, MariaDB, and PHP) installed and running on your server. If you haven’t set up the LAMP stack yet, you can follow our guide on how to install the LAMP stack on Rocky Linux 8.
Now that we have all the prerequisites in place, let’s proceed with the installation and configuration of Bagisto.
Step 1: Create a Database
First, we need to create a database and a user that will be used by Bagisto to store and retrieve data. To create the database, log in to your server as the root user 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
In the above commands, replace YOUR-PASSWORD-HERE
with a secure password of your choice. This will create a database named bagisto
and a user named shapehost
with full privileges on the database.
Step 2: Install Let’s Encrypt SSL Certificate
To ensure secure communication between your server and the clients accessing your Bagisto store, we will install a Let’s Encrypt SSL certificate. Follow our guide on how to install Let’s Encrypt SSL certificate to complete this step.
Step 3: Download and Extract Bagisto
Now, let’s download and extract the Bagisto framework onto your server. Change to the appropriate directory and execute the following commands:
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
In the above commands, we navigate to the /var/www/html
directory, download the Bagisto zip file, and extract it to a folder named bagisto
.
Step 4: Set File Permissions
To ensure that Bagisto functions properly, we need to set the correct file permissions. Execute 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
These commands make the necessary folders and files readable and set the ownership to the Apache user.
Step 5: Install Bagisto Dependencies
Before we can install Bagisto, we need to install its dependencies using Composer. Run the following command to install the required dependencies:
cd /var/www/html/bagisto composer install
This will fetch and install all the necessary packages and libraries that Bagisto depends on.
Step 6: Configure Bagisto
With the dependencies installed, we can now proceed to configure Bagisto. Run the following commands:
php artisan bagisto:install
During the installation process, you will be prompted to provide the database details. Enter the following information:
- Database Host:
localhost
- Database Port:
3306
- Database Name:
bagisto
- Database User:
shapehost
- Database Password:
YOUR-PASSWORD-HERE
Replace YOUR-PASSWORD-HERE
with the password you set earlier when creating the database user.
Step 7: Configure Apache Virtual Host
To make Bagisto accessible via a domain name, we need to configure an Apache virtual host. Create a new Apache configuration file for your domain using the following command:
vi /etc/httpd/conf.d/bagisto.conf
Add the following content to the file:
<VirtualHost *:80>
ServerName 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/bagisto-error.log
CustomLog /var/log/httpd/bagisto-access.log combined
</VirtualHost>
Make sure to replace your-domain.com
with your actual domain name.
Save the file and exit the text editor.
Step 8: Restart Apache and Test Bagisto
Restart the Apache web server to apply the changes:
systemctl restart httpd
Now, open your web browser and visit your Bagisto store by entering your domain name in the following format:
http://your-domain.com
Congratulations! You have successfully installed Bagisto with the LAMP stack on Rocky Linux 8. You can now start customizing your store and adding products to it.
Conclusion
In this article, we have learned how to install Bagisto on Rocky Linux 8 using the LAMP stack. By following the steps outlined in this tutorial, you should now have a fully functional Bagisto store up and running on your server.
If you encounter any issues during the installation process or need further assistance, feel free to reach out to our Shape.host support team. We offer reliable and secure cloud hosting solutions, including Cloud VPS services, to empower businesses like yours with efficient and scalable eCommerce platforms.