Choose style:

Author Topic: Change default WebUI-port?  (Read 13840 times)

0 Members and 1 Guest are viewing this topic.

Offline Fire69

  • Backer
  • *
  • Posts: 344
  • Thanks: 0
  • Registered : 03/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Change default WebUI-port?
« on: October 17, 2014, 05:23:59 pm »
Hi,

I briefly asked about this already in my other topic, but I'm desperately seeking for a way to change the default port for the WebUI.
My webserver was running on port 80 up until I got the A+, but that's obviously not working anymore now.

Lars suggested changing the external port for my server and forwarding it to port 80, but that's just not possible without changing my entire setup.
I have lots of sites all running at http://domain/<site>, lots of them referring to each other.

So I've been looking at the config files for lighttpd, but there's not a lot to configure.
I tried changing the port to 81 as a test, it only works for a small part.  I don't get the WebUI any more, it displays the login for OpenWRT, but the top menu is missing.

Then I tried stopping lighttpd and starting uhttpd.  This does show me the WebUI, so I was happy it worked, but then I couldn't get to OpenWRT anymore on port 90.

Can somebody maybe give me a hand in getting port 90 working again? :)

Offline matt

  • Backer
  • *
  • Posts: 151
  • Thanks: 1
  • Registered : 26/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #1 on: October 18, 2014, 03:09:22 am »
You got me curious... It seems like the logic to decide which page is shown is done by a luci header for the cortina theme:

/usr/lib/lua/luci/view/themes/cortina/header.htm

Specifically:
Code: [Select]
<%- if portnum == "80" then -%>
However, it seems like other logic in that header file (and probably elsewhere too) is not set up to handle registering the interface properly if the port is changed from 80 (which causes changes in other variables). In short, without doing a lot of hacking, it does not look like you can easily remedy this issue.

However, if you don't need remote access, you should be able to have lighttpd only bind on internal interfaces, and then use a normal port forward on the router to whatever server is hosting your website. Alternately (and highly _not_ recommended) you could do a reverse proxy through your router for your other sites.

e.g. Just before server.port = 80, put:
server.bind = "10.0.0.1"

Or whatever your internal router IP is.

And restart lighttpd.

Offline Fire69

  • Backer
  • *
  • Posts: 344
  • Thanks: 0
  • Registered : 03/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #2 on: October 18, 2014, 06:57:28 pm »
Well, I'd like it if the remote access would still be available, but since OpenWRT at port 90 isn't working remotely anyway, it wouldn't be such a disaster.

Would it make a difference if I switched to uhttpd instead of lighttpd? I guess not since it would still be handled by LuCi?

I'll try binding to internal ip and forwarding port.  If that works, I'm Ok for now :)

Offline Fire69

  • Backer
  • *
  • Posts: 344
  • Thanks: 0
  • Registered : 03/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #3 on: October 20, 2014, 04:46:49 am »
Little update:

I binded lighttpd to the internal interface and forwarded port 80 to my server.
The websites running from it are now accessible... except for 1, the main sitepage.

I can for example connect to http://<domain>/couchpotato
But I can't connect to http://<domain> because it automatically gets changed to http://<domain>/cgi-bin/luci

Apparently, it is still partially listening to port 80 or the binding is not done correctly?

Offline Fire69

  • Backer
  • *
  • Posts: 344
  • Thanks: 0
  • Registered : 03/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #4 on: October 22, 2014, 07:39:43 am »
Second update:

This morning I remembered I enabled WAN access in the LCDUI, so I tought maybe if I disabled that the http://<domain> wouldn't be changed to http://<domain>/cgi-bin/luci anymore.
But no luck, it didn't change anything.
It should not be listening to port 80 anymore when you disable it in LCDUI, right?

Offline matt

  • Backer
  • *
  • Posts: 151
  • Thanks: 1
  • Registered : 26/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #5 on: November 04, 2014, 12:19:52 am »
Second update:

This morning I remembered I enabled WAN access in the LCDUI, so I tought maybe if I disabled that the http://<domain> wouldn't be changed to http://<domain>/cgi-bin/luci anymore.
But no luck, it didn't change anything.
It should not be listening to port 80 anymore when you disable it in LCDUI, right?

Sorry, been busy with work. Maybe you got this fixed, or maybe it fixed on its own, but I was wondering if you tried with a different browser or after clearing the cache? Those redirects get cached by your browser. Unless there is some weird proxy in there somewhere, it is highly unlikely that it would catch the root but not others.

Offline Fire69

  • Backer
  • *
  • Posts: 344
  • Thanks: 0
  • Registered : 03/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #6 on: November 05, 2014, 11:21:54 am »
No need to apologize, hadn't really been looking into it anymore since the most important part (couchpotato and others) is working  :)
It works when I connect through the lan, wan is still adding the luci-part.
Haven't cleared the cache in my browser yet, but I have the problem on phone, tablet and laptop, so I doubt that is the problem.
I'll try when I get home.

[edit]
Yep, cleared my cache, everything's working now  ;D
« Last Edit: November 05, 2014, 03:37:59 pm by Fire69 »

Offline Fire69

  • Backer
  • *
  • Posts: 344
  • Thanks: 0
  • Registered : 03/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #7 on: November 06, 2014, 02:34:08 pm »
Now that port 80 is working OK, I tried to get port 90 working from WAN so I could get some degree of remote management available again.  :)
I forwarded port 90 to 192.168.1.1 (which shouldn't even be necessary, right?) but nothing happens...

Any tips?  :D

Offline matt

  • Backer
  • *
  • Posts: 151
  • Thanks: 1
  • Registered : 26/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #8 on: November 13, 2014, 12:10:59 am »
Now that port 80 is working OK, I tried to get port 90 working from WAN so I could get some degree of remote management available again.  :)
I forwarded port 90 to 192.168.1.1 (which shouldn't even be necessary, right?) but nothing happens...

Any tips?  :D

With all the weird hostname/port patterns going on behind the scenes, I don't know that it would be easy to get it set up on a different port. The only easy workaround I can think of would be to try a reverse proxy from whatever port you want to port 80 and specify to run lighttpd on localhost as well as the internal network. E.g:

http://stackoverflow.com/questions/4859956/lighttpd-as-reverse-proxy

Where the proxy server host is 127.0.0.1 and your search pattern is based on the port or hostname.

In general I would recommend against allowing remote access to router configuration pages, but as I never like telling people they shouldn't want a feature, hopefully this helps.

Offline Fire69

  • Backer
  • *
  • Posts: 344
  • Thanks: 0
  • Registered : 03/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #9 on: November 14, 2014, 04:18:48 pm »
I solved it in another way. I set up the VPN server. :)
With the added advantage that I can access my entire home-network that way.  ;D

Offline adx

  • Backer
  • *
  • Posts: 22
  • Thanks: 0
  • Registered : 15/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #10 on: December 03, 2014, 12:49:02 pm »
;D I was able to gain access to the OpenWRT interface from WAN without VPN or port forwarding.
What I did was to add port 90 under "Firewall -> Traffic Rules".

By default you will only see port 80 there under the name "Remote WEB". So just add another
entry with port 90. It should work then!

 :P
« Last Edit: December 03, 2014, 12:59:06 pm by adx »

Offline adx

  • Backer
  • *
  • Posts: 22
  • Thanks: 0
  • Registered : 15/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #11 on: December 03, 2014, 12:57:12 pm »
so here's the screenshot of my settings (see attachment)...

Offline Richel

  • Beta Testers
  • *
  • Posts: 62
  • Thanks: 0
  • Registered : 22/03/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #12 on: August 18, 2015, 02:06:47 pm »
I followed your instructions and set port 90 for access outside my LAN. I have VPN enabled. However, when I try to access, I get the following:

"Rejected request from RFC1918 IP to public server address"

What else do I need to check?

Thanks,

Elliott

Offline Richel

  • Beta Testers
  • *
  • Posts: 62
  • Thanks: 0
  • Registered : 22/03/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Change default WebUI-port?
« Reply #13 on: August 18, 2015, 02:38:33 pm »
Okay, so I did some more troubleshooting (added DMZ) and am able to access the Almond+ via the internet and a web browser. However, the web page that comes up appears to be the Linux type interface and not the usual graphical interface that I access locally. I want to be able to turn on or off the zigbee Peanut device remotely. However, the Linux interface appears to have no link to sensors.

Suggestions to fix this would be appreciated.

Elliott

 

Page created in 0.046 seconds with 16 queries.