How to Install Thelia on Void Linux
Thelia is an open-source e-commerce platform that enables businesses to create online stores. This tutorial provides step-by-step instructions for installing Thelia on Void Linux.
Prerequisites
Before you start the installation process, you need to ensure that your system meets the following prerequisites:
- Void Linux installed on your system
- PHP 7.2 or later installed
- MySQL or MariaDB installed
- Apache or Nginx installed and configured
Step 1: Install Dependencies
Open a terminal window and enter the following commands to install dependencies:
sudo xbps-install -S php-fpm php-mysqli php-curl php-gd php-json php-mbstring php-session php-xml php-zip composer nginx
Step 2: Download and Install Thelia
- Go to the Thelia website at https://thelia.net/download/.
- Click on the latest stable version of Thelia and copy the link to the download page.
- Open a terminal window and enter the following commands:
cd /tmp
wget <paste the link to the downloaded Thelia file>
tar -xzf <filename> -C /usr/share/nginx/
cd /usr/share/nginx/<folder extracted from the downloaded Thelia file>
sudo composer install
Step 3: Create a Database
- Log in to MySQL or MariaDB using the following command:
mysql -u root -p
- Enter your MySQL or MariaDB root password when prompted.
- Create a database for Thelia by entering the following command:
CREATE DATABASE thelia_db;
- Create a new user for Thelia by entering the following command:
CREATE USER 'thelia_user'@'localhost' IDENTIFIED BY 'thelia_password';
- Grant permissions to the new user on the Thelia database by entering the following command:
GRANT ALL PRIVILEGES ON thelia_db.* TO 'thelia_user'@'localhost';
- Exit MySQL or MariaDB by entering the following command:
exit;
Step 4: Configure Thelia
- Copy the sample configuration file by entering the following command:
cp .env.dist .env
- Open the configuration file using a text editor:
nano .env
- Modify the following settings in the file:
[database]
db_driver=pdo_mysql
db_user=thelia_user
db_password=thelia_password
db_name=thelia_db
- Save and close the file by hitting
Ctrl + X, thenY, thenEnter.
Step 5: Configure Nginx
- Create a new Nginx server block file by entering the following command:
sudo nano /etc/nginx/conf.d/thelia.conf
- Add the following contents to the file:
server {
listen 80;
server_name yourdomain.com;
root /usr/share/nginx/public;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico)$ {
expires max;
log_not_found off;
}
}
Save and close the file by hitting
Ctrl + X, thenY, thenEnter.Test the Nginx configuration by entering the following command:
sudo nginx -t
- Restart Nginx by entering the following command:
sudo systemctl restart nginx
Step 6: Access Thelia
- Open a web browser and navigate to http://yourdomain.com/.
- Follow the Thelia installation wizard to complete the installation.
Congratulations! You have successfully installed and configured Thelia on Void Linux.