Aplikasi

Cara Install Nginx + SSL Sebagai Reverse Proxy untuk Apache di STB

Cara install Nginx + SSL Sebagai Reverse Proxy untuk Apache di STB (Set Top Box)

Server STB – Nginx dan Apache dapat digunakan secara bersamaan dimana Nginx bertindak sebagai reverse proxy yang menerima permintaan dari client dan meneruskannya ke web server lain seperti Apache, kemudian Apache mengirimkan kembali respon yang diminta oleh Nginx untuk dikirimkan ke client. Hal ini dilakukan agar kedua web server ini bisa saling menutupi kekurangan.

Nginx sebagai Reverse Proxy untuk Apache

1. Install Apache

apt update
apt

install apache2 php-fpm -y

Install FastCGI module

wget https://mirrors.edge.kernel.org/ubuntu/pool/multiverse/liba/libapache-mod-fastcgi/libapache2-mod-fastcgi_2.4.7~0910052141-1.2_amd64.deb

dpkg -i libapache2-mod-fastcgi_2.4.7~0910052141-1.2_amd64.deb

2. Setting Apache

Rubah terlebih dahulu nama file konfigurasi Apache port.conf
mv /etc/apache2/ports.conf /etc/apache2/ports.conf.default

Lanjutkan untuk membuat file baru port.conf dengan nomor port 8080

echo "Listen 8080" | tee /etc/apache2/ports.conf

Nonaktifkan Apache virtual host 000-default

a2dissite 000-default

Buatlah file konfigurasi virtual host

vim /etc/apache2/sites-available/001-default.conf

Masukkan konfigurasi 001-default.conf

 

<VirtualHost *:8080>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Selanjutnya aktifkan virtual host 001-default.conf
a2ensite 001-default

Setelah selesai lalu lakukan Restart Apache

systemctl restart apache2

Selanjutnya verifikasi apakah Apache sudah berjalan di port 8080

netstat -tulpn

Hasilnya akan terlihat bahwa apache2 berjalan di port 8080

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      870/systemd-resolve 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1065/sshd           
tcp6       0      0 :::8080                 :::*                    LISTEN      8774/apache2        
tcp6       0      0 :::22                   :::*                    LISTEN      1065/sshd

3. Setting Apache untuk menggunakan mod_fastcgi

Aktifkan terlebih dahulu actions module

a2enmod actions

Lalu rubahlah nama file konfigurasi FastCGI

mv /etc/apache2/mods-enabled/fastcgi.conf /etc/apache2/mods-enabled/fastcgi.conf.default

Setelah itu buat file konfigurasi baru untuk FastCGI

vim /etc/apache2/mods-enabled/fastcgi.conf

Masukkan konfigurasi FastCGI

<IfModule mod_fastcgi.c>
  AddHandler fastcgi-script .fcgi
  FastCgiIpcDir /var/lib/apache2/fastcgi
  AddType application/x-httpd-fastphp .php
  Action application/x-httpd-fastphp /php-fcgi
  Alias /php-fcgi /usr/lib/cgi-bin/php-fcgi
  FastCgiExternalServer /usr/lib/cgi-bin/php-fcgi -socket /run/php/php7.2-fpm.sock -pass-header Authorization
  <Directory /usr/lib/cgi-bin>
    Require all granted
  </Directory>
</IfModule>

Tes konfigurasi Apache

apachectl -t

Hasilnya Syntax OK, restart Apache

admin

Recent Posts

Set-Top Box (STB) yang mendukung router kebebasan OpenWrt

Set-Top Box (STB) adalah perangkat yang telah lama digunakan untuk mengubah televisi konvensional menjadi pusat…

7 months ago

Mengatur Koneksi Internet di Server STB dengan Mengubah Nameserver

Pengenalan: Server STB (Set-Top Box) adalah perangkat yang digunakan untuk mengelola konten dan layanan televisi…

9 months ago

Tutorial internet gratis dengan VPN

Sebelum memulai, penting untuk diketahui bahwa mengakses internet gratis dengan menggunakan VPN bukanlah praktik yang…

1 year ago

Tutorial install Openwrt di STB indihome

Sebelum memulai tutorial ini, pastikan bahwa STB Anda telah membuka akses root, karena Anda membutuhkan…

1 year ago

Set top Box yang cocok untuk openwrt yang murah dan stabil

Set top box (STB) dengan sistem operasi openwrt semakin populer di Indonesia. Hal ini karena…

1 year ago

Mengenal Deface Website

Server STB – Mengenal Deface Website Pengertian Deface Website Deface Web adalah serangan terhadap situb…

1 year ago