*New 12.1 series Release:
2019-11-08: XigmaNAS 12.1.0.4.7091 - released!

*New 11.3 series Release:
2019-10-19: XigmaNAS 11.3.0.4.7014 - released


We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

[SOLVED] lighttpd not serving pages

Webserver service.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
havoc
NewUser
NewUser
Posts: 5
Joined: 19 Sep 2015 02:13
Status: Offline

[SOLVED] lighttpd not serving pages

#1

Post by havoc » 15 Nov 2015 00:23

I've managed to get my ISP to put my server on a 1 to 1 NAT connection so that I can access my server through the internet, I'm trying to host the web server service on port 80 however, lihttpd doesn't seem to want to serve the page up to the users. I'm certain it's a problem with the lighttpd configuration because I can access the web service when I change the port to anything other port 80 (8087 for example).

I'm using the default configuration for the web server except for some auxiliary arguments.

My arguments:

Code: Select all

#####################################
#        Start of my variables      #
#####################################

#More index files :)
index-file.names += (
    "index.py", "default.py"
)

#Rewrite Rules :D
url.rewrite-once = (
    "/foo/?" => "index.html"
)

#Forbid access to /forbidden folder
$HTTP["url"] =~ "^/forbidden/?" {
    url.access-deny = ("")
}
#And any lib folders there is
else $HTTP["url"] =~ "^/lib/?" {
    url.access-deny = ("")
}

#Yey for allowing python pages :D
$HTTP["url"] =~ "^/cgi-bin/?" {
    cgi.assign = (
        ".py" => "/usr/local/bin/python2.7"
    )
}
Turns out my ISP filters all ports below 1024 :(
Last edited by havoc on 07 Dec 2015 19:00, edited 3 times in total.

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 389
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: lighttpd not serving pages

#2

Post by Parkcomm » 15 Nov 2015 07:13

have you changed the port of the gui System|General Setup - the default is 80
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

havoc
NewUser
NewUser
Posts: 5
Joined: 19 Sep 2015 02:13
Status: Offline

Re: lighttpd not serving pages

#3

Post by havoc » 15 Nov 2015 17:55

Parkcomm wrote:have you changed the port of the gui System|General Setup - the default is 80
Yes. That was the first thing I changed (it's being hosted on port 8080)

havoc
NewUser
NewUser
Posts: 5
Joined: 19 Sep 2015 02:13
Status: Offline

Re: lighttpd not serving pages

#4

Post by havoc » 03 Dec 2015 19:41

Bump I guess... Still can't figure this out :(

havoc
NewUser
NewUser
Posts: 5
Joined: 19 Sep 2015 02:13
Status: Offline

Re: lighttpd not serving pages

#5

Post by havoc » 05 Dec 2015 08:04

Update:

It's definitely a problem with the lighttpd service. I'm able to run Node.js applications from port 80 and I can connect with no problems at all...

Just in case it's a config problem, below is the websrv.conf (/var/etc/websrv.conf) file.

Code: Select all

server.port = 8087
server.username = "www"
server.document-root = "/mnt/MainPool/Development/WebServer"
server.modules = (
  "mod_access",
  "mod_auth",
  "mod_expire",
  "mod_cgi",
  "mod_rewrite",
  "mod_redirect",
  "mod_alias"
 )
server.errorlog-use-syslog = "enable"
# debugmode ° debug.log-request-handling enable/disable
debug.log-request-handling = "disable"
#server.event-handler = "freebsd-kqueue"
server.event-handler = "libev"
server.max-write-idle = 360
index-file.names   = ( "index.php", "index.html", "index.htm", "index.shtml", "default.htm" )
#$HTTP["url"] =~ "\.(js|css|png|gif|jpg)$" {
#    expire.url = ( "" => "access plus 1 hours" )
#}
# mimetype mapping
mimetype.assign             = (
  ".pdf"          =>      "application/pdf",
  ".sig"          =>      "application/pgp-signature",
  ".spl"          =>      "application/futuresplash",
  ".class"        =>      "application/octet-stream",
  ".ps"           =>      "application/postscript",
  ".torrent"      =>      "application/x-bittorrent",
  ".dvi"          =>      "application/x-dvi",
  ".gz"           =>      "application/x-gzip",
  ".pac"          =>      "application/x-ns-proxy-autoconfig",
  ".swf"          =>      "application/x-shockwave-flash",
  ".tar.gz"       =>      "application/x-tgz",
  ".tgz"          =>      "application/x-tgz",
  ".tar"          =>      "application/x-tar",
  ".zip"          =>      "application/zip",
  ".mp3"          =>      "audio/mpeg",
  ".m3u"          =>      "audio/x-mpegurl",
  ".wma"          =>      "audio/x-ms-wma",
  ".wax"          =>      "audio/x-ms-wax",
  ".ogg"          =>      "application/ogg",
  ".wav"          =>      "audio/x-wav",
  ".gif"          =>      "image/gif",
  ".jar"          =>      "application/x-java-archive",
  ".jpg"          =>      "image/jpeg",
  ".jpeg"         =>      "image/jpeg",
  ".png"          =>      "image/png",
  ".svg"          =>      "image/svg+xml",
  ".xbm"          =>      "image/x-xbitmap",
  ".xpm"          =>      "image/x-xpixmap",
  ".xwd"          =>      "image/x-xwindowdump",
  ".css"          =>      "text/css",
  ".html"         =>      "text/html",
  ".htm"          =>      "text/html",
  ".js"           =>      "text/javascript",
  ".asc"          =>      "text/plain",
  ".c"            =>      "text/plain",
  ".cpp"          =>      "text/plain",
  ".log"          =>      "text/plain",
  ".conf"         =>      "text/plain",
  ".text"         =>      "text/plain",
  ".txt"          =>      "text/plain",
  ".spec"         =>      "text/plain",
  ".dtd"          =>      "text/xml",
  ".xml"          =>      "text/xml",
  ".mp4"          =>      "video/mp4",
  ".mpg4"         =>      "video/mp4",
  ".mpeg"         =>      "video/mpeg",
  ".mpg"          =>      "video/mpeg",
  ".mov"          =>      "video/quicktime",
  ".qt"           =>      "video/quicktime",
  ".avi"          =>      "video/x-msvideo",
  ".asf"          =>      "video/x-ms-asf",
  ".asx"          =>      "video/x-ms-asf",
  ".wmv"          =>      "video/x-ms-wmv",
  ".bz2"          =>      "application/x-bzip",
  ".tbz"          =>      "application/x-bzip-compressed-tar",
  ".tar.bz2"      =>      "application/x-bzip-compressed-tar",
  ".rpm"          =>      "application/x-rpm",
  # make the default mime type application/octet-stream.
  ""              =>      "application/octet-stream",
 )
url.access-deny = ( "~", ".inc", ".websrv_htpasswd" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
server.pid-file = "/var/run/websrv.pid"
cgi.assign = (".php" => "/usr/local/bin/php-cgi-websrv")
server.tag = "webserv"
server.upload-dirs = ( "/var/tmp/ftmp" )
server.max-request-size = 16777216
#####################################
#        Start of my variables      #
#####################################
#Aditional modules
server.modules += (
"mod_status"
)
#More index files :)
index-file.names += (
"index.py", "default.py", "index.cgi", "index.pl"
)
#Rewrite Rules :D
url.rewrite-once = (
"/foo/?" => "index.html"
)
#Forbid access to /forbidden folder
$HTTP["url"] =~ "^/forbidden/?" {
    url.access-deny = ("")
}
else $HTTP["url"] =~ "^/lib/?" {
    url.access-deny = ("")
}else $HTTP["url"] =~ "/H20/?"{
server.document.root = "/mnt/MainPool/Development/WebServer/H20"
}
#Use the cgi-bin shit.
$HTTP["url"] =~ "^/cgi-bin/?" {
    cgi.assign = (
".py" => "/usr/local/bin/python2.7",
".cgi" => "/usr/local/bin/python2.7",
".pl" => "/usr/local/bin/python2.7"
    )
}

User avatar
daoyama
Developer
Developer
Posts: 423
Joined: 25 Aug 2012 09:28
Location: Japan
Status: Offline

Re: lighttpd not serving pages

#6

Post by daoyama » 05 Dec 2015 13:00

havoc wrote: server.document.root = "/mnt/MainPool/Development/WebServer/H20"
I think above is broken.
Did you check daemon log?
NAS4Free 10.2.0.2.2115 (x64-embedded), 10.2.0.2.2258 (arm), 10.2.0.2.2258(dom0)
GIGABYTE 5YASV-RH, Celeron E3400 (Dual 2.6GHz), ECC 8GB, Intel ET/CT/82566DM (on-board), ZFS mirror (2TBx2)
ASRock E350M1/USB3, 16GB, Realtek 8111E (on-board), ZFS mirror (2TBx2)
MSI MS-9666, Core i7-860(Quad 2.8GHz/HT), 32GB, Mellanox ConnectX-2 EN/Intel 82578DM (on-board), ZFS mirror (3TBx2+L2ARC/ZIL:SSD128GB)
Develop/test environment:
VirtualBox 512MB VM, ESXi 512MB-8GB VM, Raspberry Pi, Pi2, ODROID-C1

havoc
NewUser
NewUser
Posts: 5
Joined: 19 Sep 2015 02:13
Status: Offline

Re: lighttpd not serving pages

#7

Post by havoc » 07 Dec 2015 06:35

daoyama wrote:
havoc wrote: server.document.root = "/mnt/MainPool/Development/WebServer/H20"
I think above is broken.
Did you check daemon log?

I've removed that line and tried to access the webserver from an external device, to no avail (still cannot connect). (My previous post was on my local device)

Post Reply

Return to “WebServer”