Php uhttpd and nodogsplash

Hi All
I have some issue. I'm trying to config nodogsplash (hotspot) in my router tp-link archer c7. I could install nodogsplash and php. uhttpd already installed by defaulft. I put a hola.html file in the folder /etc/nodogsplash/htdocs to do a check in this doesn't show me nothing (just for test)
http://192.168.1.2:2050/hola.html

code php

<html>
<head></head>
<body>
<?php
  echo "Hola Mundo";
?>
</body>
</html>

Could you someone help to figured out what I'm doing wrong?
Thanks

I'm also try this file ( hola.html) in the folder "www" and I didn't work either

>netstat -lnp
>ps w
>opkg list-installed | cut -d' ' -f1 | grep php
>uci show uhttpd | grep php

please also post links to the relevant guides you followed?

1 Like

Ummmm...

  • did you installed a PHP processor?
  • does uhttpd even have a PHP module?

Search, really, is your friend. Had you tried it, you likely would have found, for example

https://openwrt.org/packages/table/start?dataflt[Name_pkg-dependencies*~]=nodog

or

https://forum.openwrt.org/search?q=nodogsplash

Hi Thanks for your polite answer. I really apreciate. You are polite
Look the results about the commands

root@OpenWrt:~# netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State                                                                                               PID/Program name
tcp        0      0 0.0.0.0:2050            0.0.0.0:*               LISTEN                                                                                              3628/nodogsplash
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN                                                                                              1200/uhttpd
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN                                                                                              1682/dnsmasq
tcp        0      0 192.168.1.2:53          0.0.0.0:*               LISTEN                                                                                              1682/dnsmasq
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN                                                                                              1049/dropbear
tcp        0      0 :::80                   :::*                    LISTEN                                                                                              1200/uhttpd
tcp        0      0 fe80::b24e:26ff:fe53:b8c9:53 :::*                    LISTEN                                                                                              1682/dnsmasq
tcp        0      0 ::1:53                  :::*                    LISTEN                                                                                              1682/dnsmasq
tcp        0      0 fe80::b24e:26ff:fe53:b8c9:53 :::*                    LISTEN                                                                                              1682/dnsmasq
tcp        0      0 fd10:f58f:c0e7::1:53    :::*                    LISTEN                                                                                              1682/dnsmasq
tcp        0      0 fe80::b24e:26ff:fe53:b8c9:53 :::*                    LISTEN                                                                                              1682/dnsmasq
tcp        0      0 fe80::b24e:26ff:fe53:b8c9:53 :::*                    LISTEN                                                                                              1682/dnsmasq
tcp        0      0 :::22                   :::*                    LISTEN                                                                                              1049/dropbear
udp        0      0 127.0.0.1:53            0.0.0.0:*                                                                                                                   1682/dnsmasq
udp        0      0 192.168.1.2:53          0.0.0.0:*                                                                                                                   1682/dnsmasq
udp        0      0 0.0.0.0:67              0.0.0.0:*                                                                                                                   1682/dnsmasq
udp        0      0 :::546                  :::*                                                                                                                        1521/odhcp6c
udp        0      0 :::547                  :::*                                                                                                                        1144/odhcpd
udp        0      0 fe80::b24e:26ff:fe53:b8c9:53 :::*                                                                                                                        1682/dnsmasq
udp        0      0 ::1:53                  :::*                                                                                                                        1682/dnsmasq
udp        0      0 fe80::b24e:26ff:fe53:b8c9:53 :::*                                                                                                                        1682/dnsmasq
udp        0      0 fd10:f58f:c0e7::1:53    :::*                                                                                                                        1682/dnsmasq
udp        0      0 fe80::b24e:26ff:fe53:b8c9:53 :::*                                                                                                                        1682/dnsmasq
udp        0      0 fe80::b24e:26ff:fe53:b8c9:53 :::*                                                                                                                        1682/dnsmasq
udp        0      0 :::123                  :::*                                                                                                                        1491/ntpd
raw        0      0 ::%1:58                 ::%4448412:*            58                                                                                                  1521/odhcp6c
raw        0      0 ::%1:58                 ::%4448412:*            58                                                                                                  1144/odhcpd
raw        0      0 ::%1:58                 ::%4448412:*            58                                                                                                  1144/odhcpd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Pat                                                                                        h
unix  2      [ ACC ]     STREAM     LISTENING      11340 3628/nodogsplash    /tm                                                                                        p/ndsctl.sock
unix  2      [ ACC ]     STREAM     LISTENING        395 513/ubusd           /va                                                                                        r/run/ubus.sock
root@OpenWrt:~# ps w
  PID USER       VSZ STAT COMMAND
    1 root      1552 S    /sbin/procd
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    7 root         0 SW<  [lru-add-drain]
    8 root         0 SW   [kworker/u2:1]
   73 root         0 SW   [oom_reaper]
   81 root         0 SW<  [writeback]
   83 root         0 SW   [kcompactd0]
   84 root         0 SW<  [crypto]
   85 root         0 SW<  [bioset]
   87 root         0 SW<  [kblockd]
  105 root         0 SW<  [watchdogd]
  118 root         0 SW   [kworker/0:1]
  125 root         0 SW   [kswapd0]
  185 root         0 SW   [spi0]
  222 root         0 SW<  [bioset]
  228 root         0 SW<  [bioset]
  234 root         0 SW<  [bioset]
  240 root         0 SW<  [bioset]
  246 root         0 SW<  [bioset]
  251 root         0 SW<  [bioset]
  257 root         0 SW<  [bioset]
  364 root         0 SW<  [ipv6_addrconf]
  371 root         0 SW<  [kworker/0:1H]
  446 root         0 SWN  [jffs2_gcd_mtd5]
  513 root      1192 S    /sbin/ubusd
  514 root       900 S    /sbin/askfirst /usr/libexec/login.sh
  581 root         0 SW<  [cfg80211]
  594 root         0 SW<  [ath10k_wq]
  595 root         0 SW<  [ath10k_aux_wq]
  951 root      1224 S    /sbin/logd -S 64
  970 root      1536 S    /sbin/rpcd
 1049 root      1064 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
 1106 root      1652 S    /sbin/netifd
 1144 root      1420 S    /usr/sbin/odhcpd
 1150 root      1132 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
 1200 root      1328 S    /usr/sbin/uhttpd -f -h /www -r OpenWrt -x /cgi-bin -t 60 -T 30 -k 20 -A 1 -n 3 -N 100 -R -p 0.0.0.0:80 -p
 1205 root      1200 S    -ash
 1491 root      1204 S<   /usr/sbin/ntpd -n -N -l -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org -p
 1521 root      1028 S    odhcp6c -s /lib/netifd/dhcpv6.script -P0 -t120 eth0.2
 1637 root      1708 S    /usr/sbin/hostapd -s -P /var/run/wifi-phy1.pid -B /var/run/hostapd-phy1.conf
 1682 dnsmasq   1320 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid
 1728 root      1212 S    /usr/sbin/pppd nodetach ipparam wan ifname pppoe-wan lcp-echo-interval 1 lcp-echo-failure 5 lcp-echo-adap
 1759 root      1200 R    ps w
 3628 root      1472 S    /usr/bin/nodogsplash -c /tmp/etc/nodogsplash_cfg015847.conf -s -f -d 5
 4648 root         0 SW   [kworker/u2:2]
root@OpenWrt:~# opkg list-installed | cut -d' ' -f1 | grep php
php7
php7-cgi
root@OpenWrt:~# uci show uhttpd | grep php
uhttpd.main.interpreter='.php=/usr/bin/php-cgi'
root@OpenWrt:~#

About the links that I follow to try to do this:

PHP
uHTTPd
hotspot Nodogsplash

Adding this information maybe could be useful

root@OpenWrt:~# php-cgi -v
PHP 7.2.16 (cgi-fcgi)
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

php.ini

[PHP]
zend.ze1_compatibility_mode = Off

; Language Options

engine = On
;short_open_tag = Off
precision    =  12
y2k_compliance = On
output_buffering = Off
;output_handler =
zlib.output_compression = Off
;zlib.output_compression_level = -1
;zlib.output_handler =
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 100

;open_basedir =
disable_functions =
disable_classes =

; Colors for Syntax Highlighting mode.  Anything that's acceptable in
; <span style="color: ???????"> would work.
;highlight.string  = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg      = #FFFFFF
;highlight.default = #0000BB
;highlight.html    = #000000

;ignore_user_abort = On
;realpath_cache_size = 16k
;realpath_cache_ttl = 120

; Miscellaneous

expose_php = On

; Resource Limits

max_execution_time = 30	; Maximum execution time of each script, in seconds.
max_input_time = 60	; Maximum amount of time each script may spend parsing request data.
;max_input_nesting_level = 64
memory_limit = 8M	; Maximum amount of memory a script may consume.

; Error handling and logging

; Error Level Constants:
; E_ALL             - All errors and warnings (includes E_STRICT as of PHP 6.0.0)
; E_ERROR           - fatal run-time errors
; E_RECOVERABLE_ERROR  - almost fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it's automatically initialized to an
;                     empty string)
; E_STRICT			- run-time notices, enable to have PHP suggest changes
;                     to your code which will ensure the best interoperability
;                     and forward compatibility of your code
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
; E_DEPRECATED      - warn about code that will not work in future versions
;                     of PHP
; E_USER_DEPRECATED - user-generated deprecation warnings
;
; Common Values:
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE
error_reporting  =  E_ALL & ~E_NOTICE & ~E_STRICT

display_errors = On
display_startup_errors = Off
log_errors = Off
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
;report_zend_debug = 0
track_errors = Off
;html_errors = Off
;docref_root = "/phpmanual/"
;docref_ext = .html
;error_prepend_string = "<font color=#ff0000>"
;error_append_string = "</font>"
; Log errors to specified file.
;error_log = /var/log/php_errors.log
; Log errors to syslog.
;error_log = syslog

; Data Handling

;arg_separator.output = "&amp;"
;arg_separator.input = ";&"
variables_order = "EGPCS"
request_order = "GP"
register_globals = Off
register_long_arrays = Off
register_argc_argv = On
auto_globals_jit = On
post_max_size = 8M
;magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
;default_charset = "iso-8859-1"
;always_populate_raw_post_data = On

; Paths and Directories

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
doc_root = "/etc/nodogsplash/htdocs"
user_dir =
extension_dir = "/usr/lib/php"
enable_dl = On
cgi.force_redirect = 1
cgi.nph = 1
cgi.redirect_status_env = ;
cgi.fix_pathinfo=1
fastcgi.impersonate = 1;
fastcgi.logging = 0
cgi.rfc2616_headers = 0

; File Uploads

file_uploads = On
upload_tmp_dir = "/tmp"
upload_max_filesize = 2M
max_file_uploads = 20

; Fopen wrappers

allow_url_fopen = On
allow_url_include = Off
;from="john@doe.com"
;user_agent="PHP"
default_socket_timeout = 60
;auto_detect_line_endings = Off

uhttpd

# Server configuration
config uhttpd main

	# HTTP listen addresses, multiple allowed
	list listen_http	0.0.0.0:80
	list listen_http	[::]:80

	# HTTPS listen addresses, multiple allowed
	list listen_https	0.0.0.0:443
	list listen_https	[::]:443

	# Redirect HTTP requests to HTTPS if possible
	option redirect_https	1

	# Server document root
	option home		/www

	# Reject requests from RFC1918 IP addresses
	# directed to the servers public IP(s).
	# This is a DNS rebinding countermeasure.
	option rfc1918_filter 1

	# Maximum number of concurrent requests.
	# If this number is exceeded, further requests are
	# queued until the number of running requests drops
	# below the limit again.
	option max_requests 3

	# Maximum number of concurrent connections.
	# If this number is exceeded, further TCP connection
	# attempts are queued until the number of active
	# connections drops below the limit again.
	option max_connections 100

	# Certificate and private key for HTTPS.
	# If no listen_https addresses are given,
	# the key options are ignored.
	option cert		/etc/uhttpd.crt
	option key		/etc/uhttpd.key

	# CGI url prefix, will be searched in docroot.
	# Default is /cgi-bin
	option cgi_prefix	/cgi-bin

	# List of extension->interpreter mappings.
	# Files with an associated interpreter can
	# be called outside of the CGI prefix and do
	# not need to be executable.
	list interpreter	".php=/usr/bin/php-cgi"
#	list interpreter	".cgi=/usr/bin/perl"

	# Lua url prefix and handler script.
	# Lua support is disabled if no prefix given.
	option lua_prefix	/luci
	option lua_handler	/usr/lib/lua/luci/sgi/uhttpd.lua

	# Specify the ubus-rpc prefix and socket path.
#	option ubus_prefix	/ubus
#	option ubus_socket	/var/run/ubus.sock

	# CGI/Lua timeout, if the called script does not
	# write data within the given amount of seconds,
	# the server will terminate the request with
	# 504 Gateway Timeout response.
	option script_timeout	60

	# Network timeout, if the current connection is
	# blocked for the specified amount of seconds,
	# the server will terminate the associated
	# request process.
	option network_timeout	30

	# HTTP Keep-Alive, specifies the timeout for persistent
	# HTTP/1.1 connections. Setting this to 0 will disable
	# persistent HTTP connections.
	option http_keepalive	20

	# TCP Keep-Alive, send periodic keep-alive probes
	# over established connections to detect dead peers.
	# The value is given in seconds to specify the
	# interval between subsequent probes.
	# Setting this to 0 will disable TCP keep-alive.
	option tcp_keepalive	1

	# Basic auth realm, defaults to local hostname
#	option realm	OpenWrt

	# Configuration file in busybox httpd format
#	option config	/etc/httpd.conf

	# Do not follow symlinks that point outside of the
	# home directory.
#	option no_symlinks	0

	# Do not produce directory listings but send 403
	# instead if a client requests an url pointing to
	# a directory without any index file.
#	option no_dirlists	0

	# Do not authenticate any ubus-rpc requests against
	# the ubus session/access procedure.
	# This is dangerous and should be always left off
	# except for development and debug purposes!
#	option no_ubusauth	0

	# For this instance of uhttpd use the listed httpauth
	# sections to require Basic auth to the specified
	# resources.
#	list httpauth prefix_user


# Defaults for automatic certificate and key generation
config cert defaults

	# Validity time
	option days		730

	# RSA key size
	option bits		2048

	# Location
	option country		ZZ
	option state		Somewhere
	option location		Unknown

	# Common name
	option commonname	'OpenWrt'

# config httpauth prefix_user
#	option prefix /protected/url/path
#	option username user
#	option password 'plaintext_or_md5_or_$p$user_for_system_user'


config uhttpd 'fusionpbx'
        list listen_http '0.0.0.0:2050'
        list listen_http '[::]:2050'
        option redirect_https '1'
        option home '/etc/nodogsplash/htdocs'
        option index_page 'splash.html'
        option rfc1918_filter '1'
        option max_requests '3'
        option max_connections '100'
        option cert '/etc/uhttpd.crt'
        option key '/etc/uhttpd.key'
        list interpreter '.php=/usr/bin/php-cgi'
        option script_timeout '60'
        option network_timeout '30'
        option http_keepalive '20'
        option tcp_keepalive '1'
        option realm 'GoFLEX'
        option no_symlinks '0'

nodogsplash file


# The options available here are an adaptation of the settings used in nodogsplash.conf.
# See https://github.com/nodogsplash/nodogsplash/blob/master/resources/nodogsplash.conf

config nodogsplash
  # Set to 0 to disable nodogsplash
  option enabled 1

  # Set to 0 to disable hook that makes nodogsplash restart when the firewall restarts.
  # This hook is needed as a restart of Firewall overwrites nodogsplash iptables entries.
  option fwhook_enabled '1'

  # Serve the file splash.html from this directory
  option webroot '/etc/nodogsplash/htdocs'

  # Use plain configuration file
  #option config '/etc/nodogsplash/nodogsplash.conf'

  # Use this option to set the device nogogsplash will bind to.
  # The value may be an interface section in /etc/config/network or a device name such as br-lan.
  option gatewayinterface 'br-lan'

  option gatewayname 'BIDERBOST_HOTSPOT'
  option maxclients '30'

  # Enables debug output (0-7)
  #option debuglevel '7'

  # Client timeouts in minutes
  option preauthidletimeout '30'
  option authidletimeout '120'
  # Session Timeout is the interval after which clients are forced out (a value of 0 means never)
  option sessiontimeout '1200'

  # The interval in seconds at which nodogsplash checks client timeout status
  option checkinterval '600'

  # Enable BinAuth Support.
  # If set, a program is called with several parameters on authentication (request) and deauthentication.
  # Request for authentication:
  # $<BinAuth> auth_client <client_mac> '<username>' '<password>'
  #
  # The username and password values may be empty strings and are URL encoded.
  # The program is expected to output the number of seconds the client
  # is to be authenticated. Zero or negative seconds will cause the authentification request
  # to be rejected. The same goes for an exit code that is not 0.
  # The output may contain a user specific download and upload limit in KBit/s:
  # <seconds> <upload> <download>
  #
  # Called on authentication or deauthentication:
  # $<BinAuth> <*auth|*deauth> <incoming_bytes> <outgoing_bytes> <session_start> <session_end>
  #
  # "client_auth": Client authenticated via this script.
  # "client_deauth": Client deauthenticated by the client via splash page.
  # "idle_deauth": Client was deauthenticated because of inactivity.
  # "timeout_deauth": Client was deauthenticated because the session timed out.
  # "ndsctl_auth": Client was authenticated manually by the ndsctl tool.
  # "ndsctl_deauth": Client was deauthenticated by the ndsctl tool.
  # "shutdown_deauth": Client was deauthenticated by Nodogsplash terminating.
  #
  # Values session_start and session_start are in seconds since 1970 or 0 for unknown/unlimited.
  #
  #option binauth '/bin/myauth.sh'

  # Enable Forwarding Authentication Service (FAS)
  # If set redirection is changed from splash.html to a FAS (provided by the system administrator)
  # The value is the IP port number of the FAS
  #option fasport '80'

  # Option: fasremoteip
  # Default: GatewayAddress (the IP of NDS)
  # If set, this is the remote ip address of the FAS.
  #option fasremoteip '46.32.240.41'

  # Option: faspath
  # Default: /
  # This is the path from the FAS Web Root to the FAS login page
  # (not the file system root).
  #option faspath '/onboard-wifi.net/nodog/fas.php'

  # Option: fas_secure_enabled
  # Default: 1
  # If set to "1", authaction and the client token are not revealed and it is the responsibility
  # of the FAS to request the token from NDSCTL.
  # If set to "0", the client token is sent to the FAS in clear text in the query string of the
  # redirect along with authaction and redir.
  #option fas_secure_enabled '0'

  # Your router may have several interfaces, and you
  # probably want to keep them private from the network/gatewayinterface.
  # If so, you should block the entire subnets on those interfaces, e.g.:
  #list authenticated_users 'block to 192.168.0.0/16'
  #list authenticated_users 'block to 10.0.0.0/8'

  # Typical ports you will probably want to open up.
  #list authenticated_users 'allow tcp port 22'
  #list authenticated_users 'allow tcp port 53'
  #list authenticated_users 'allow udp port 53'
  #list authenticated_users 'allow tcp port 80'
  #list authenticated_users 'allow tcp port 443'
  # Or for happy customers allow all
  list authenticated_users 'allow all'

  # For preauthenticated users to resolve IP addresses in their
  # initial request not using the router itself as a DNS server,
  # Leave commented to help prevent DNS tunnelling
  #list preauthenticated_users 'allow tcp port 53'
  #list preauthenticated_users 'allow udp port 53'

  # Allow ports for SSH/Telnet/DNS/DHCP/HTTP/HTTPS
  list users_to_router 'allow tcp port 22'
  list users_to_router 'allow tcp port 23'
  list users_to_router 'allow tcp port 53'
  list users_to_router 'allow udp port 53'
  list users_to_router 'allow udp port 67'
  list users_to_router 'allow tcp port 80'

  # MAC addresses that are / are not allowed to access the splash page
  # Value is either 'allow' or 'block'. The allowedmac or blockedmac list is used.
  #option macmechanism 'allow'
  #list allowedmac '00:00:C0:01:D0:0D'
  #list allowedmac '00:00:C0:01:D0:1D'
  #list blockedmac '00:00:C0:01:D0:2D'

  # MAC addresses that do not need to authenticate
  #list trustedmac '00:00:C0:01:D0:1D'

  # Nodogsplash uses specific HEXADECIMAL values to mark packets used by iptables as a bitwise mask.
  # This mask can conflict with the requirements of other packages such as mwan3, sqm etc
  # Any values set here are interpreted as in hex format.
  #
  # List: fw_mark_authenticated
  # Default: 30000 (0011|0000|0000|0000|0000 binary)
  #
  # List: fw_mark_trusted
  # Default: 20000 (0010|0000|0000|0000|0000 binary)
  #
  # List: fw_mark_blocked
  # Default: 10000 (0001|0000|0000|0000|0000 binary)
  #
  #list fw_mark_authenticated '30000'
  #list fw_mark_trusted '20000'
  #list fw_mark_blocked '10000'

   option redirecturl 'https://www.tdtlatinoamerica.com.ar/'

You have setup a luci ( ssl ) site on 2050 nodog listens on that port.
Have you disabled nodogs http service?

Can you get nodog running with a basic default setup? Do that. Get a basic php page running out of LUCI.... ( nothing to do with nodog )

And then revisit this without https. Use the nodog FAS parameters to redirect to that page. easy. Then the harder side is underneath with the ndsctl scripting.

The nodog docs speficially warn against https, due to modern client captive detection anyway.

So you did install PHP, and it is enabled - thanks for providing this information.

  • I would look at the conflicting port too.
  • I also advise not using HTTPS on the captive portal splash page, your users may be panicked by the certificate warning each time they try to connect to your AP.

First of all. Thanks for your answer.
Well about this (My answer in strong)

You have setup a luci ( ssl ) site on 2050 nodog listens on that port.
Where is it?
Have you disabled nodogs http service?
How I should know it

I just want to create a capatcha via PHP to allow users access to internet. Complete the captcha and then the users can access to internet. in the mail page

imagen

Can you get nodog running with a basic default setup? Do that. Get a basic php page running out of LUCI.... ( nothing to do with nodog )

What a pity :frowning: So there is no way to do a PHP code captcha before to have access to internet?

Look mate I have modified the php.ini and we can confirm that php works
First a modified the php.ini

doc_root = "/www"

And It show me the results look the screenshot (192.168.1.2/ohter/hola.php)

imagen

And then revisit this without https. Use the nodog FAS parameters to redirect to that page. easy. Then the harder side is underneath with the ndsctl scripting.

I'm going to research about FAS

The nodog docs speficially warn against https, due to modern client captive detection anyway.

I know that you many times mentioned my mistake about https but I dont't understand what you mean. I don't figure out where is the problem in my file configuration. Could you show me my mistake?

Thanks

Thanks for your answer
Well about

Could you should me where is my mistake when you say "I would look at the conflicting port too"?
Could you should me where is my mistake when you say " I also advise not using HTTPS on the captive portal splash page, your users may be panicked by the certificate warning each time they try to connect to your AP."?

Please use one post to respond to multiple people, it saves posts; and we can all see them.

Ha configurado LuCI y NoDogSplash en el mismo puerto.

You have configured LuCI and NoDogSplash on the same port.

Si utiliza HTTPS, sus clientes recibirán advertencias de certificados.

If you use HTTPS, your customer will receive certificate warnings.

I am giving you some help

nodogsplash.@nodogsplash[0].fasport='8888'

config uhttpd winner                           
        list listen_http '0.0.0.0:8888'
        option home /winner
        option index_page 'index.html index.php'
	list interpreter	".php=/usr/bin/php-cgi"


<?php
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
?>
<html>
<head>
<title>winner</title>
</head>
<body>
<b> php-baby </b><br />
<?php
$clientip = $_GET['clientip'];
$redir = $_GET['redir'];
?>
<FORM METHOD="POST" ACTION="http://192.168.1.1:8888/">
        Username: <INPUT size=20 name=username VALUE="" type="text">
        Password: <INPUT size=20 name=password VALUE="" type="password"><br />
	<INPUT type=hidden type=text name=clientip VALUE="<?php echo $clientip ?>"><br />
	<INPUT type=hidden type=text name=redir VALUE="<?php echo $redir ?>"><br />
        <INPUT TYPE="submit" VALUE="Submit">
    <INPUT TYPE="reset" VALUE="Reset">
</FORM>
</body>      
</html>
<?php
}

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$clientip = $_POST['clientip'];
$redir = $_POST['redir'];
`ndsctl auth $clientip`;
echo '<html><head><title></title></head><body>';
echo $clientip;
echo "winner!";
echo "</body></html>";
}

?>

Anything that is not in that is solvable by general internet searches, study, try, study and try again... forums can only get you so far.....

3 Likes

Thanks wulfly23 for your amability you are so kind
Well I'm working right now with this link
https://nodogsplashdocs.readthedocs.io/en/stable/fas.html#running-fas-on-your-nodogsplash-router
and I'm getting this results so far, look
imagen

I will keep in mind the last code provided by you

When I finish I'm going create a post to share the knowlgede which will be useful for others guys
Thanks

2 Likes

@rogerio24

Hi dude. Did you solve your hostpot ? I'm trying to make a captive portal too.. i want to experiment with captcha solve or with an a banner.js remote code.

It seems very poor to got a captive portal if we cant set it up as we wish.. my 2 cents.

Any help is welcome. tnx dude

No mate I could n´t do it. Do you have any info o clue how to perform this?
Thanks

In case, commercial support required: I did lot of openwrt-hotspots using coova-chilli.
Also incl. nginx/php. PM welcome.

@reinerotto Hi reinerotto. Im trying to call an external banner and i wish to cover the splash page.

Rogerio.
Im experimenting with iframe tag so at least i can call an external web inside of the main splash page. If i got more info i will post it here.

Just for the record, here i found an out of the box (brand new) NDG tutorial, wich goes on more deep analisys on how it works. Im reading it.

09/10/19:

Thanx for the link to the PDF. One important difference to coova-chilli: NDS unfortunately does not use radius services. NDS uses SQM for rate limiting, whereas coova uses TUN device, which is slower, but much easier to set up.

Resume: NDS is something like coova-chilli-light.

External banner: Piece of cake, in case always from same server. Cover splash page: Just needs good page coding, independent upon captive portal.

1 Like