|
|
|
## CAPI-STIS-Web ##
|
|
|
|
|
|
|
|
*CAPI-STIS-Web is an Enketo Express application development that aims to be a Web-based CAPI client application*
|
|
|
|
### Instalasi ###
|
|
|
|
|
|
|
|
### Installation ###
|
|
|
|
Untuk menggunakan CAPI-STIS-Web, instal Enketo Express dan masukkan folder dari repositori ke dalam aplikasi
|
|
|
|
|
|
|
|
*To use CAPI-STIS-Web, install Enketo Express and insert a folder from respository into the application*
|
|
|
|
Tahapan instalasi aplikasi Enketo Express dapat diikuti dalam url berikut: https://blog.enketo.org/install-enketo-production-ubuntu/
|
|
|
|
|
|
|
|
*Installing an Enketo Express application can be followed in the following url:* https://blog.enketo.org/install-enketo-production-ubuntu/
|
|
|
|
Tahapan Instalasi Lengkap ikuti petunjuk seperti di bawah Ini :
|
|
|
|
|
|
|
|
Complete Installation Stages As Below:
|
|
|
|
**Instalasi pada server (ubuntu-server)**
|
|
|
|
|
|
|
|
**Installation on server (ubuntu-server)**
|
|
|
|
|
|
|
|
1. Install the first batch of software packages as follows and enter Y when asked to confirm :
|
|
|
|
1. Install software packages berikut dan tekan Y untuk konfirmasi :
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo add-apt-repository -y ppa:chris-lea/redis-server
|
| ... | ... | @@ -20,7 +18,7 @@ Complete Installation Stages As Below: |
|
|
|
sudo apt-get upgrade -y
|
|
|
|
sudo apt-get install -y git nginx htop build-essential redis-server checkinstall python
|
|
|
|
```
|
|
|
|
1. Install NodeJS and global Node packages
|
|
|
|
1. Install NodeJS dan global Node packages
|
|
|
|
|
|
|
|
```
|
|
|
|
curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
|
| ... | ... | @@ -35,9 +33,9 @@ Complete Installation Stages As Below: |
|
|
|
cd enketo-express
|
|
|
|
npm install --production
|
|
|
|
```
|
|
|
|
1. Configure Redis
|
|
|
|
1. Konfigurasi Redis
|
|
|
|
|
|
|
|
Configure 2 redis instances that run on different ports :
|
|
|
|
konfigurasikan 2 redis instances yang berjalan pada port yang berbeda :
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo systemctl stop redis
|
| ... | ... | @@ -46,7 +44,7 @@ Complete Installation Stages As Below: |
|
|
|
sudo cp ~/enketo-express/setup/redis/conf/redis-enketo-cache.conf /etc/redis/
|
|
|
|
sudo cp ~/enketo-express/setup/redis/systemd/system/* /etc/systemd/system/
|
|
|
|
```
|
|
|
|
Start the 2 redis instances :
|
|
|
|
Start 2 redis instances :
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo systemctl disable redis
|
| ... | ... | @@ -69,14 +67,14 @@ Complete Installation Stages As Below: |
|
|
|
ping
|
|
|
|
exit
|
|
|
|
```
|
|
|
|
The response to both tests should be: “PONG”.
|
|
|
|
1. Configure Enketo
|
|
|
|
Apabila berhasil respon yang diberikan adalah : “PONG”.
|
|
|
|
1. Konfigurasi Enketo
|
|
|
|
|
|
|
|
```
|
|
|
|
cp ~/enketo-express/config/default-config.json ~/enketo-express/config/config.json
|
|
|
|
nano ~/enketo-express/config/config.json
|
|
|
|
```
|
|
|
|
The default configuration is almost functional. We just need to create a secret API key and encryption key. is easiest to just set the server url to "" for now. So the minimum configuration items to change are:
|
|
|
|
Ubah konfigurasi server url menjadi ""
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
{
|
| ... | ... | @@ -100,37 +98,37 @@ Complete Installation Stages As Below: |
|
|
|
grunt
|
|
|
|
```
|
|
|
|
|
|
|
|
1. Copy file from repository
|
|
|
|
1. Copy file dari repository
|
|
|
|
|
|
|
|
1. Copy and replace files in the app-controller folder to enketo-express/app/controller directory
|
|
|
|
1. Copy and replace files dalam folder app-controller ke dalam direktori enketo-express/app/controller
|
|
|
|
|
|
|
|
in web-authentication-controller.js
|
|
|
|
pada file web-authentication-controller.js
|
|
|
|
|
|
|
|
```
|
|
|
|
var odkurl = 'http://192.168.165.4:3000';
|
|
|
|
var odkrealm = ':ODK Aggregate VM 1.4.12.0:';
|
|
|
|
```
|
|
|
|
change the odkurl to your [ODK API] (https://git.stis.ac.id/14.7977/odk-api) ip address and change the realm accordingly
|
|
|
|
ubah odkurl menjadi alamat ip address [ODK API] (https://git.stis.ac.id/14.7977/odk-api) yang telah diinstall
|
|
|
|
|
|
|
|
in web-request-controller.js
|
|
|
|
pada file web-request-controller.js
|
|
|
|
|
|
|
|
```
|
|
|
|
var odk_url = 'http://192.168.165.4';
|
|
|
|
var enketo_url = 'http://192.168.165.6:8005/api/v2/';
|
|
|
|
```
|
|
|
|
|
|
|
|
change the odk_url to your [ODK API] (https://git.stis.ac.id/14.7977/odk-api) ip address and change enketo_url to the enketo-express you've just installed
|
|
|
|
ubah odk_url menjadi alamat ip address [ODK API] (https://git.stis.ac.id/14.7977/odk-api) dan ubah enketo_url menjadi alamat enketo-express yang telah diinstall sebelumnya
|
|
|
|
|
|
|
|
1. Copy and replace files in the app-views-web folder to enketo-express/app/views/web directory
|
|
|
|
1. Copy dan replace files dalam folder app-views-web ke dalam direktori enketo-express/app/views/web
|
|
|
|
|
|
|
|
1. Copy and replace files in the public-js folder to enketo-express/public/js directory
|
|
|
|
1. Copy dan replace files dalam folder public-js ke dalam direktori enketo-express/public/js
|
|
|
|
|
|
|
|
1. Copy and replace files in the public-web folder to enketo-express/public/web directory
|
|
|
|
1. Copy dan replace files dalam folder public-web ke dalam direktori enketo-express/public/web
|
|
|
|
|
|
|
|
1. Start the application
|
|
|
|
1. Jalankan aplikasi
|
|
|
|
|
|
|
|
```
|
|
|
|
npm start
|
|
|
|
```
|
|
|
|
|
|
|
|
go to http://ip_address:8005/web/home |
|
|
\ No newline at end of file |
|
|
|
buka alamat http://ip_address:8005/web/home |
|
|
\ No newline at end of file |