Lighttpd.conf gets corrupted at random

DOWNLOAD THE LATEST FIRMWARE HERE
flameproof
Member
 
Posts: 22
Joined: Thu Sep 24, 2015 6:04 am
Has thanked: 0 time
Been thanked: 1 time

Lighttpd.conf gets corrupted at random

Thu Apr 21, 2016 6:32 am

Hi all,

I have various WS-12-250A in operation. Every so often (1-3 weeks), the configuration of the built-in web server gets corrupted, resulting in either an empty /etc/lighttpd.conf or one with badly formatted content - wrong settings, many tabs, etc.

Has anyone seen this happen?

Example corrupt config (tabs not shown but each line increments by one tab) - there is a missing section after the server.pid-file line:

Code: Select all

admin@SW0002:/www# cat /etc/lighttpd.conf
server.port = 80
server.max-worker = 2
$SERVER["socket"] == ":35443" {
 ssl.engine = "enable"
 ssl.pemfile = "/etc/config/lighttpd.pem"
 }
# bounce all HTTP requests to HTTPS
 $HTTP["scheme"] == "nomatch" {
 $HTTP["host"] =~ "(.*)" {
 url.redirect = ("^/(.*)" => "https://%1:35443/$1")
 }
 }
server.modules = (
 "mod_rewrite",
 "mod_redirect",
 # "mod_alias",
 # "mod_auth",
 # "mod_status",
 # "mod_setenv",
 "mod_fastcgi",
 "mod_proxy",
 # "mod_simple_vhost",
 "mod_cgi",
 # "mod_ssi",
 # "mod_usertrack",
 # "mod_expire"
 )
server.network-backend = "write"
server.document-root = "/www/"
index-file.names = ( "index.html", "default.html", "index.htm", "default.htm", "index.php" )
mimetype.assign = (
 ".pdf" => "application/pdf",
 ".class" => "application/octet-stream",
 ".pac" => "application/x-ns-proxy-autoconfig",
 ".swf" => "application/x-shockwave-flash",
 ".wav" => "audio/x-wav",
 ".gif" => "image/gif",
 ".jpg" => "image/jpeg",
 ".jpeg" => "image/jpeg",
 ".png" => "image/png",
 ".ico" => "image/x-icon",
 ".css" => "text/css",
 ".html" => "text/html",
 ".htm" => "text/html",
 ".js" => "text/javascript",
 ".woff" => "application/font-woff",
 ".txt" => "text/plain",
 ".dtd" => "text/xml",
 ".xml" => "text/xml"
 )
$HTTP["url"] =~ "\.pdf$" {
 server.range-requests = "disable"
 }
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".lua", ".cgi", ".json" )
server.pid-file = "/var/run/lighttpd.pid"
admin@SW0002:/www#

flameproof
Member
 
Posts: 22
Joined: Thu Sep 24, 2015 6:04 am
Has thanked: 0 time
Been thanked: 1 time

Re: Lighttpd.conf gets corrupted at random

Thu Apr 21, 2016 6:36 am

Further to my last, restoring the lighttpd.conf from another switch brings up the web server again. I'm running v1.3.9 on all switches.

User avatar
sirhc
Employee
Employee
 
Posts: 7416
Joined: Tue Apr 08, 2014 3:48 pm
Location: Lancaster, PA
Has thanked: 1608 times
Been thanked: 1325 times

Re: Lighttpd.conf gets corrupted at random

Thu Apr 21, 2016 8:29 am

Maybe a little more info?

What browser are you using?

When this happens are you just opening the browser and going to the switch or was the switch UI left open for some period of time?

How do you correct it when it happens?

Foes it do this from another computer/browser?
Support is handled on the Forums not in Emails and PMs.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.

flameproof
Member
 
Posts: 22
Joined: Thu Sep 24, 2015 6:04 am
Has thanked: 0 time
Been thanked: 1 time

Re: Lighttpd.conf gets corrupted at random

Thu Apr 21, 2016 8:33 am

More info:

- I'm using Firefox but not sure how a browser could cause corruption of a web server's configuration file(s).
- When this happens I go to connect to the browser, and find I no longer have access. I then SSH and find the config corrupt. The switch UI is not open for more than a few minutes at a time (maximum 10).
- To correct it, I copy the .conf from a good switch, delete the .conf on the bad switch, vi a new .conf and paste the contents, :wq and start lighttpd manually. Browser can then connect correctly.
- It does it regardless of computer/browser. I see lighttpd no longer running on the switch via ps -ef.

User avatar
Eric Stern
Employee
Employee
 
Posts: 532
Joined: Wed Apr 09, 2014 9:41 pm
Location: Toronto, Ontario
Has thanked: 0 time
Been thanked: 130 times

Re: Lighttpd.conf gets corrupted at random

Thu Apr 21, 2016 9:41 am

Does it only happen on 1 switch?

Its possible the flash file system has gotten corrupted. You can try this.

- backup the config
- at the command line run "mtd erase rootfs_data" (this will take about a minute)
- at the command line run "reboot"
- when it comes back up it will be at the default IP address of 192.168.1.20
- restore the config

flameproof
Member
 
Posts: 22
Joined: Thu Sep 24, 2015 6:04 am
Has thanked: 0 time
Been thanked: 1 time

Re: Lighttpd.conf gets corrupted at random

Thu Apr 21, 2016 9:43 am

It has happened to two of the switches, three times on one, and once on the other. I am very remote to these switches, so doing things that may leave me without access are a no-go unless really required.

User avatar
sirhc
Employee
Employee
 
Posts: 7416
Joined: Tue Apr 08, 2014 3:48 pm
Location: Lancaster, PA
Has thanked: 1608 times
Been thanked: 1325 times

Re: Lighttpd.conf gets corrupted at random

Thu Apr 21, 2016 9:47 am

I would then schedule a visit and do it on site as soon as possible.

I would also take a spare just in case.

Another option would be to rotate these units back to a more easily accessible location.
Support is handled on the Forums not in Emails and PMs.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.

flameproof
Member
 
Posts: 22
Joined: Thu Sep 24, 2015 6:04 am
Has thanked: 0 time
Been thanked: 1 time

Re: Lighttpd.conf gets corrupted at random

Sat Apr 23, 2016 3:45 pm

I'll take a look next time I'm there. We cannot rotate these to more accessible locations as we have no accessible locations where we are installing these switches.

User avatar
sirhc
Employee
Employee
 
Posts: 7416
Joined: Tue Apr 08, 2014 3:48 pm
Location: Lancaster, PA
Has thanked: 1608 times
Been thanked: 1325 times

Re: Lighttpd.conf gets corrupted at random

Sat Apr 23, 2016 4:11 pm

flameproof wrote:I'll take a look next time I'm there. We cannot rotate these to more accessible locations as we have no accessible locations where we are installing these switches.


Then I would replace with a spare and further test in shop. If you do not have a spare you live on the edge!
Support is handled on the Forums not in Emails and PMs.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.

flameproof
Member
 
Posts: 22
Joined: Thu Sep 24, 2015 6:04 am
Has thanked: 0 time
Been thanked: 1 time

Re: Lighttpd.conf gets corrupted at random

Sun Apr 24, 2016 4:35 am

I did not say we have no spares - we do - just that the locations are remote ;-)

Return to Hardware and software issues

Who is online

Users browsing this forum: No registered users and 61 guests