LiteCart Store Installation

LiteCart Store Installation

Install a LiteCart store and add cryptocurrency payment support.

Host: Oracle AMD instance. System: Ubuntu 22.04.

1. Initial System Configuration

sudo -i
apt update
apt upgrade
apt -y install language-pack-es language-pack-fr language-pack-de language-pack-zh-hans

2. Install Required Components: PHP, MySQL, and Others

apt -y install curl nano unzip apache2 libapache2-mod-php mariadb-server php php-common php-cli php-fpm php-apcu php-curl php-dom php-gd php-imagick php-mysql php-simplexml php-mbstring php-intl php-zip php-xml
a2enmod rewrite headers proxy_fcgi setenvif
mysql_secure_installation

2.2 Configure the Database

mysql -u root - p <<END
ALTER USER 'root'@'localhost' IDENTIFIED BY '{desired_root_password_here}';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
DROP USER IF EXISTS ''@'localhost';
DROP DATABASE IF EXISTS test;
FLUSH PRIVILEGES;
END

When configuring the database, make sure the root password is set correctly. Different MySQL versions may use different setup methods.

2.3 Configure PHP

sed -ri 's/;?memory_limit\s*=\s*[^\s]*/memory_limit = 256M/' /etc/php/8.1/apache2/php.ini
sed -ri 's/;?upload_max_filesize\s*=\s*[^\s]*/upload_max_filesize = 64M/' /etc/php/8.1/apache2/php.ini
sed -ri 's/;?date\.timezone\s*=\s*[^\s]*/date.timezone = Europe\/Stockholm/g' /etc/php/8.1/apache2/php.ini

The /php/8.1/ path should be changed according to the PHP version you installed.

2.4 Add the LiteCart Database to MySQL

read -p "New database name: " newdb_name
read -p "New database user: " newdb_user
read -sp "Password for database user '$newdb_user': " newdb_password

mysql -u root -p -e "CREATE DATABASE $newdb_name; \
CREATE USER '$newdb_user'@'localhost' IDENTIFIED BY '$newdb_password'; \
GRANT ALL PRIVILEGES ON $newdb_name.* TO '$newdb_user'@'localhost' WITH GRANT OPTION; \
FLUSH PRIVILEGES;"

3. Configure Apache

nano /etc/apache2/sites-enabled/000-default.conf

Enter the following code:

 <VirtualHost *:80>
    ServerName youdomain.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
  </VirtualHost>

Apply the changes:

systemctl restart apache2

4. Install LiteCart

cd /var/www/html
rm index.html
chown -R www-data:www-data ./

Now open the website address configured in Apache and continue the installation in the browser.

After the installation is complete, delete the install directory to avoid unnecessary errors.

rm -Rf install/

5. Configure SSL

5.1 Install the snapd Package Manager

apt install -y snapd
snap install core
snap refresh core

5.2 Install Certbot

snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot

5.3 Use the Following Command to Install a Certificate

certbot --apache -d yourdomain.com

Enjoy!