Firmware selector customize web server

i am looking to find a way to customize the 1st installation via the https://firmware-selector.openwrt.org/.
i need to install the lighttpd web server, create /srv/www/ folder, and edit the /etc/lighttpd/lighttpd.conf and have:

server.document-root = "/srv/www/"
server.port = 81
dir-listing.activate = "enable"

then add a 2nd packet ABCD and edit file /etc/ABC and add some entries.

is it possible to do it in the firmware selector customization?

Yes, you can create a standard script to write that into your desired file.

Add the package to the customized list.

when you say script, you mean something to get downloaded after the installation?
is it possible to fetch those files and edit it before the download of the firmware?
the packet ABCD is something that will help me configure the Internet access and have it automatically connect, without user interaction.

No.

What files?

I stated:

  • add lighttpd web server to packages
  • add script to edit config file
  • create image (it will include lighttpd web server)
  • Flash image to device

Goal accomplished!

i have created a script and pasted it into the customization of the firmware. i think that i am missing something, as it does not install the lighttpd.
here are the commands that i have pasted into the section for customization

#!/bin/sh
# /etc/rc.local

# Update package list and install Lighttpd
opkg update
opkg install lighttpd

# Modify the Lighttpd configuration
cat << EOF > /etc/lighttpd/lighttpd.conf
server.document-root = "/srv/www/"
server.port = 81
dir-listing.activate = "enable"
EOF

# Create the document root directory
mkdir -p /srv/www

# Add a test HTML file
echo "<html><body><h1>It works!</h1></body></html>" > /srv/www/index.html

# Ensure Lighttpd starts on boot
/etc/init.d/lighttpd enable
/etc/init.d/lighttpd start

exit 0

what am i missing?

you adding lighttpd to the list of packages instead ?
something @lleachii pointed out to you yesterday.

1 Like

sorry, but it is not clear the way to me.
what do i have to do?

go to https://firmware-selector.openwrt.org/, select your device, click the customizing arrow, and add the packages you need, to the list.
request a build.

1 Like

isn't this that i mention that i did? But it fails

no ?

because you're not doing what you've been told ...

let me try again

that's probably a good idea ...

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.