SURVEY/DATA COLLECTION:

In this episode, we'll discuss how to create a mobile Wi-Fi server that can serve questionnaires/surveys to a group of customers, lecture attendees for an interactive lecture to receive feedback or so and display it via collecting the responses as databases.

To start with, there is a link to a ready script for captive portal and hotspot.

The hotspot serves a PHP page that is dynamic that can talk to MySQL server where contents can be displayed via another page.

The underlying web server is NGINX that has the power to provide captive portal as well as web serving.

https://github.com/jerryryle/rogueportal


wget https://github.com/jerryryle/rogueportal/releases/download/v1.3-RaspbianBuster/rogueportal_1.3_armhf.deb


some changes can be made beforehand to make installation more automated:

sudo debconf-set-selections <<< "macchanger acchanger/automatically_run boolean true"

sudo debconf-set-selections <<< "iptables-persistent iptables-persistent/autosave_v6 boolean true"

sudo debconf-set-selections <<< "iptables-persistent iptables-persistent/autosave_v4 boolean true"


to specify SSID:

sudo debconf-set-selections <<< "rogueportal rogueportal/ssid string Yo ur SSID"

Actual Installation:

sudo apt install ./rogue*.deb

install lighttpd to serve your phpmyadmin page as well as access contents and test them.

sudo nano /etc/lighttpd/lighttpd.conf

port:8080

sudo dpkg-reconfigure phpmyadmin to re-edit

sudo ln -s /usr/share/phpmyadmin /var/www/html

sudo lighttpd-enable-mod fastcgi fastcgi-php

sudo service lighttpd force-reload


To access them while connecting to the hotspot not via let's say Ethernet, accept connection by editing

sudo nano /etc/iptables/rules.v4


To support index.php include this in nginx/sites-available/default in server { }

location ~ \.php$ {

include snippets/fastcgi-php.conf;

fastcgi_pass unix:/run/php/php7.0-fpm.sock;

}