By Arslan Ud Din Shafiq, Alibaba Cloud Community Blog author.
Thelia is an e-commerce software that allows you to build and manage websites for your online business. It is built on Symfony and supports multiple REST API for managing an array of functions that an e-commerce website requires such as customer discounts, coupons, vouchers, promotions, shipping fees estimation, and much more.
In this tutorial, we will install and set up Thelia on Alibaba Cloud Elastic Compute Service (ECS) along with Ubuntu 16.04.
Firstly, use the following command to update your Ubuntu system before proceeding with the installation of any type of package. For executing this command, remember to login from non-root user with Sudo privileges.
sudo apt update && sudo apt upgrade
Thelia requires the installation of PHP 5.2 or a later version of PHP. For this tutorial, we will install PHP 7.2 by executing the following steps.
Step 1: Install python software properties and software properties common as these are necessary for the installation of PHP 7.2. To do so, execute the command below.
sudo apt-get install software-properties-common python-software-properties
You need to add a repository for the later versions of PHP by executing the commands below.
sudo add-apt-repository ppa:ondrej/php
Step 2: Update the system to refresh the available repositories and make PHP 7.2 repository available for installation. Execute the following command for updating the Ubuntu system.
sudo apt update
Step 3: Once PHP 7.2 repository loads successfully, install PHP 7.2 by using the following command.
sudo apt install -y php7.2
TaskBoard requires multiple PHP extensions, including php7.2-cli, php7.2-fpm, php7.2-common, php7.2-intl, php7.2-gd, php7.2-mbstring, php7.2-xml, php7.2-mysql, php7.2-dom, php7.2-curl, and php7.2-zip. Execute the following command to install all the required extensions.
sudo apt-get -y install php7.2-cli php7.2-fpm php7.2-common php7.2-mbstring php7.2-mysql php7.2-gd php7.2-xml php7.2-dom php7.2-gd php7.2-intl php7.2-curl
With the installation of the extensions mentioned above, Apache2 will be installed automatically.
Further, to check whether you have correctly installed PHP, you can execute the following command and verify the installed PHP version.
php --version
Thelia supports MySQL and for this tutorial, we will use the MariaDB server for MySQL. By default, the Ubuntu repository has an older version of the MariaDB server. We need to add MariaDB repository to the Ubuntu system for using the new version of MariaDB by following the steps listed below
Step 1: Verify the keys by executing the command shown below.
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
Step 2: Add the repository using the following command.
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.nodesdirect.com/mariadb/repo/10.2/ubuntu xenial main'
Step 3: Now update the system by using the command below.
sudo apt update
Step 4: Now install MariaDB using the following command.
sudo apt install -y mariadb-server
Step 5: Start and enable the MariaDB server to ensure that after reboot, the server starts automatically.
sudo systemctl start mariadb
sudo systemctl enable mariadb
Step 6: Now run the following command to enhance the security of MariaDB server and set a password for the root user.
sudo mysql_secure_installation
Also, connect to the MySQL shell as the root user by executing the command below and enter your password.
sudo mysql -u root -p
Execute the following MySQL queries in your MariaDB server.
CREATE DATABASE thelia CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'aareez'@'localhost' IDENTIFIED BY '654321Ab';
GRANT ALL PRIVILEGES ON thelia.* TO 'aareez'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Another alternative is Alibaba Cloud Aspara DB for RDS. It is recommended to use Alibaba Cloud AsparaDB for RDS as it relieves you from managing a database so that you can focus on your business. It is ready to use service that is highly scalable, available, secure to use, and offers protection against SQL injections, network attacks, brute force attacks and several other types of database attacks.
Let's follow the steps listed below to install Thelia.
Step 1: Navigate to /var/www/html using the command.
cd /var/www/html
Now change ownership of /var/www/html directory as shown below:
sudo chown -R aareez:aareez /var/www/html
Step 2: Remove index.html file using the command below.
rm index.html
Download the latest stable release of Thelia using the command below.
wget https://thelia.net/download/thelia.zip
Step 3: Now unzip the downloaded zipped folder by using the following command.
unzip thelia.zip
Step 4: Now execute the following command to remove thelia.zip.
rm -r thelia.zip
Step 5: Copy the content of thelia_2.3.4 folder to /var/www/html/ by executing command below.
mv /var/www/html/thelia_2.3.4/* /var/www/html
Step 4: Now execute the following command to remove thelia_2.3.4 directory.
rm -r thelia_2.3.4
Step 6: Also, provide ownership of /var/www/html to www-data so that apache server can access the required files.
sudo chown -R www-data:www-data /var/www/html
Let's create a virtual host configuration file for Thelia. Execute the following command to open a file in the Nano text editor.
sudo nano /etc/apache2/sites-available/Thelia.conf
Copy and Thelia the following code and save the file.
<VirtualHost *:80>
ServerAdmin admin@xyz.com
ServerName softpedia.xyz
DocumentRoot /var/www/html/
DirectoryIndex index.php index.htm index.html
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/Thelia_error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/Thelia_access.log combined
</VirtualHost>
Execute the command below to disable the default site.
sudo a2dissite 000-default.conf
Now you need to enable the newly created virtual host by executing the command below.
sudo a2ensite Thelia
You also need to enable rewrite mod. You can do so either by editing a configuration file in the Apache2 directory or simply executing the command below.
sudo a2enmod rewrite
Enable SSL engine. Either by editing a configuration file in the Apache2 directory or by executing the following command.
sudo a2enmod ssl
Now, restart the Apache server to apply the changes and load the settings by executing the command below.
sudo service apache2 restart
Finally, you can access Taskboard via your domain name or ECS IP address. For this tutorial, we have accessed via http://softpedia.xyz
.
If you have activated firewalls, you need to define a rule in Alibaba Cloud security group for your cloud server to add an exception for port 80/TCP and 443/TCP. You can enable these ports while creating ECS instance, but in case if you have forgotten to unblock these ports, you can follow the procedure in this guide: https://www.alibabacloud.com/help/doc-detail/25471.htm
You need to use Certbot for installing the SSL certificate using Let's Encrypt. To do so, execute the following steps.
Step 1: Update the package using the following command.
sudo apt-get update
Step 2: Install software-properties-common by executing the command below.
sudo apt-get install software-properties-common
Step 3: Add the Certbot repository by using the following command.
sudo add-apt-repository ppa:certbot/certbot
Step 4: Use the command below to update the package for loading the added Certbot repository.
sudo apt-get update
Ensure to stop Apache before issuance of the SSL certificate as shown below.
sudo systemctl stop apache2
Step 5: Now, install python-certbot-apache using the command below.
sudo apt-get install python-certbot-apache
Step 6: Execute the following command to get Let's Encrypt SSL issued.
sudo certbot --apache -d softpedia.xyz
Select Option 2 to redirect the link to https and update virtual host settings for SSL.
After a successful issuance of the SSL certificate, you will be navigated to the following screen.
Now, run the following command to restart the Apache server.
sudo systemctl start apache2
Now, you can access your website by hitting your URL.
To initiate configuration, you need to update your php.ini file by executing the command below.
sudo nano /etc/php/7.2/apache2/php.ini
Change value of post_max_size value to 20M.
Now, restart the Apache server using the following command.
sudo systemctl start apache2
Now click Continue button to start configuration process. It will check permissions and you will see the screen below.
Once you click Continue, you will move to the next step where you need to set up a database connection and then click Continue.
Moving on to the next tab, you will be redirected to the following screen where you must select the database and click Continue.
Next, you will be redirected to the following page, where you have to set up your Admin account credentials along with the preferred language and set company name to access the Admin panel.
Finally, when you click on Continue, you will be redirected to the Thelia's home page as shown below.
There you go! You have successfully installed and configured Thelia on your Alibaba Cloud ECS
2,599 posts | 762 followers
FollowAlibaba Clouder - November 21, 2019
Arman Ali - June 30, 2021
Alibaba Clouder - March 23, 2018
Alibaba Clouder - April 11, 2018
Alibaba Clouder - April 28, 2019
Alibaba Clouder - December 3, 2019
2,599 posts | 762 followers
FollowElastic and secure virtual cloud servers to cater all your cloud hosting needs.
Learn MoreLearn More
Learn More
More Posts by Alibaba Clouder