FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
686 views 0 comments
by anonymous

This is the config I have set in uhttpd file, do I need something else to enable it?

config uhttpd 'main'

option enablehttp '1'

option home '/www'

option rfc1918_filter '1'

option max_requests '3'

option max_connections '100'

option cert '/etc/uhttpd.crt'

option key '/etc/uhttpd.key'

option cgi_prefix '/cgi-bin'

option script_timeout '600'

option network_timeout '30'

option http_keepalive '20'

option tcp_keepalive '1'

option ubus_prefix '/ubus'

option _httpsWanAccess '1'

option _httpWanAccess '1'

option listen_http '0.0.0.0:80'

option listen_https '0.0.0.0:8443'

1 Answer

0 votes
by anonymous

Hi,

This config file (/etc/config/uhttpd) is in part used to configure the web interface, yes. However, the device's firewall actually controls who gets to access what. If you set WAN access via WebUI, it automatically changes configurations in both /etc/config/uhttpd and /etc/config/firewall accordingly. But if you set it via command line, you'll need to edit the firewall config manually as well.

As mentioned previously, the other settings you need are in the /etc/config/firewall file. Open it and look for these two rules:

config rule
        option dest_port '80'
        option proto 'tcp udp'
        option name 'Enable_HTTP_WAN'
        option target 'ACCEPT'
        option src 'wan'
        option enabled '0'

config rule
        option dest_port '443'
        option proto 'tcp udp'
        option name 'Enable_HTTPS_WAN'
        option target 'ACCEPT'
        option src 'wan'
        option enabled '0'

These rules control HTTP and HTTPS WAN access to your device. To enable them, simply delete the options I highlighted in the example above (option enabled '0'). Save the file and restart the firewall service (/etc/init.d/firewall restart) or the entire device to make the changes take effect.


The last thing I would add is that if you're modifying config files with a text editor (like vi), you need to restart the related service after making changes to the config file for these changes to take effect. For example, if you edit /etc/config/uhttpd, you can restart the service with this command:

  • /etc/init.d/uhttpd restart

Hope this helps you with what you need. Perhaps this reference will also come in handy; it's about how to use the UCI system to modify configuration files.

Good luck,
DM