Aug 232013

After making an Access Point out of a Raspberry Pi, I decided to see what else I could do with it.

One of the things I had noticed on the forums was a captive portal function. When someone connects to the Access Point, no matter where they point their web browser it will always direct them to the page hosted on the Pi.

In order to do that, we’ll need to install a web server on the Pi to host the page.
I’ve used lighttpd for this setup, so it’s a simple apt-get install lighttpd

The default directory for lighttpd is /var/www, so you can place your splash page in there.

Once lighttpd is installed, we need to make a slight change to the dnsmasq configuration.
Add the extra line below into /etc/dnsmasq.conf, replace with the IP address of the AP if you have not followed the guide above.


Once the file has been updated, restart dnsmasq

/etc/init.d/dnsmasq restart

Now, whenever someone connects to the access point and points their web browser to anything, it will be directed to the splash page that you have created !

Feb 082013

As a continuation this post, I have completed the first version of the RaspAP WebGUI. I have yet to decide on a good name for it though.

If you would like to download it to try it out, the links to the PHP script and supporting files are here –
Zip Version
tar.gz Version

Specific instructions to install the supported software are in the post linked at the beginning of this post.
For a quick run through, read on !
The Packages required for the WebGUI are –

  • lighttpd (I have version 1.4.31-2 installed via apt)
  • php5-cgi (I have version 5.4.4-12 installed via apt)

along with their supporting packages, php5 will also need to be enabled via the following command and lighttpd restarted.

sudo lighty-enable-mod fastcgi-php
/etc/init.d/lighttpd restart

/etc/sudoers will also need to be updated with the following line –

www-data ALL=(ALL) NOPASSWD:/sbin/ifdown wlan0,/sbin/ifup wlan0,/bin/cat /etc/wpa_supplicant/wpa_supplicant.conf,/bin/cp /tmp/wifidata /etc/wpa_supplicant/wpa_supplicant.conf,/sbin/wpa_cli scan_results,/sbin/wpa_cli scan,/bin/cp /tmp/hostapddata /etc/hostapd/hostapd.conf,/etc/init.d/hostapd start,/etc/init.d/hostapd stop,/etc/init.d/dnsmasq start,/etc/init.d/dnsmasq stop,/bin/cp /tmp/dhcpddata /etc/dnsmasq.conf

Once those modifications are done, unzip the files to /var/www and it should be up and running !

Keep in mind that this is a very very first alpha version of this.
In testing, it worked for me, but if you have issues or feedback, please feel free to contact me or comment on this post 🙂 I look forward to hearing back from anyone who has tried this out 🙂