Instalasi Manual — Linux & macOS
Instalasi manual ini cocok untuk lingkungan production pada sistem operasi Ubuntu, Linux lainnya, atau macOS. Namun perlu dipahami bahwa instalasi manual membutuhkan pemahaman dasar tentang konfigurasi server web (Apache/Nginx), virtual host, serta permission file dan folder.
1. Instalasi Prasyarat
Section titled “1. Instalasi Prasyarat”brew install php mysql nginx git composersudo add-apt-repository ppa:ondrej/php -ysudo apt-get updatesudo apt install -y php8.3 php8.3-cli php8.3-common php8.3-curl php8.3-mbstring php8.3-intl php8.3-mysql php8.3-xml php8.3-fpm php8.3-gd php8.3-zip php8.3-xdebug unzip nginx mysql-serverCatatan: Jika
add-apt-repositorybelum tersedia, jalankansudo apt-get install software-properties-common.
2. Unduh dan Pasang ILDIS
Section titled “2. Unduh dan Pasang ILDIS”cd /var/wwwgit clone https://github.com/bphndigitalservice/ildis.gitcomposer installphp init3. Konfigurasi .env
Section titled “3. Konfigurasi .env”cp .env.example .envEdit file .env:
# Database configurationDB_HOST=localhostDB_USER=rootDB_PASSWORD=yourpasswordDB_DATABASE=ildis_v4DB_DATABASE_PORT=33064. Migrasi Database
Section titled “4. Migrasi Database”Buat database terlebih dahulu:
mysql -u root -p -e "CREATE DATABASE ildis_v4;"Lalu jalankan migrasi:
php yii migrate5. Konfigurasi Web Server
Section titled “5. Konfigurasi Web Server”Buat file virtual host untuk Apache:
sudo nano /etc/apache2/sites-available/ildis.conf<VirtualHost *:80> #ganti dengan domain anda ServerName ildis-demo.bphn.go.id
#ErrorLog /var/log/apache2/advanced.local.error.log #CustomLog /var/log/apache2/advanced.local.access.log combined AddDefaultCharset UTF-8
Options FollowSymLinks DirectoryIndex index.php index.html RewriteEngine on
RewriteRule /\. - [L,F]
DocumentRoot /var/www/ildis/ <Directory /var/www/ildis/> AllowOverride none <IfVersion < 2.4> Order Allow,Deny Allow from all </IfVersion> <IfVersion >= 2.4> Require all granted </IfVersion>
# if a directory or a file exists, use the request directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward the request to index.php RewriteRule ^ index.php [L] </Directory>
# redirect to the URL without a trailing slash (uncomment if necessary) #RewriteRule ^/admin/$ /admin [L,R=301]
Alias /admin /var/www/ildis/backend/ # prevent the directory redirect to the URL with a trailing slash RewriteRule ^/admin$ /admin/ [L,PT] <Directory /var/www/ildis/backend/> AllowOverride none <IfVersion < 2.4> Order Allow,Deny Allow from all </IfVersion> <IfVersion >= 2.4> Require all granted </IfVersion>
# if a directory or a file exists, use the request directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward the request to index.php RewriteRule ^ index.php [L] </Directory></VirtualHost>Atau konfigurasi Nginx:
sudo nano /etc/nginx/sites-available/ildisserver { set $project_root /path/to/ildis.go.id; #set $fcgi_server 127.0.0.1:9000; set $fcgi_server unix:/var/run/php-fpm/example.socket;
charset utf-8; client_max_body_size 128M;
listen 80;
server_name ildis.go.id; root $project_root/; index index.php;
access_log /var/log/nginx/ildis.access.log combined; error_log /var/log/nginx/ildis.error.log warn;
location ^~ /backend { rewrite ^/backend(.*)$ /backend/$1 last; }
location ^~ /backend/ { root $project_root;
# uncomment the following, if you want to enable speaking URL in the backend #try_files $uri $uri/ /backend/index.php$is_args$args;
location ~ /\.(ht|svn|git) { deny all; }
location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass $fcgi_server; try_files $uri =404; } }
location / { try_files $uri $uri/ /index.php$is_args$args; }
location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|woff2?|ttf|svg|eot|webp|pdf)$ { expires 30d; access_log off; add_header Cache-Control "public"; try_files $uri =404; }
location ~ /\.(ht|svn|git|env|DS_Store) { deny all; }
location ~ ^/(vendor|node_modules|\.vagrant|vagrant|DATABASE|\.github)(/|$) { deny all; return 403; }
location ~* ^/(Vagrantfile|composer\.(json|lock|phar)|package\.json|\.bowerrc|\.gitignore|README.*|CHANGE.*|codeception\.yml|requirements\.php|yii(_test)?(\.bat)?)$ { deny all; return 403; }
location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass $fcgi_server; try_files $uri =404; }}Lalu aktifkan config-nya:
sudo brew services restart nginxsudo systemctl restart nginx6. Edit /etc/hosts
Section titled “6. Edit /etc/hosts”127.0.0.1 ildis-frontend.test127.0.0.1 ildis-backend.testAkses Aplikasi
Section titled “Akses Aplikasi”- http://ildis-frontend.test (untuk frontend)
- http://ildis-backend.test (untuk halaman admin)
Langkah Selanjutnya
Section titled “Langkah Selanjutnya”Setelah instalasi berhasil, lanjutkan ke halaman berikut untuk konfigurasi awal: