Pertemuan 3: Deployment Aplikasi Web Progress: 0%

Deployment Aplikasi Web

Mengimplementasikan Web Application di Multi-Cloud Environment

Panduan Praktikum: Pelajari konsep deployment aplikasi web dan implementasikan pada tiga platform cloud: OpenNebula, AWS, dan Huawei Cloud. Pahami perbedaan pendekatan di setiap platform.

Tujuan Pembelajaran

Multi-Platform Deployment

Mengimplementasikan deployment aplikasi web di OpenNebula, AWS, dan Huawei Cloud

Perbandingan Platform

Menganalisis perbedaan workflow deployment di berbagai platform cloud

Optimasi Performa

Mengkonfigurasi web server dan melakukan performance optimization

Platform Cloud Comparison

Aspek OpenNebula Private Cloud AWS Public Cloud Huawei Cloud Public Cloud
Deployment Model Self-managed VMs Managed Instances Elastic Cloud Servers
Access Method SSH via Private Network SSH via Public IP SSH via EIP
Web Server Setup Manual Installation User Data Scripts Custom Images
Network Config Virtual Networks Security Groups Security Groups
Cost Model CAPEX (Infrastructure) OPEX (Pay-per-use) OPEX (Pay-per-use)

OpenNebula Deployment

Karakteristik: Private cloud dengan kontrol penuh, ideal untuk development dan testing

Workflow Deployment:
  1. Akses Sunstone Dashboard
  2. Pilih Virtual Machine yang sudah dibuat
  3. Konfigurasi network settings
  4. SSH ke VM melalui private network
  5. Manual installation web server
Keunggulan OpenNebula:
  • Kontrol penuh atas environment
  • Biaya predictable (CAPEX)
  • Private network yang aman
  • Customizable infrastructure

AWS EC2 Deployment

Karakteristik: Public cloud dengan skalabilitas tinggi, layanan managed

Workflow Deployment:
  1. Akses AWS Management Console
  2. Launch EC2 Instance
  3. Konfigurasi Security Groups
  4. SSH via Public IP
  5. Automated setup dengan User Data
Keunggulan AWS:
  • Global infrastructure
  • Automation capabilities
  • Rich ecosystem services
  • Enterprise-grade security

Huawei Cloud ECS Deployment

Karakteristik: Public cloud dengan fokus keamanan dan integrasi hardware

Workflow Deployment:
  1. Akses Huawei Cloud Console
  2. Create Elastic Cloud Server
  3. Konfigurasi Security Group
  4. SSH via Elastic IP
  5. Deploy menggunakan custom images
Keunggulan Huawei Cloud:
  • Integrasi hardware Huawei
  • Security-focused architecture
  • Competitive pricing
  • Strong Asia-Pacific presence

Implementasi Multi-Platform

Akses Platform Cloud

OpenNebula Access
# Akses Sunstone Dashboard http://[opennebula-server]:9869 # Login credentials Username: [your-username] Password: ******** # SSH ke VM OpenNebula ssh [username]@[vm-private-ip]
Note: Akses melalui private network,可能需要 VPN
AWS Console Access
# Akses AWS Management Console https://console.aws.amazon.com # Login dengan IAM user Username: [your-iam-user] Password: ******** # SSH ke EC2 Instance ssh -i "key.pem" ec2-user@[public-ip]
Huawei Cloud Access
# Akses Huawei Cloud Console https://console.huaweicloud.com # Login dengan account Username: [your-account] Password: ******** # SSH ke ECS Instance ssh -i "key.pem" root@[elastic-ip]

Install Web Server (All Platforms)

Apache Web Server Installation
# Untuk CentOS/RHEL/Amazon Linux (OpenNebula, AWS) sudo yum update -y sudo yum install httpd -y sudo systemctl start httpd sudo systemctl enable httpd # Untuk Ubuntu (Huawei Cloud biasanya) sudo apt update && sudo apt upgrade -y sudo apt install apache2 -y sudo systemctl start apache2 sudo systemctl enable apache2 # Check status (semua platform) sudo systemctl status httpd # CentOS sudo systemctl status apache2 # Ubuntu
Nginx Web Server Installation
# Untuk CentOS/RHEL sudo yum install epel-release -y sudo yum install nginx -y sudo systemctl start nginx sudo systemctl enable nginx # Untuk Ubuntu sudo apt install nginx -y sudo systemctl start nginx sudo systemctl enable nginx # Check status sudo systemctl status nginx

Konfigurasi Network & Security

OpenNebula Virtual Network
  1. Buka Sunstone Dashboard
  2. Pergi ke Network → Virtual Networks
  3. Edit virtual network VM
  4. Tambah rule untuk port 80/443
  5. Apply changes dan restart VM jika perlu
# Firewall configuration di VM sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https sudo firewall-cmd --reload
AWS Security Groups
  1. Buka EC2 Dashboard
  2. Pergi ke Security Groups
  3. Edit inbound rules
  4. Tambah rules:
    • HTTP - Port 80 - 0.0.0.0/0
    • HTTPS - Port 443 - 0.0.0.0/0
  5. Save rules
Huawei Cloud Security Groups
  1. Buka ECS Console
  2. Pergi ke Security Groups
  3. Edit inbound rules
  4. Tambah rules untuk port 80/443
  5. Apply ke ECS instance
# Di ECS instance sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT sudo iptables -I INPUT -p tcp --dport 443 -j ACCEPT

Deployment Aplikasi Web

Aplikasi Web Sederhana (Semua Platform)
# Navigasi ke web root directory # Apache (CentOS): /var/www/html/ # Apache (Ubuntu): /var/www/html/ # Nginx: /usr/share/nginx/html/ cd /var/www/html/ # Buat file index.html sudo cat > index.html << 'EOF' <!DOCTYPE html> <html lang="id"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Cloud Deployment Demo</title> <style> body { font-family: Arial, sans-serif; margin: 0; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; } .container { max-width: 800px; margin: 0 auto; background: rgba(255,255,255,0.1); padding: 2rem; border-radius: 15px; backdrop-filter: blur(10px); } .platform-badge { display: inline-block; padding: 0.3rem 0.8rem; margin: 0.2rem; border-radius: 20px; font-size: 0.8rem; } </style> </head> <body> <div class="container"> <h1>🚀 Aplikasi Web Cloud</h1> <div class="platform-badge" style="background: #667eea;">OpenNebula</div> <div class="platform-badge" style="background: #ff9900;">AWS</div> <div class="platform-badge" style="background: #ff0000;">Huawei Cloud</div> <div style="margin-top: 2rem;"> <h3>📊 Informasi System:</h3> <p><strong>Platform:</strong> <span id="platform">Detecting...</span></p> <p><strong>IP Address:</strong> <span id="ip">Loading...</span></p> <p><strong>Timestamp:</strong> <span id="time"></span></p> </div> <button onclick="showAlert()" style="padding: 1rem 2rem; background: white; color: #667eea; border: none; border-radius: 8px; font-size: 1.1rem; cursor: pointer; margin-top: 1rem;"> 🎯 Test Deployment </button> </div> <script> // Platform detection const platform = window.location.hostname.includes('aws') ? 'AWS' : window.location.hostname.includes('huawei') ? 'Huawei Cloud' : 'OpenNebula'; document.getElementById('platform').textContent = platform; // Get IP address fetch('https://api.ipify.org?format=json') .then(r => r.json()) .then(data => document.getElementById('ip').textContent = data.ip); // Update time document.getElementById('time').textContent = new Date().toLocaleString(); function showAlert() { alert(`✅ Deployment berhasil di ${platform}!`); } </script> </body> </html> EOF # Set permissions sudo chmod 644 index.html sudo chown apache:apache index.html # Untuk Apache sudo chown nginx:nginx index.html # Untuk Nginx
Tips Platform-Specific
OpenNebula:
  • Gunakan private IP untuk testing internal
  • Konfigurasi virtual network dengan benar
  • Monitor resource usage di Sunstone
AWS:
  • Gunakan Public IPv4 untuk akses external
  • Leverage Security Groups untuk security
  • Monitor dengan CloudWatch
Huawei Cloud:
  • Gunakan Elastic IP untuk akses stable
  • Konfigurasi ECS security groups
  • Utilize Cloud Eye untuk monitoring

Testing dan Verifikasi

Test Akses Lokal
# Test dari dalam VM curl http://localhost # Check web server status sudo systemctl status apache2 sudo systemctl status nginx # Test PHP (jika installed) curl http://localhost/info.php # Check error logs sudo tail -f /var/log/httpd/error_log sudo tail -f /var/log/nginx/error.log
Test Akses External
# Test dari local machine # Ganti [ip-address] dengan: # - OpenNebula: Private IP (internal) / Public IP (jika ada) # - AWS: Public IPv4 # - Huawei: Elastic IP curl http://[ip-address] # Test dengan web browser http://[ip-address] # Advanced testing time curl -s http://[ip-address] > /dev/null # Check response headers curl -I http://[ip-address]
Troubleshooting Multi-Platform
Connection Issues:
• Check security groups
• Verify firewall rules
• Test network connectivity
Web Server Down:
• Check service status
• Review error logs
• Verify port binding
Permission Issues:
• Check file ownership
• Verify permissions
• Review SELinux/AppArmor

Tugas Praktikum & Penilaian

Tugas 1: Multi-Platform Deployment

Objective: Deploy aplikasi yang sama di ketiga platform cloud

  • Deploy aplikasi web static di OpenNebula, AWS, dan Huawei Cloud
  • Dokumentasi proses deployment masing-masing platform
  • Bandingkan pengalaman deployment di setiap platform
  • Capture screenshot dari aplikasi yang berjalan
Deliverables:
  • 3 URL akses aplikasi (semua platform)
  • Screenshot deployment process
  • Laporan perbandingan platform
Nilai: 40%

Tugas 2: Performance Analysis

Objective: Analisis performa aplikasi di berbagai platform

  • Test response time dari setiap platform
  • Implementasi caching dan compression
  • Bandwidth utilization analysis
  • Optimasi web server configuration
# Performance testing command ab -n 1000 -c 10 http://[ip-address]/ curl -s -w "Total: %{time_total}s\n" http://[ip-address]
Nilai: 30%

Tugas 3: Comparative Analysis

Objective: Membuat analisis komparatif platform cloud

  • Bandingkan ease of deployment
  • Analisis cost structure masing-masing platform
  • Evaluasi security features
  • Rekomendasi use case untuk setiap platform
Analysis Criteria:
  • Setup complexity
  • Performance metrics
  • Cost efficiency
  • Security implementation
Nilai: 30%

Kriteria Penilaian

Technical Implementation (60%)

  • Successful deployment semua platform (25%)
  • Web server configuration (20%)
  • Network & security setup (15%)

Documentation & Analysis (30%)

  • Comparative analysis report (15%)
  • Performance testing results (10%)
  • Screenshot documentation (5%)

Participation & Attendance (10%)

  • Class participation (5%)
  • Attendance (5%)

Resources Tambahan

Deployment Tools

  • OpenNebula: Sunstone Web Interface
  • AWS: AWS CLI, CloudFormation
  • Huawei Cloud: Cloud Console, CLI
  • Web Server: Apache, Nginx

Learning Resources

  • Multi-Cloud Strategy Guide
  • Web Server Performance Tuning
  • Cloud Security Best Practices
  • Cost Optimization Techniques