Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
1 answers
2116 views
Getting HTTPS web interface for transmission with Lighttpd reverse proxy
i'm trying to get HTTPS web interface for transmission. Currently i can access transmission web interface with http://myip:8081 and what i want is to connect with https://myip/transmission . i already setup my lighttpd with TSL/SSL so i can access to default index page at https://myip I enabled mod_...
i'm trying to get HTTPS web interface for transmission. Currently i can access transmission web interface with http://myip:8081 and what i want is to connect with https://myip/transmission . i already setup my lighttpd with TSL/SSL so i can access to default index page at https://myip I enabled mod_proxy lighty-enable-mod proxy Therefore, in /etc/lighttpd/conf-enabled, i have a 10-proxy.conf which is actually a symlink to /etc/lighttpd/conf-available/10-proxy.conf, and this file contains : server.modules += ( "mod_proxy" ) then in lighttpd.conf i added : $SERVER["socket"] == "0.0.0.0:443" { ssl.engine = "enable" ssl.pemfile = "/etc/lighttpd/certs/cert.pem" ssl.cipher-list = "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM" ssl.honor-cipher-order = "enable" } $HTTP["url"] == "^/transmission/" { proxy.server = ("" => ( ( "host" => "127.0.0.1", "port" => 8081 )) ) } Then I reloaded lighttpd config service lighttpd force-reload Conf Syntax is OK but when i want to access to https://myip/transmission/ I've got a 404 not found page.
MR RsO (21 rep)
Sep 7, 2018, 09:00 AM • Last activity: Jul 31, 2025, 06:05 PM
0 votes
1 answers
2188 views
lighttpd reverse proxy
I have two raspberry pi servers running. These were set up with DietPi. The one server is used as a NextCloud server. The other (new) server is running weewx. Both use lighttpd as the webserver. Each operates under a different domain my.domain.com and my.otherdomain.com. My router has a single IP ad...
I have two raspberry pi servers running. These were set up with DietPi. The one server is used as a NextCloud server. The other (new) server is running weewx. Both use lighttpd as the webserver. Each operates under a different domain my.domain.com and my.otherdomain.com. My router has a single IP address and I use port forwarding to access both servers. The NextCloud server (my.domain.com) has SSL enabled using dietpi-letsencrypt. I cannot run certbot on my.otherdomain.com because I only have one public IP address. I enabled mod-proxy on my Nextcloud machine (my.domain.com) and it forwards requests to my.otherdomain.com to the weewx machine. I disabled port forwarding on the router to the weewx machine. However, dietpi-letsencrypt cannot generate a SSL certificate for the weewx machine - the challenges fail. I tried to run certbot on both machines. Here is the attempt for my Nextcloud machine (used as my proxy server):
Do you want to expand and replace this existing certificate with the new
certificate?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(E)xpand/(C)ancel: E 
Renewing an existing certificate for my.domain.com and my.otherdomain.com
Performing the following challenges:
http-01 challenge for aws.andrewterhorst.com
Using the webroot path /var/www for all unmatched domains.
Waiting for verification...
Challenge failed for domain my.otherdomain.com
http-01 challenge for my.otherdomain.com
Cleaning up challenges
Some challenges have failed.

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: my.otherdomain.com
   Type:   unauthorized
   Detail: Invalid response from
   http://my.otherdomain.com/.well-known/acme-challenge/p16SmhyufIGQ75fnhWQ4zxf49TCLfnX4SoWRmBqAHBg 

server.feature-flags       += ("server.h2c"     => "enable")
server.feature-flags       += ("server.graceful-shutdown-timeout" => 5)
#server.feature-flags       += ("server.graceful-restart-bg" => "enable")

# strict parsing and normalization of URL for consistency and security
# https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_http-parseoptsDetails 
# (might need to explicitly set "url-path-2f-decode" = "disable"
#  if a specific application is encoding URLs inside url-path)
server.http-parseopts = (
  "header-strict"           => "enable",# default
  "host-strict"             => "enable",# default
  "host-normalize"          => "enable",# default
  "url-normalize-unreserved"=> "enable",# recommended highly
  "url-normalize-required"  => "enable",# recommended
  "url-ctrls-reject"        => "enable",# recommended
  "url-path-2f-decode"      => "enable",# recommended highly (unless breaks app)
 #"url-path-2f-reject"      => "enable",
  "url-path-dotseg-remove"  => "enable",# recommended highly (unless breaks app)
 #"url-path-dotseg-reject"  => "enable",
 #"url-query-20-plus"       => "enable",# consistency in query string
)

index-file.names            = ( "index.php", "index.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.conf.pl"
include "/etc/lighttpd/conf-enabled/*.conf"

#server.compat-module-load   = "disable"
server.modules += (
	"mod_dirlisting",
	"mod_staticfile",
)


# proxy settings
$HTTP["host"]=~ "my.otherdomain.com"  {
        proxy.balance = "fair"
        proxy.server =  ("" =>
                                (
                                        ( "host" => "192.168.0.261", "port" => 80 ),
                                        ( "host" => "192.168.0.261", "port" => 443 )
                                ))
                        }
Technically, the proxy settings should be in 10-proxy.conf. I need to run this command:
lighty-enable-mod proxy
This creates a symbolic link in /etc/lighttpd/conf-enabled to 10-proxy.conf in /etc/lighttpd/conf-available. I read I could simply add proxy settings in lighttpd.conf - it was not necessary to use 10-proxy.conf. The current set-up means incoming traffic to my.otherdomain.com ends up on the second weewx machine. However, certbot needs to communicate out. I am confused about where I should run certbot - from my weewx machine or from my NextCloud machine? I am not a Linux boffin and need some guidance on how to set up lighttpd to do forward and reverse proxies so my weewx machine can be secure. Most of the posts touching on this refer to Apache, nginx, or some specific web application setup. The syntax of the lighttpd conf settings is rather confusing using regex like notation. For example:
$HTTP['host'] =~ '^(www.example.com)$' {
        url.rewrite-once = ('^/(.*)' => '/vhost/http/%0/$1')
        # In lighttpd we alter the path manually using rewrite rule. %0
        # refers to the hostname and $1 is the path.
        proxy.server = ( '' =>
                ( (
                'host' => '127.0.0.1',
                'port' => 8080
                ) )
        )
}
There is no step by step tutorial in plain simple English for simpletons such as me.
aterhorst (101 rep)
Sep 11, 2021, 11:26 AM • Last activity: Jul 22, 2025, 01:05 PM
0 votes
2 answers
6164 views
Howto restrict IPv6 listening address in lighttpd on Debian
I try to make a lighttpd only available from localhost on a Debian system. The following lines are in `/etc/lighttpd/lighttpd.conf` server.port = 80 server.bind = "127.0.0.1" server.use-ipv6 = "disable" However, the webserver is running on all IPv6 addresses, too: # netstat -tupan|grep lighttpd tcp...
I try to make a lighttpd only available from localhost on a Debian system. The following lines are in /etc/lighttpd/lighttpd.conf server.port = 80 server.bind = "127.0.0.1" server.use-ipv6 = "disable" However, the webserver is running on all IPv6 addresses, too: # netstat -tupan|grep lighttpd tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 519887/lighttpd tcp6 0 0 :::80 :::* LISTEN 519887/lighttpd With the following line instead of the formerly printed lines in the config file, the server won't start: server.bind = "[::1]" It means, I've got only an error message about a used port, but the port ist not used! # netstat -tupan|grep LISTEN|grep 80/; lighttpd -f /etc/lighttpd/lighttpd.conf; netstat -tupan|grep LISTEN|grep 80/ 2023-04-27 16:50:24: (network.c.537) can't bind to socket: [::1]:80: Address already in use How I can restrict lighttpd to listen only on localhost (only IPv4, only IPv6 or IPv4 and IPv6)
Micha (187 rep)
Apr 27, 2023, 02:52 PM • Last activity: Feb 2, 2025, 08:49 PM
1 votes
0 answers
174 views
Trying to set up self signed certificates on other devices
To keep it short. I have a web server running (lighttpd on my Raspberry Pi), I want to be able to HTTPS to this IP from another device (PC - arch). For this I am trying to just use self-signed certificates by creating Certificate Authority and server certs. Here is what I tried and my current setup:...
To keep it short. I have a web server running (lighttpd on my Raspberry Pi), I want to be able to HTTPS to this IP from another device (PC - arch). For this I am trying to just use self-signed certificates by creating Certificate Authority and server certs. Here is what I tried and my current setup: 192.168.1.218 (RPI): #CA openssl genrsa -aes256 -out ca.key 2048 openssl req -x509 -new -nodes -key ca.key -sha256 -days 3065 -out ca.crt #Server openssl genrsa -out server.key 2048 openssl req -new -key server.key -out server.csr openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 3650 -sha256 -extfile server.cfg server.cfg contents: authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment subjectAltName = @alt_names [alt_names] DNS.1 = 192.168.1.218 DNS.2 = lighttpd config as per docs - https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_SSL : server.modules += ("mod_openssl") $SERVER["socket"] == ":443" { ssl.engine = "enable" ssl.pemfile = "/etc/lighttpd/ssl/server/server.crt" ssl.privkey = "/etc/lighttpd/ssl/server/server.key" proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8008 ) ) ) } Once I had the setup in place, I copied ca.crt from RPI (192.168.1.218) to PC (192.168.1.36) and installed it in Arch following the docs: https://wiki.archlinux.org/title/User:Grawity/Adding_a_trusted_CA_certificate#System-wide_%E2%80%93_Arch,_Fedora_(p11-kit) Now I try to connect using curl, but I get a certificate error: curl https://192.168.1.218 curl: (60) SSL certificate problem: certificate is not yet valid More details here: https://curl.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above. The same for **curl https://192.168.1.218 -cacert ca.crt**. Only using the **-k** option (insecure) am I able to connect and fetch response successfully. Is there anything I have missed? **RPI lighttpd version:** lighttpd/1.4.69 (ssl) - a light and fast webserver (RPI) **PC Arch curl version** curl 8.8.0 (x86_64-pc-linux-gnu) libcurl/8.8.0 OpenSSL/3.3.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.62.1 nghttp3/1.3.0 Release-Date: 2024-05-22
arizona525 (11 rep)
Jun 4, 2024, 09:55 AM • Last activity: Jun 4, 2024, 11:33 AM
1 votes
2 answers
1860 views
How to configure lighttpd to redirect HTTP to HTTPS?
I want to redirect HTTP requests to my website to HTTPS when the client browser supports it. My web server is lighttpd.
I want to redirect HTTP requests to my website to HTTPS when the client browser supports it. My web server is lighttpd.
a3nm (9557 rep)
Jul 29, 2022, 08:12 AM • Last activity: Oct 9, 2023, 11:45 PM
0 votes
1 answers
140 views
lighttpd: ajax request prints the content of cgi script instead of running it
I am using lighttpd version 1.4.55 within an ARM environment. I created an HTML pages in which there is a button used to download some json data. This button trigger a submit form that calls a cgi script. This script has to take the output of the form and write into a file. But when I click on the b...
I am using lighttpd version 1.4.55 within an ARM environment. I created an HTML pages in which there is a button used to download some json data. This button trigger a submit form that calls a cgi script. This script has to take the output of the form and write into a file. But when I click on the button, the response text of the xhr request is the content of the cgi script instead of the printf message. The cgi has the execution permissions. I divided the folders in the following way: •mnt/userfs/lighttpd/ •www • /scripts_files json.cgi • /html_files •css folder •js folder • upload_dir • index.html • /admin • password_file • main.html • file_upload.html • /user • password_file • main.html • file_upload.html •lighttpd.conf •log •error.log The button that calls the form is the following:
The button calls a function and then download the file created with .cgi script. The function of the ajax request:
function submit_form()
	{
		var div1 = document.getElementById("extern");
		var data = {};
		data = recursive_f(div1, 0, 0);
		output = JSON.stringify(data);
		var xhr_lv = new XMLHttpRequest();
        xhr_lv.onreadystatechange=function()
        xhr_lv.open("POST", "/scripts_files/json.cgi", true);
        xhr_lv.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
        xhr_lv.send(output);
	}
C program that generates the .cgi script:
#include 
#include 
#include 

int main(int argc, char* argv[])
{
    char* post_len_v = getenv("CONTENT_LENGTH");
    long post_len = strtol(post_len_v, NULL, 10);
    char* post_msg = (char*)malloc(post_len + 1);
    FILE *fp;


    if (!post_msg)
    { 
        return 0; 
    }
    fgets(post_msg, post_len + 1, stdin);      

    fp = fopen("/mnt/userfs/lighttpd/www/scripts_files/conf.json", "w");

    fprintf(fp, "%s", post_msg);
    fclose(fp);

    printf("Content-type: application/json\n\n");

    return 0;
}
Lighttpd configuration file:
server.modules              = (
                "mod_indexfile",
                "mod_access",
                "mod_redirect",
                "mod_alias",
                "mod_compress",
                "mod_dirlisting",
                "mod_staticfile",
                "mod_auth",
                "mod_authn_file",
                "mod_accesslog",
                "mod_cgi",
                #"mod_rewrite",
                #"mod_status"
                #"mod_fastcgi"
)

server.document-root        = "/mnt/userfs/lighttpd/www"


server.errorlog             = "/mnt/userfs/lighttpd/log/error.log"
server.breakagelog         = "/mnt/userfs/lighttpd/log/breakage.log"

index-file.names            = ("index.html", "main.html", "file_upload.html")

mimetype.assign = (
	".class" => "application/java-vm",
	".js" => "application/javascript",
	".mjs" => "application/javascript",
	".json" => "application/json",
	".jsonld" => "application/ld+json",
	".wmx" => "video/x-ms-wmx",
	".wvx" => "video/x-ms-wvx",
	".avi" => "video/x-msvideo",
	".movie" => "video/x-sgi-movie",
	".ice" => "x-conference/x-cooltalk",
	".sisx" => "x-epoc/x-sisx-app",
	".vrm" => "x-world/x-vrml",
	"README" => "text/plain; charset=utf-8",
	"Makefile" => "text/x-makefile; charset=utf-8",
	
	# enable caching for unknown mime types:
	#"" => "application/octet-stream"
)

mimetype.use-xattr        = "disable" 

url.access-deny             = ( "~", ".inc" )

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

server.port                = 80

server.username            = "midac"
server.groupname           = "midac"

#compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

cgi.assign = ( ".cgi" => "" )

$HTTP["url"] =~ "/admin" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/mnt/userfs/lighttpd/www/admin/.htpasswd"
auth.require = ( "/admin" => (
    "method" => "basic", 
    "realm" => "main", 
    "require" => "valid-user") 
)
}

$HTTP["url"] =~ "/user" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/mnt/userfs/lighttpd/www/user/.htpasswd"
auth.require = ( "/user" => (
    "method" => "basic", 
    "realm" => "main", 
    "require" => "valid-user") 
)
}

$HTTP["url"] =~ "/user2" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/mnt/userfs/lighttpd/www/user2/.htpasswd"
auth.require = ( "/user2" => (
    "method" => "basic", 
    "realm" => "main", 
    "require" => "valid-user") 
)
}
I tried also with sample cgi script, but I got this result: #!/bin/sh echo hello so the content of the cgi script. The type of POST request is octet-stream, seems that cgi_mod not working properly, or I missed something on the configuration file of lighttpd. Any suggestions?
marco (1 rep)
Mar 9, 2023, 10:40 AM • Last activity: Jun 13, 2023, 04:03 AM
0 votes
1 answers
1764 views
Setting www-data (lighttpd) as sudoer not working
I have installed lighttpd with fast-cgi on the raspberry pi. When running a python script that requires root priveleges, I get the following error: > RuntimeError: No access to /dev/mem. Try running as root! Traceback > (most recent call last): File "/var/www/index.py", line 134, in > GPIO.setup(17,...
I have installed lighttpd with fast-cgi on the raspberry pi. When running a python script that requires root priveleges, I get the following error: > RuntimeError: No access to /dev/mem. Try running as root! Traceback > (most recent call last): File "/var/www/index.py", line 134, in > GPIO.setup(17, GPIO.OUT);#enable A RuntimeError: No access to > /dev/mem. Try running as root! I have added www-data as a sudoer using visudo and "sudo usermod -a -G sudo www-data", but it did not work. How can I give lighttpd root priveleges? Security is NOT important as this is a personal project.
yogur (101 rep)
Feb 11, 2016, 11:06 PM • Last activity: Jan 4, 2023, 06:15 PM
1 votes
1 answers
299 views
Process (mplayer) doesn't read from named pipe when started from webserver (lighttpd)
# tl;dr $ sudo -u www-data mplayer -slave -input file=/srv/mplayer.fifo -playlist /srv/list & $ lsof /srv/mplayer.fifo | tail +2 mplayer 21059 www-data 4u FIFO 179,2 0t0 2359331 /srv/mplayer.fifo $ cat /var/www/html/test #!/usr/bin/bash mplayer -slave -input file=/srv/mplayer.fifo -playlist /srv/lis...
# tl;dr $ sudo -u www-data mplayer -slave -input file=/srv/mplayer.fifo -playlist /srv/list & $ lsof /srv/mplayer.fifo | tail +2 mplayer 21059 www-data 4u FIFO 179,2 0t0 2359331 /srv/mplayer.fifo $ cat /var/www/html/test #!/usr/bin/bash mplayer -slave -input file=/srv/mplayer.fifo -playlist /srv/list & $ curl 'http://localhost/test' # mplayer starts playback (and keeps playing) $ lsof /srv/mplayer.fifo # no output!? # details On my **Raspberry Pi**, I have a *lighttpd* server running. It's supposed to start and control an *mplayer* process. The webserver starts mplayer with -slave -input file=/srv/mplayer.fifo. (So mplayer reads and executes commands from that file.) In order to skip to the next song, one of the webserver scripts writes pt_skip 1 to /srv/mplayer.fifo. This indeed works when mplayer was run from command line. But when started from lighttpd, mplayer does not read commands from /srv/mplayer.fifo. I don't understand why. Here's what I did: Setup $ mkfifo /srv/mplayer.fifo $ chmod o+w /srv/mplayer.fifo $ ls -l /srv/mplayer.fifo prw-r--rw- 1 root root 0 Aug 7 12:11 /srv/mplayer.fifo Test (ran from command line) $ sudo -u www-data mplayer -ao alsa -slave -input file=/srv/mplayer.fifo -playlist /srv/list -shuffle $ lsof /srv/mplayer.fifo COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mplayer 21059 www-data 4u FIFO 179,2 0t0 2359331 /srv/mplayer.fifo $ ps aux | grep mplayer root 21058 0.0 0.2 4680 2400 pts/0 S+ 12:13 0:00 sudo -u www-data mplayer -ao alsa -slave -input file=/srv/mplayer.fifo -playlist /srv/list -shuffle www-data 21059 11.6 3.1 127928 30008 pts/0 SL+ 12:13 0:01 mplayer -ao alsa -slave -input file=/srv/mplayer.fifo -playlist /srv/list -shuffle That's like expected. But if I run mplayer from lighttpd ... $ cat /var/www/html/play #!/usr/bin/bash mplayer -ao alsa -slave -input file=/srv/mplayer.fifo -playlist /srv/list -shuffle & ... **it starts mplayer**, but the mplayer instance is not reading from /srv/mplayer.fifo. lsof doesn't produce any output: $ lsof /srv/mplayer.fifo $ ps aux | grep mplayer www-data 21177 15.3 3.1 128212 29744 ? SL 12:30 0:01 mplayer -ao alsa -slave -input file=/srv/mplayer.fifo -playlist /srv/list -shuffle I can also see mplayer is not reading from the pipe, because writing to it blocks. The mplayer logs don't show anything unusual. Do you have an idea why mplayer doesn't read from the named pipe when run from lighttpd?
steffen (121 rep)
Aug 7, 2022, 12:56 PM • Last activity: Aug 15, 2022, 01:02 PM
1 votes
1 answers
5162 views
How to troubleshoot lighttpd service not starting up?
I am using Ubuntu 18.04.4 LTS. I have installed lighttpd 8.28. I have created the folder - r-x 2 www-data www-data 4096 Mar 16 15:41 httpd I am pointing my server.document-root to /home/httpd When I restart the service. # systemctl restart lighttpd.service Job for lighttpd.service failed because the...
I am using Ubuntu 18.04.4 LTS. I have installed lighttpd 8.28. I have created the folder - r-x 2 www-data www-data 4096 Mar 16 15:41 httpd I am pointing my server.document-root to /home/httpd When I restart the service. # systemctl restart lighttpd.service Job for lighttpd.service failed because the control process exited with error code. See "systemctl status lighttpd.service" and "journalctl -xe" for details. I get the following errors on syslog. I am clueless on how can I debug this and what is the real problem here. I have changed the group to www-data for my server-document.root. Mar 16 16:28:42 abc-VirtualBox systemd: Starting Lighttpd Daemon... Mar 16 16:28:42 abc-VirtualBox lighttpd: /usr/sbin/lighttpd: Symbol `FamErrlist' has different size in shared object, consider re-linking Mar 16 16:28:42 abc-VirtualBox lighttpd: /usr/sbin/lighttpd: symbol lookup error: /usr/sbin/lighttpd: undefined symbol: FAMNoExists Mar 16 16:28:42 abc-VirtualBox systemd: lighttpd.service: Control process exited, code=exited status=127 Mar 16 16:28:42 abc-VirtualBox systemd: lighttpd.service: Failed with result 'exit-code'. Mar 16 16:28:42 abc-VirtualBox systemd: Failed to start Lighttpd Daemon. Mar 16 16:28:42 abc-VirtualBox systemd: lighttpd.service: Service hold-off time over, scheduling restart. Mar 16 16:28:42 abc-VirtualBox systemd: lighttpd.service: Scheduled restart job, restart counter is at 5. Mar 16 16:28:42 abc-VirtualBox systemd: Stopped Lighttpd Daemon. Mar 16 16:28:42 abc-VirtualBox systemd: lighttpd.service: Start request repeated too quickly. Mar 16 16:28:42 abc-VirtualBox systemd: lighttpd.service: Failed with result 'exit-code'. Mar 16 16:28:42 abc-VirtualBox systemd: Failed to start Lighttpd Daemon.
tannoy connect (299 rep)
Mar 16, 2020, 06:31 AM • Last activity: Oct 26, 2021, 09:55 AM
1 votes
1 answers
1454 views
Pass traffic from one network interface to another
I have a project where I have 4x RPiZ plugged into a single RPi4. The RPiZs appear as Ethernet over USB devices as network interfaces `ethpi1`, `ethpi2`, `ethpi3`, and `ethpi4` with IP addresses `10.0.11.2`, `10.0.12.2`, `10.0.13.2`, and `10.0.14.2` respectively. The RPi4 is on a network I have acce...
I have a project where I have 4x RPiZ plugged into a single RPi4. The RPiZs appear as Ethernet over USB devices as network interfaces ethpi1, ethpi2, ethpi3, and ethpi4 with IP addresses 10.0.11.2, 10.0.12.2, 10.0.13.2, and 10.0.14.2 respectively. The RPi4 is on a network I have access to with a known, but not controlled, IP address like 192.168.0.2 or something. I won't have physical access to the device once it is set up. All 5x RPi's have a FTP (proftpd) server, a HTTP (lighttpd) server, and SSH enabled. I am trying to figure out how to access these servers on the RPiZ's without first SSHing into the RPi4. This involves multiple related questions. If I have a computer on the same ethernet network as the RPi4, how do I direct traffic to/from the RPiZ's?
Rusty (113 rep)
Jan 21, 2021, 03:55 AM • Last activity: Jan 21, 2021, 02:12 PM
0 votes
1 answers
309 views
How to compile lighttpd .tar file using cygwin to run executable file in Windows 10
I have downloaded [lighttpd tar](https://www.lighttpd.net/) file and I need it to compile it using cygwin for Windows 10 machine. I did some extensive research on how to compile lighttpd files using cygwin in google but most of the articles are very old. I need some guidance. ***UPDATE*** I know I n...
I have downloaded [lighttpd tar](https://www.lighttpd.net/) file and I need it to compile it using cygwin for Windows 10 machine. I did some extensive research on how to compile lighttpd files using cygwin in google but most of the articles are very old. I need some guidance. ***UPDATE*** I know I need to use Mingw application to compile LighTpd file to make it a Standalone application. I tried looking up instruction online but I couldn't find any.
krillavilla (111 rep)
Sep 19, 2020, 09:34 AM • Last activity: Nov 14, 2020, 08:12 AM
0 votes
1 answers
1168 views
lighttpd won't start even with the right permissions
systemctl status lighttpd ● lighttpd.service - Lightning Fast Webserver With Light System Requirements Loaded: loaded (/usr/lib/systemd/system/lighttpd.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2020-09-24 15:56:39 EDT; 2s ago Process: 6152 ExecStart=/usr...
systemctl status lighttpd ● lighttpd.service - Lightning Fast Webserver With Light System Requirements Loaded: loaded (/usr/lib/systemd/system/lighttpd.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2020-09-24 15:56:39 EDT; 2s ago Process: 6152 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255) Main PID: 6152 (code=exited, status=255) Sep 24 15:56:39 js.dc.localsystemd: Started Lightning Fast Webserver With Light System Requirements. Sep 24 15:56:39 js.dc.locallighttpd: 2020-09-24 15:56:39: (server.c.752) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied Sep 24 15:56:39 js.dc.locallighttpd: 2020-09-24 15:56:39: (server.c.1485) Opening errorlog failed. Going down. Sep 24 15:56:39 js.dc.localsystemd: lighttpd.service: Main process exited, code=exited, status=255/n/a Sep 24 15:56:39 js.dc.localsystemd: lighttpd.service: Failed with result 'exit-code'. dir permissions are as follows: ]# ls -la /var/log/lighttpd/ total 4 drw-rw-rw- 2 lighttpd lighttpd 41 Sep 24 15:54 . drwxr-xr-x. 8 root root 4096 Sep 24 14:49 .. -rw-rw-rw- 1 lighttpd lighttpd 0 Sep 24 15:00 access.log -rw-rw-rw- 1 lighttpd lighttpd 0 Sep 24 15:54 error.log I've remove and recreated the file. There is no selinux enabled. Not sure what else to try.
Jason (1754 rep)
Sep 24, 2020, 08:00 PM • Last activity: Sep 24, 2020, 09:49 PM
1 votes
1 answers
1193 views
Lighttpd when running python CGI reports - 403 forbidden - Ubuntu
I am starting a lighttpd service in my ubuntu.My idea here is to serve a python script through CGI. But, when I do this I get 403 forbidden? Please help how to debug and what am I missing here? vi /etc/lighttpd/lighttpd.conf server.document-root "/home/httpd" Enable, CGI in lighttpd. vi /etc/lighttp...
I am starting a lighttpd service in my ubuntu.My idea here is to serve a python script through CGI. But, when I do this I get 403 forbidden? Please help how to debug and what am I missing here? vi /etc/lighttpd/lighttpd.conf server.document-root "/home/httpd" Enable, CGI in lighttpd. vi /etc/lighttpd/lighttpd.conf server.modules = ( "mod_access", "mod_alias", "mod_compress", "mod_redirect", "mod_cgi", "mod_rewrite", ) In order to get lighttpd to recognize any python scripts we need to add the following new section at the end of the file. $HTTP["url"] =~ "^/cgi-bin/" { cgi.assign = (".py" => "/usr/bin/python") } Give appropriate permission to the root folder. # chown www-data /home/httpd/cgi-bin # chgrp www-data /home/httpd/cgi-bin Now, write the hello.py vi /home/httpd/cgi-bin/hello.py #! /usr/bin/python # print "Content-Type: text/html\n\n" print ' ' print ' Raspberry Pi

for count in range(1,100) print'Hello World...' print "/p> Finally, restart the lighttpd service. #service lighttpd restart But, when I try to access the page it says- 403 forbidden Here is my folder with permission /home/httpd. /home/httpd$ ls -l total 8 drwxr-xr-x 2 www-data www-data 4096 Apr 3 17:56 cgi-bin drwxr-xr-x 2 www-data root 4096 Apr 3 16:41 html Here is the hello.py /home/httpd/cgi-bin$ ls -l total 4 -rwxrwxrwx 1 root www-data 244 Apr 3 17:56 hello.py The log says that it is still looking for php, html files rather than my python binary? read(7, "GET / HTTP/1.1\r\nHost: 10.0.2.15\r"..., 4159) = 328 stat("/home/httpd/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat("/home/httpd/index.php", 0x7ffee411b9f0) = -1 ENOENT (No such file or directory) stat("/home/httpd/index.html", 0x7ffee411b9f0) = -1 ENOENT (No such file or directory) stat("/home/httpd/index.lighttpd.html", 0x7ffee411b9f0) = -1 ENOENT (No such file or directory) setsockopt(7, SOL_TCP, TCP_CORK, , 4) = 0 writev(7, [{iov_base="HTTP/1.1 403 Forbidden\r\nContent-"..., iov_len=134}, {iov_base="

tannoy connect (299 rep)
Apr 11, 2020, 02:32 AM • Last activity: Apr 27, 2020, 11:55 PM
2 votes
1 answers
1417 views
Setup subdomain on a lighttpd server
I am running OSMC on my raspberry p3 and was trying to set up a webpage for internal use. I installed lighttpd and when I try to get to "osmc.local" the lighttpd page shows up just fine.Now I wanted to set up a subdomain, say "xyz.osmc.local". I know that the file "/etc/lighttpd/lighttpd.conf" needs...
I am running OSMC on my raspberry p3 and was trying to set up a webpage for internal use. I installed lighttpd and when I try to get to "osmc.local" the lighttpd page shows up just fine.Now I wanted to set up a subdomain, say "xyz.osmc.local". I know that the file "/etc/lighttpd/lighttpd.conf" needs to be edited and lines like the following need to be added to create subdomain/virtualhost. $HTTP["host"] == "sub.example.com" { server.document-root = "/var/www/sub.example.com/public/htdocs" server.errorlog = "/var/www/sub.example.com/logs/error.log" accesslog.filename = "/var/www/sub.example.com/logs/access.log" } But no matter what I do, no subdomain works even though the domain "osmc.local" is working fine. Any suggestions?
flide (51 rep)
Sep 12, 2016, 04:55 AM • Last activity: Aug 21, 2019, 11:45 AM
17 votes
2 answers
15842 views
Why is lighttpd saying "unknown config-key: accesslog.filename"?
I have created a simply vhost on Lighttpd web server and put these lines on the .conf file. server.errorlog = "/var/log/lighttpd/error.log" accesslog.filename = "/var/log/lighttpd/access.log" I have read error.log and I found this: 2011-04-22 00:36:58: (server.c.954) WARNING: unknown config-key: acc...
I have created a simply vhost on Lighttpd web server and put these lines on the .conf file. server.errorlog = "/var/log/lighttpd/error.log" accesslog.filename = "/var/log/lighttpd/access.log" I have read error.log and I found this: 2011-04-22 00:36:58: (server.c.954) WARNING: unknown config-key: accesslog.filename (ignored) How is it possible? accesslog.filename exists, it's an option of the server. I found it on their website: http://redmine.lighttpd.net/wiki/lighttpd/Docs:ConfigurationOptions What can I do?
user6841
Apr 21, 2011, 10:49 PM • Last activity: Jan 13, 2019, 01:24 PM
2 votes
1 answers
723 views
xinetd cannot launch lighttpd
I want to launch `lighttpd` when someone tries to connect to port 80. I started with a simple test script to see if anything was working: `/etc/xinetd.d/www` service www { disable = no socket_type = stream protocol = tcp port = 80 log_on_success += USERID log_on_failure += USERID server = /usr/serve...
I want to launch lighttpd when someone tries to connect to port 80. I started with a simple test script to see if anything was working: /etc/xinetd.d/www service www { disable = no socket_type = stream protocol = tcp port = 80 log_on_success += USERID log_on_failure += USERID server = /usr/server_test.sh user = root instances = UNLIMITED wait = no log_type = SYSLOG daemon debug } where /usr/server_test.sh: #!/bin/sh echo "www connection" lighttpd -D -f /usr/lighttpd.conf & webconfig -c /usr/cppcms.js & service xinetd restart When I try: nc localhost 80 I get: www connection 2013-11-25 16:37:13: (network.c.345) can't bind to port: 80 Address already in use How do I get xinetd and lighttpd to work together, not fight over same port?
JakobJ (157 rep)
Nov 29, 2013, 10:46 AM • Last activity: Feb 22, 2018, 12:10 PM
3 votes
1 answers
317 views
Apache vs lighthttpd : different behaviours with mime type
I have written an application, an automatic VPN provisioning web portal in python for Apple devices. What bugs me is a difference in behaviour between the testing and production server; the former is using `Apache`, while the latter is using `lighthttpd`. In `lighhttpd` the `.mobileconfig`file is op...
I have written an application, an automatic VPN provisioning web portal in python for Apple devices. What bugs me is a difference in behaviour between the testing and production server; the former is using Apache, while the latter is using lighthttpd. In lighhttpd the .mobileconfigfile is opened and "executed" e.g. it opens SysPrefs automatically, while in Apache that is not happening. I have already noticed lighhtpd is much more lax concerning proper Content-Type definitions, however the issue at hand is that Safari will load and "auto-execute" .mobileconfig files properly with lighthttpdwhilst the same does not happen with Apache. What further irks me it that in both servers I have defined properly the corresponding mime.type as in: lighthttpd.conf $HTTP["url"] =~ "\.mobileconfig$" { setenv.add-response-header = ( "Content-Disposition" => "attachment" ) mimetype.assign = (".mobileconfig" => "application/x-apple-aspen-config", "" => "application/octet-stream") } As in Apache it is: dovpn.conf (vhost) AddType application/x-apple-aspen-config .mobileconfig The first clue of a difference actually seems to stem from that add-response-header directive in lighthttpd. In the generated HTML, I have: a download="profile.mobileconfig" href="../upload/8bd16b26-1473-4994-9803-8268a372cd0d.mobileconfig" type="application/octet-stream">Download automatic profile/a and I do an automatic download of that via Javascript //If in Safari - download via virtual link click if (window.downloadFile.isSafari) { //Creating new link node. var link = document.createElement('a'); link.href = sUrl; if (link.download !== undefined) { //Set HTML5 download attribute. This will prevent file from opening if supported. var fileName = sUrl.substring(sUrl.lastIndexOf('/') + 1, sUrl.length); link.download = fileName; } //Dispatching click event. if (document.createEvent) { var e = document.createEvent('MouseEvents'); e.initEvent('click', true, true); link.dispatchEvent(e); return true; } } The content of the generate page also only has as Content-Type: Content-Type: text/html\n\n both in Apache and lighthttpd. I sniffed over the wire, and there are no apparent changes made to Content-Type made via lighthttpd. Will I be able to replicate similar functionality of setenv.add-response-header with Apache? I have already tried to add to the Apache host: Header set Content-Disposition attachment and SetEnvIf Request_URI "\.mobileconfig$" change_header Header set Content-Disposition attachment env=change_header and SetEnvIf Request_URI "\.mobileconfig$" change_header Header always add "Content-Disposition" "attachment" env=change_header and Header append Content-Disposition attachment I also have tried, in the actual directory, creating an .htaccess file with: ForceType application/octet-stream Header append Content-Disposition "attachment" Allow from all and ForceType application/octet-stream Header add Content-Disposition "attachment" Allow from all In both cases, besides attachment, I also used "attachment". Please note mod_headers is active by default in Apache/Debian 9, and none of these alternatives worked out. Actually, I just remembered lighthttpd is using HTTP, and Apache HTTPS. I tested it out lighthttpd with HTTPS, and it also works over HTTPS, while Apache does not. Output of curl -k -I https://localhost/cgi-bin/vpn.py in lighthttpd server: HTTP/1.1 200 OK Content type: text/html Content-Length: 331 Date: Thu, 01 Jun 2017 09:03:26 GMT Server: lighttpd/1.4.45 Output of curl -k -I https://localhost/cgi-bin/vpn.py in Apache server: HTTP/1.1 200 OK Date: Thu, 01 Jun 2017 09:05:25 GMT Server: Apache Vary: Accept-Encoding X-Frame-Options: sameorigin Content-Type: text/html; charset=UTF-8 Furthermore, in Apache too: $curl -k -I https://localhost/download/xxx.mobileconfig HTTP/1.1 200 OK Date: Thu, 01 Jun 2017 09:13:35 GMT Server: Apache Last-Modified: Thu, 01 Jun 2017 03:08:57 GMT ETag: "1f3b-550dd5b89d8df" Accept-Ranges: bytes Content-Length: 7995 X-Frame-Options: sameorigin Content-Disposition: attachment Content-Type: application/x-apple-aspen-config Using Safari->Develop->Show web Inspector->Debugger->clicking on main page->Copy as curl only returns me "curl 'https://xxxx/cgi-bin/vpn.py ' -Xnull" when pasting. I also tried disabling X-Frame-Options: "sameorigin" and it made no difference (I knew it was a long shot)
Rui F Ribeiro (57882 rep)
Jun 1, 2017, 02:41 AM • Last activity: Jun 19, 2017, 10:33 AM
0 votes
2 answers
5181 views
Hostapd and lighttpd - manually download?
Is there any alternative to command `apt-get install *name of package*` When I type the same command `apt-get install *name of package*` from which website that packages are downloaded? Is it possible to visit that site and download the zip folder? If I download hostapd and lighttpd using web browse...
Is there any alternative to command apt-get install *name of package* When I type the same command apt-get install *name of package* from which website that packages are downloaded? Is it possible to visit that site and download the zip folder? If I download hostapd and lighttpd using web browser how I can install them. Which websites should I use to download (there are many out there)?
user219258
Mar 9, 2017, 10:43 PM • Last activity: Mar 11, 2017, 01:41 AM
0 votes
1 answers
250 views
What Are The Advantages of Using A Dedicated Web Server?
To elaborate, what are the advantages of using a dedicated web server (i.e. lighttpd or nginx) and running programs (i.e. Swift / Python) as directed by the web server? Specifically, how does that compare to simply running a web framework (i.e. Perfect / Flask) and using its inbuilt routing?
To elaborate, what are the advantages of using a dedicated web server (i.e. lighttpd or nginx) and running programs (i.e. Swift / Python) as directed by the web server? Specifically, how does that compare to simply running a web framework (i.e. Perfect / Flask) and using its inbuilt routing?
Brandon Bradley (349 rep)
Aug 24, 2016, 11:56 PM • Last activity: Aug 25, 2016, 12:28 AM
1 votes
1 answers
96 views
Install wordpress package always require apache?
Debian's WordPress package depends on `apache|httpd`, lighttpd also provides httpd, but when I try to install WordPress, apt requires me to install apache2! What I should do? I want to use only lighttpd !
Debian's WordPress package depends on apache|httpd, lighttpd also provides httpd, but when I try to install WordPress, apt requires me to install apache2! What I should do? I want to use only lighttpd !
Frost Phantom (13 rep)
Jul 31, 2015, 03:47 AM • Last activity: Aug 3, 2016, 11:04 AM
Showing page 1 of 20 total questions