Modify

Opened 8 years ago

Closed 8 years ago

Last modified 3 years ago

#6960 closed defect (fixed)

uhttpd doesn't work on ixp4xx

Reported by: ledwards@… Owned by: jow
Priority: high Milestone: Backfire 10.03
Component: base system Version: Trunk
Keywords: uhttpd Cc:

Description

After updating from r20410, luci would not come up. It looks like the new uhttpd isn't staring on my system (ixp4xx). Manually starting/stopping/resetting it via /etc/init.d/uhttpd gives no messages. Executing uhttpd (with appropriate parameters) only results in the usage message:
Usage: uhttpd -p [addr:]port [-h docroot] ...

Whatever I try I can't get the web server to start. I don't know what else to check.

Attachments (5)

opkg_list-installed (3.9 KB) - added by ledwards@… 8 years ago.
opkg list-installed
config_uhttpd (1.8 KB) - added by ledwards@… 8 years ago.
/etc/config/uhttpd
r20526_dmesg (11.3 KB) - added by ledwards@… 8 years ago.
r20526 dmesg
luci_output (2 bytes) - added by ledwards@… 8 years ago.
/www/cgi-bin/luci output
luci_output.2 (4.5 KB) - added by ledwards@… 8 years ago.
/www/cgi-bin/luci output (again, with content this time)

Download all attachments as: .zip

Change History (23)

comment:1 Changed 8 years ago by thepeople

  • Owner changed from developers to jow
  • Status changed from new to assigned

comment:2 Changed 8 years ago by jow

1) attach /etc/config/uhttpd
2) attach the output of opkg list-installed
3) run this command, try to open the web interface and look for errors on the cli: uhttpd -p 80 -h /www

comment:3 Changed 8 years ago by anonymous

Works find after r20513

comment:4 Changed 8 years ago by jow

  • Resolution set to fixed
  • Status changed from assigned to closed

Thanks for the feedback - glad it works.

comment:5 Changed 8 years ago by nico

  • Milestone changed from Backfire 10.03-rc2 to Backfire 10.03

comment:6 Changed 8 years ago by ledwards@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

I should have mentioned I'm running r20526, so r20513 didn't resolve this problem for me. I've attached the requested files. Here's the output when I try to manually start uhttpd:

root@OpenWrt:/etc/config# uhttpd -p 80 -h /www
socket(): Address family not supported by protocol
Usage: uhttpd -p [addr:]port [-h docroot]

-f Do not fork to background
-c file Configuration file, default is '/etc/httpd.conf'
-p [addr:]port Bind to specified address and port, multiple allowed
-s [addr:]port Like -p but provide HTTPS on this port
-C file ASN.1 server certificate file
-K file ASN.1 server private key file
-h directory Specify the document root, default is '.'
-l string URL prefix for Lua handler, default is '/lua'
-L file Lua handler script, omit to disable Lua
-x string URL prefix for CGI handler, default is '/cgi-bin'
-t seconds CGI and Lua script timeout in seconds, default is 60
-d string URL decode given string
-r string Specify basic auth realm
-m string MD5 crypt given string

Changed 8 years ago by ledwards@…

opkg list-installed

Changed 8 years ago by ledwards@…

/etc/config/uhttpd

Changed 8 years ago by ledwards@…

r20526 dmesg

comment:7 Changed 8 years ago by ledwards@…

Here's a more readable output:

root@OpenWrt:/etc/config# uhttpd -p 80 -h /www
socket(): Address family not supported by protocol
Usage: uhttpd -p [addr:]port [-h docroot]
        -f              Do not fork to background
        -c file         Configuration file, default is '/etc/httpd.conf'
        -p [addr:]port  Bind to specified address and port, multiple allowed
        -s [addr:]port  Like -p but provide HTTPS on this port
        -C file         ASN.1 server certificate file
        -K file         ASN.1 server private key file
        -h directory    Specify the document root, default is '.'
        -l string       URL prefix for Lua handler, default is '/lua'
        -L file         Lua handler script, omit to disable Lua
        -x string       URL prefix for CGI handler, default is '/cgi-bin'
        -t seconds      CGI and Lua script timeout in seconds, default is 60
        -d string       URL decode given string
        -r string       Specify basic auth realm
        -m string       MD5 crypt given string

comment:8 Changed 8 years ago by jow

Please test r20532

comment:9 Changed 8 years ago by ledwards@…

I tested with r20532. The good news is uhttpd started and appeared to be running fine. The bad news is luci wouldn't come up... browsing to http://192.168.1.1 would flash the screen black and then redirect to http://192.168.1.1/cgi-bin/luci which is blank white. Refreshing does nothing. Perhaps this is a different issue as uhttpd appears to be serving pages. I put a test.html page in /www and it came up fine in Firefox at http://192.168.1.1/test.html.

I'm still getting some errors when I manually start uhttpd (but it is starting). See the following:

root@OpenWrt:/etc/config# ps -A | grep uhttpd
 2258 root      1324 S    /usr/sbin/uhttpd -f -h /www -r OpenWrt -x /cgi-bin -t
 2260 root      1088 S    grep uhttpd
root@OpenWrt:/etc/config# /etc/init.d/uhttpd stop
root@OpenWrt:/etc/config# ps -A | grep uhttpd
 2266 root      1088 S    grep uhttpd
root@OpenWrt:/etc/config# uhttpd -p 80 -h /www
Notice: Unable to load TLS plugin - disabling SSL support! (Reason: File not found)
socket(): Address family not supported by protocol
root@OpenWrt:/etc/config# ps -A | grep uhttpd
 2270 root      1324 S    uhttpd -p 80 -h /www
 2272 root      1088 S    grep uhttpd

Thanks.

comment:10 follow-up: Changed 8 years ago by jow

Execute /www/cgi-bin/luci on the command line and see if there are errors.

comment:11 Changed 8 years ago by jow

The socket() error is normal btw, if you only specify 80 with -p it tries to bind to both IPv4 (0.0.0.0) and IPv6 (::). You can specifiy -p 0.0.0.0:80 instead which is done by the initscript.

comment:12 in reply to: ↑ 10 Changed 8 years ago by ledwards@…

Replying to jow:

Execute /www/cgi-bin/luci on the command line and see if there are errors.

root@OpenWrt:/# /www/cgi-bin/luci
Segmentation fault

comment:13 Changed 8 years ago by thepeople

  • Status changed from reopened to assigned

comment:14 follow-up: Changed 8 years ago by jow

I believe this is due to CyASSL changes in OpenWrt trunk, you need to recompile LuCI in order to stay binary compatible. Run "./scripts/feeds update", followed by "make menuconfig", select LuCI -> Libraries -> TLS Provider, choose Disabled and rebuild with "make package/luci/clean world V=99"

comment:15 in reply to: ↑ 14 Changed 8 years ago by ledwards@…

I recompiled LuCI as described above. After flashing the image, LuCI appeared to work fine... however, a few pages would always return blank (like Essentials -> System -> General). Sometimes they would simply say "0".

I thought it was fixed... I then configured the system for my liking (i.e. lan static IP address, wan dhcp, leds, wifi, timezone, etc - didn't touch uhttpd or luci config). After rebooting the system, I couldn't access LuCI anymore... I only got blank pages.

I ran /www/cgi-bin/luci as before, and this time it returned the correct LuCI html, but it's not being served by uhttpd at http://192.168.2.1/cgi-bin/luci (in Firefox or Konqueror).

I've attached my LuCI output from executing /www/cgi-bin/luci. I played around with starting and stopping uhttpd, rebooting, changing IP addresses, etc... but I can't get LuCI to work anymore.

Thanks

Changed 8 years ago by ledwards@…

/www/cgi-bin/luci output

Changed 8 years ago by ledwards@…

/www/cgi-bin/luci output (again, with content this time)

comment:16 Changed 8 years ago by jow

I don't think this issue is httpd related anymore.
Can you run /www/cgi-bin/luci under strace until you hit the bug where it does not return any content and attach the log here?

comment:17 Changed 8 years ago by jow

  • Resolution set to fixed
  • Status changed from assigned to closed

Ok - I found a way to reproduce it reliable on x86, will look into the issue during the day.

comment:18 Changed 8 years ago by jow

I opened a new ticket to track this issue, see #6991

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.