🛠️ Clone Project
Buka terminal ssh vps kamu dan jalankan:
git clone
https://github.com/ffeliandra/wa-api.gitwa-api
cd
📥 Install Dependency
Jalankan perintah berikut untuk install semua package:
npm install
Jalankan perintah berikut jika package minta update :
npx npm-check-updates -u
▶️ Jalankan Bot
Sekarang kamu bisa mulai jalanin bot-nya:
node index.js
Bot akan generate QR Code untuk login WhatsApp, tinggal scan aja pakai aplikasi WhatsApp kamu di :
🧠 Bonus Tips
- Mau botnya selalu hidup? Pakai
pm2
:
npm install -g pm2 pm2 start index.js --name wa-bot
⚙️ Apache Configuration (Reverse Proxy & SSL)
<VirtualHost *:443>
ServerAdmin admin@gmail.com
ServerName domian-kamu.com
# Node.js (Reverse Proxy)
ProxyPreserveHost On
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
SSLEngine on
SSLCertificateFile /etc/ssl/fullchain.pem
SSLCertificateKeyFile /etc/ssl/privkey.pem
SSLCertificateChainFile /etc/ssl/chain.pem
ErrorLog ${APACHE_LOG_DIR}/wa-api.error.log
CustomLog ${APACHE_LOG_DIR}/wa-api.access.log combined
</VirtualHost>
🔧Aktifkan Modul-Modul Apache untuk Proxy:
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod rewrite
💡 Instal Redis (untuk menangani antrian pesan):
sudo apt install redis-server
sudo systemctl start redis-server
sudo systemctl enable redis-server