DD-WRT and Lighttpd Setup

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
charlesmouse
DD-WRT Novice


Joined: 18 Jul 2021
Posts: 3

PostPosted: Sat Sep 18, 2021 16:03    Post subject: DD-WRT and Lighttpd Setup Reply with quote
Hello all,
I'm calling this 'Advanced Networking' because I'll be blowed if I can work it out - please be gentle and use helpful words of one syllable if the answers are obvious to you, they aren't to me.

Background:
-Linksys 1900ACS running DD-WRT 3.0 + USB stick with Ext2+Swap partitions, the former mounted as /opt, Entware, Transmission, a few other minor tweaks. OpenVPN client when my daughter isn't winging about "It's stopping me from accessing my dodgy internet sites!"
-A fairly extensive home network including an ESXi server running 'a bunch of stuff', along with an eclectic range of computers both new and very old.

Issue:
I used to run a webserver from an ESXi VM but was getting more hacking attempts than I could be bothered to deal with so moved that to 'the cloud'. Still, it would be nice if I could host a backup page if/when the cloud service goes down. I could spin up another VM to do that but noticed under DD-WRT: Services: Lighttpd Webserver: Enable/disable...

Problem:
So I clicked 'enable', followed the provided local URL, no dice... fair enough, some setting up no doubt required, if only to have a place to put the web pages!
Much, much, searching later and I still have no clue beyond some seemingly confusing hits talking about other methods of setting up Lighttpd, Entware, messing with php & cgi - I'm a long way from that!

Questions:
1) So how do I set up / use the seemingly built in Lighttpd server?
-What to do beyond clicking 'enable'
-Where are the relevant .config files / directories?
-How do I choose where to put them? (ie under /opt)
2) Is there a published manual for DD-WRT to be found anywhere? I don't mean the wiki or any other hard to navigate or follow sources if you are not already an expert, I mean a manual where the UI options are laid-out with a brief explanation for the function of each as a jumping off point to further use/investigation.

Many thanks.
charlesmouse.

NB:
I realise this is my issue so don't go getting upset. I'm no fan of *NIX-based systems and so my 'expertise' only goes as far as things I couldn't avoid piking up.
Please keep in mind I absolutely don't consider myself a *NIX command-line 'wizard'. Where any kind advice is given, thank you, speak slowly and clearly without any assumptions.
Sponsor
d33b0_n4p41m
DD-WRT User


Joined: 10 Sep 2021
Posts: 133

PostPosted: Sat Sep 18, 2021 16:24    Post subject: Reply with quote
Some possible useful information to read to help you get it sorted:

https://wiki.dd-wrt.com/wiki/index.php/Lighttpd_on_R7000 (use the web archive link below)

https://web.archive.org/web/20190723235253/http://tips.desipro.de/2014/03/04/using-the-integrated-webserver/

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=326048

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=326274

_________________
An old man said, “Erasers are made for those who make mistakes.” A youth replied, “Erasers are made for those who are willing to correct their mistakes!” Attitude matters! ~ Anonymous
----------
“You are always a student, never a master. You have to keep moving forward.” ~ Conrad Hall
----------
“Life is about moving on, accepting changes and looking forward to what makes you stronger and more complete.” ~ Anonymous
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Sat Sep 18, 2021 16:29    Post subject: Reply with quote
Welcome to the forum.

The best starting point for DDWRT is the forum guidelines:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087

Full of helpful pointers where and what to download, how to post etc.

DDWRT has a lot of wiki's for almost all subjects

In your case just google for: ddwrt wiki lighttpd

Or if you want to install entware google for:
ddwrt entware wiki

etc.

What build are you using?

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
userrox
DD-WRT Novice


Joined: 11 May 2019
Posts: 16

PostPosted: Sun Sep 19, 2021 4:17    Post subject: Reply with quote
I had a similar expectation about the lighttpd built into dd-wrt. I have it disabled in the GUI and start lighttpd upon bootup via a script in:-
Administration -> Commands -> USB Script
The command I use is:-
Code:
lighttpd -f /opt/etc/lighttpd/lighttpd.conf

You can probably serve basic pages using just lighttpd, but if you want PHP or similar then you'll need to setup entware. If you don't want to use non-standard listening ports for lighttpd and to access dd-wrt's httpd then you can proxy from lighttpd to httpd with httpd listening on a non-standard port and serve specific urls from each web server, e.g.
Code:
nvram set http_lanport=800
nvram commit

In lighttpd.conf
Code:
status.status-url     = "/server-status"

$HTTP["url"] =~ "^/cgi-bin/" {
   cgi.assign = ( "" => "" )
   alias.url += ( "/cgi-bin" => "/opt/share/www/cgi-bin/" )
}
# Proxy all none cgi-bin and server status & config requests to dd-wrt
$HTTP["url"] !~ "^(/cgi-bin/|/server-status|/phpinfo.php)" {
   proxy.server  = ( "" =>
          ( "internal" =>
                  (
                          "host" => "127.0.0.1",
                          "port" => 800
                  )
          ))
}
charlesmouse
DD-WRT Novice


Joined: 18 Jul 2021
Posts: 3

PostPosted: Mon Sep 20, 2021 9:10    Post subject: Reply with quote
Hi Chaps, thanks for the welcome and the replies.

Possibly I have struggled with finding answers to my difficulties because from my position of ignorance I don't know how to frame my questions. The answers I have found have been to a large extent over my head, and maybe not directly relevant - I have most assuredly looked for some considerable time before giving up and asking directly.
Something of a chicken and egg situation, hence my wondering if there is a manual for DD-WRT as a jumping off point. Also a manual to RTFM is an excellent resource for appreciating useful options and capabilities otherwise not considered. (Manuals and Reference books / Wikis are certainly not the same thing.)

As is often the case with these things "it's darkest before the dawn" so shortly after having finally given in after much fruitless struggle and asked for help I made some progress:

I found a particularly helpful guide which got me a good deal further toward my goals:
https://proprivacy.com/vpn/guides/dd-wrt
A highly recommended read for anyone starting with DD-WRT. But for the uninitiated like me, watch out! From what little I can tell some of the iptables 'magic spells' are not relevant/correct for all routers and DD-WRT installs - I suspect the nvram 'invocations' didn't play well with my WRT1900ACS

In a nut-shell the information I was 'missing' to use the built-in Lighttpd is one must have read/write access to jffs, my current /opt partition is not an option, at least within my scant understanding...
...So I pulled the USB stick I had previously set up with a /opt and /swap partitions for Entware and added a /jffs partition.
(A tip for anyone who doesn't use *NIX based systems - don't try this with any 'doze-based partition managers! I tried a few without success. Download the GParted live CD image, write to a USB stick, and use that. It's even got one of those fancy new-fangled GUI-thingummies and everything.)

Anyway, I now have my router largely as I want it:
-DD-WRT router + Large USB stick for read/write access
-Entware installed via an /opt partition
-Transmission running via a guide I found here
-Lighttpd running via a /jffs partition
-OpenVPN client up and running-ish via my VPN provider's guide*

*this last is giving me some unexpected trouble, again I suspect as a result of my ignorance, not knowing how to frame my questions, and what answers I have found either not being relevant or over my head. (firewall/iplists - good God in heaven! Is this really how we do things in 2021?)
I'm afraid as a result I'm going to have a lot more questions, please be patient!

P.S.
It's often the case that the best person to write a guide is the person who just worked it out - said guides tend to contain important information for the n00b that the knowledgeable have long-since stopped thinking of as information at all, important or otherwise.
Would it be helpful if I documented my progress so for (abbreviated of course) for any other new to DD-WRT users who may follow?

Thanks again your for answers to far. I really appreciate the time taken to reply even though most of them were over my head.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Mon Sep 20, 2021 9:42    Post subject: Reply with quote
Good job Smile

Any help is always welcome we are short staffed

VPN documentation see the link in my signature.

Almost all VPN providers have outdated or often wrong instructions how to setup a VPN client on DDWRT.

The VPN client setup guide has general information and for some providers also specific information how to setup.

P.S. I might have missed it but what buildnumber are you using?

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Mon Sep 20, 2021 11:47    Post subject: Reply with quote
charlesmouse wrote:

It's often the case that the best person to write a guide is the person who just worked it out - said guides tend to contain important information for the n00b that the knowledgeable have long-since stopped thinking of as information at all, important or otherwise.
Would it be helpful if I documented my progress so for (abbreviated of course) for any other new to DD-WRT users who may follow?

I couldn't agree with you more. I have specific comments I could make to shed light on this, but I shall not for the sake of proper etiquette and decorum. Please do document it, and at some point, the information could be added to the wiki.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum