Cara Install PrestaShop di Ubuntu

PrestaShop adalah perangkat lunak CMS (Content Management System) untuk membangun website e-commerce dengan menggunakan bahasa pemrograman PHP. Tutorial install PrestaShop ini menggunakan distro Linux Ubuntu 16.04 LTS, Apache2, MariaDB 10, dan PHP 7.0.

-1. Install Apache2-

Install web server/httpd server Apache2

[INPUT]

1 sudo apt install apache2 -y

Setelah instalasi Apache2, nonaktifkan directory listing

[INPUT]

1 sudo sed -i “s/Options Indexes FollowSymLinks/Options FollowSymLinks/” /etc/apache2/apache2.conf

Kemudian aktifkan service Apache2

[INPUT]

1 2 3 4 sudo systemctl stop apache2 sudo systemctl start apache2 sudo systemctl enable apache2 sudo systemctl status apache2

-2. Install MariaDB-

Selanjutnya install database MariaDB

[INPUT]

1 sudo apt install mariadb-server mariadb-client -y

Lalu aktifkan service MariaDB

[INPUT]

1 2 3 4 sudo systemctl stop mysql sudo systemctl start mysql sudo systemctl enable mysql sudo systemctl status mysql

Amankan installasi MariaDB

[INPUT]

1 2 3 4 5 6 7 8 9 10 sudo mysql_secure_installation   Enter current password for root (enter for none): Just press the Enter Set root password? [Y/n]: Y New password: Enter password Re-enter new password: Repeat password Remove anonymous users? [Y/n]: Y Disallow root login remotely? [Y/n]: Y Remove test database and access to it? [Y/n]:  Y Reload privilege tables now? [Y/n]:  Y

Restart MariaDB

[INPUT]

1 sudo systemctl restart mysql

-3. Install PHP-

Install PHP beserta module yang dibutuhkan

[INPUT]

1 sudo apt install php libapache2-mod-php php-common php-mbstring php-xmlrpc php-soap php-gd php-xml php-intl php-mysql php-cli php-mcrypt php-ldap php-zip php-curl -y

Setelah install PHP, lakukan konfigurasi

[INPUT]

1 sudo nano /etc/php/7.0/apache2/php.ini

Cari opsi di bawah ini dan sesuaikan nilainya

[INPUT]

1 2 3 4 file_uploads = On allow_url_fopen = On memory_limit = 256M upload_max_filesize = 64M

Restart Apache

[INPUT]

1 sudo systemctl restart apache2

-4. Membuat Database-

Membuat database dan usernya untuk PrestaShop

[INPUT]

1 2 3 4 5 6 sudo mysql -u root -p   CREATE DATABASE prestashop; CREATE USER ‘userdb’@’localhost’ IDENTIFIED BY ‘passdb’; GRANT ALL PRIVILEGES ON prestashop.* TO ‘userdb’@’localhost’; FLUSH PRIVILEGES;

-5. Download PrestaShop-

Download dan extract PrestaShop

[INPUT]

1 2 3 4 cd /tmp && curl -O https://download.prestashop.com/download/releases/prestashop_1.7.4.1.zip unzip prestashop_1.7.4.1.zip sudo mkdir -p /var/www/html/prestashop sudo unzip prestashop.zip -d /var/www/html/prestashop/

Ubah user dan hak akses folder

[INPUT]

1 2 sudo chown -R www-data:www-data /var/www/html/prestashop/ sudo chmod -R 755 /var/www/html/prestashop/

-6. Konfigurasi Apache2-

Buat virtualhost untuk PrestaShop

[INPUT]

1 sudo nano /etc/apache2/sites-available/prestashop.conf

Silakan ganti prestashop.local dengan nama domain anda. Isi dari file prestashop.conf:

[INPUT]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15      ServerAdmin admin@example.com      DocumentRoot /var/www/html/prestashop/      ServerName prestashop.local      ServerAlias www.prestashop.local                Options +FollowSymlinks         AllowOverride All         Require all granted             ErrorLog ${APACHE_LOG_DIR}/prestashop_error.log      CustomLog ${APACHE_LOG_DIR}/prestashop_access.log combined

Aktifkan virtualhost

[INPUT]

1 sudo a2ensite prestashop.conf

Aktifkan module Rewrite

[INPUT]

1 sudo a2enmod rewrite

Restart Apache2

[INPUT]

1 sudo systemctl restart apache2

-7. Installer PrestaShop-

Akses ServerName/domain dari PrestaShop, http://prestashop.local

Klik Next

Pilih Bahasa Instalasi

Centang /I agree to the above terms and conditions./, Next.

Persetujuan Lisensi

Memeriksa kebutuhan system. Next.

Memeriksa Kebutuhan Sistem

Masukkan informasi toko, dan akun admin. Next.

Informasi Toko dan Akun Admin

Masukkan database yang sudah dibuat. Next.

Koneksi ke Database

Proses instalasi sedang berjalan.

Proses instalasi dimulai

Instalasi selesai.

Proses instalasi selesai

Hapus folder install

[INPUT]

1 sudo rm -rf /var/www/html/prestashop/install/

Frontend PrestaShop http://prestashop.local

Frontend Prestashop

Backend PrestaShop http://prestashop.local/admin

Backend Prestashop

Selamat mencoba 🙂

Leave a Reply

Your email address will not be published.