[Nodogsplash] Nodogsplash Error 503, PHP content

PV Subramanian pvsub0 at gmail.com
Wed Mar 21 15:30:56 UTC 2018


Hello:

To get my feet wet with FAS:

- On the same Raspberry Pi, installed Apache2, listening on port 8079

- Copied the splash.html
<https://github.com/nodogsplash/nodogsplash/blob/master/forward_authentication_service/etc/nodogsplash/htdocs/splash.html>
 from the Github repo into my /etc/nodogsplash/htdocs

- Copied landing.php
<https://github.com/nodogsplash/nodogsplash/blob/master/forward_authentication_service/nodog/landing.php>
from
Github repo to Apache's /var/www/html

- Tested landing.php responds by visiting 192.168.100.1:8079/landing.php,
it showed valid messages ("you are authorized" etc)

- Edited splash.html to replace http://onboard-wifi.net/nodog/fas.php with
http://192.168.100.1:8079/landing.php (everything after the ? in the URL
string was retained)

This is what I get on my Android device upon trying to sign-in

Webpage not available
The webpage at
http://192.168.100.1:8079/landing.php?authaction=http://192.168.100.1:2050/nodogsplash_auth/&gatewayname=NoDogSplash&tok=05607a99&redir=http://connectivitycheck.gstatic.com/generate_204&mac=b4:f1:da:ef:b9:14&ip=192.168.100.125could
not be loaded because:

net::ERR_CONNECTION_REFUSED

Hopefully something simple I am missing, thanks for your time and help

Regards



On Wed, Mar 21, 2018 at 9:10 AM, PV Subramanian <pvsub0 at gmail.com> wrote:

> Hello: Thank you for the detailed response Rob.
>
> The PHP is hosted on the Raspberry Pi as well. Its (almost) a standalone
> system since the the only connection to the Internet is Twilio.
>
> I wonder:
>
> - could I go the Python route instead?
> - could I (somehow) run the PHP via CGI
>
> Regards
>
> On Tue, Mar 20, 2018 at 2:22 PM, Rob <rob at blue-wave.net> wrote:
>
>> Where is the php hosted? NodogSplash does not support php, hence the
>> Error 503.
>> To do this you will need NodogSplash FAS:
>> http://nodogsplash.readthedocs.io/en/latest/authentication.html
>>
>> https://github.com/nodogsplash/nodogsplash/tree/master/
>> forward_authentication_service
>>
>> There is a very simple test server still up at the time of writing making
>> it easy to test and get to grips with FAS.
>> It is quite simple once you have figured out the principle. Give it a
>> try. You will need to modify your code to return at least $tok back to the
>> url in $authaction.
>> --
>> Blue Wave Projects and Services, specialists in networks and wireless
>> data services.Low cost Public WiFi Hotspots with Zero subscription costs.
>> http://blue-wave.net
>>
>> On Tue, 2018-03-20 at 12:47 -0400, PV Subramanian wrote:
>>
>> Hello:
>>
>> I am using Nodogsplash on a Raspberry Pi 3. The captive portal is a form
>> that takes a phone number and a message, and the form action calls a PHP
>> file, which sends the message to the phone number using Twilio (which turns
>> it into an SMS).
>>
>> The setup has been tested on a PC, works fine.
>>
>> When moved to the htdocs folder, I get an Internal Server Error 503.
>>
>> Thank you for guidance
>>
>> ---HTML file start---
>> <html>
>> <body>
>>
>> <form action="form_to_sms.php" method="post">
>> Phone: <input type="text" name="phone"><br>
>> Mesage: <input type="text" name="body"><br>
>> <input type="submit">
>> </form>
>>
>> </body>
>> </html>
>> ---HTML file end---
>>
>> ---PHP file start---
>> <html>
>> <body>
>>
>> <p>Sending ...</p>
>>
>> <?php
>>
>> // Require the bundled autoload file - the path may need to change
>> // based on where you downloaded and unzipped the SDK
>> require __DIR__ . '/twilio-php-master/Twilio/autoload.php';
>>
>> // Use the REST API Client to make requests to the Twilio REST API
>> use Twilio\Rest\Client;
>>
>> // Credentials to connect to Twilio
>> $sid = 'AC1234xxx';
>> $token = '8a18ccxxx';
>>
>> // Twilio number the SMS message will be from. You can only send SMS
>> messages from a number purchased from Twilio.
>> $from = '+12223334444;
>>
>> // Create a connection to Twilio's API with credentials
>> $client = new Client($sid, $token);
>>
>> // Actually send the number. This is where the magic happens!
>> if(!empty($_POST['phone']) && !empty($_POST['body'])){
>>
>> // Use the client to do fun stuff like send text messages!
>> $client->messages->create(
>>     // the number you'd like to send the message to
>>     $_POST['phone'],
>>     array(
>>         // A Twilio phone number you purchased at twilio.com/console
>>         'from' => $from,
>>         // the body of the text message you'd like to send
>>         'body' => $_POST['body']
>>     )
>> );
>> }
>> echo "Message sent, press Back button"
>> ?>
>> </body>
>> </html>
>> ---PHP file end---
>>
>> _______________________________________________
>> Nodogsplash mailing listNodogsplash at ml.ninux.orghttp://ml.ninux.org/mailman/listinfo/nodogsplash
>>
>>
>> _______________________________________________
>> Nodogsplash mailing list
>> Nodogsplash at ml.ninux.org
>> http://ml.ninux.org/mailman/listinfo/nodogsplash
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ml.ninux.org/pipermail/nodogsplash/attachments/20180321/64ebbd6b/attachment-0001.htm>


More information about the Nodogsplash mailing list