15

What you need is CGI support for lighthttpd. Open the lighttpd configuration file (/etc/lighttpd/lighttpd.conf), and uncomment the "mod_cgi" line (remove the # from the beginning of the line if one exists) or add this line if not present. server.modules = ( "mod_access", "mod_alias", "mod_accesslog", "...


6

The error you see is because you don't have a www-data user and group, but lighttpd expects to find one. So first, add a www-data user and group: sudo adduser --system --group www-data Then you can install lighttpd sudo apt-get install lighttpd And that's it. Browse to your Pi's IP address (or localhost on your Pi itself), and you'll be greeted with... ...


6

After following the advice from okertanov, I discovered that you can't actually use RPi.GPIO in a python CGI script as it requires root access. I worked around the problem by calling out to the gpio command line app which is included as part of WiringPi, this can be called from a non-root account. # Read the GPIO pin using the gpio application import ...


6

You may try to add before 'import RPi.GPIO': import sys sys.stderr = sys.stdout try: import RPi.GPIO as GPIO except Exception as e: print e It may help to diagnose an error. And add these lines before your html output: print "Content-Type: text/html" # HTML is following print # blank line, end of headers See ...


5

This should be a comment, but its a bit long. While I've not (yet) tested out various webservers on my Pi, I have previously run a lot of testing on webservers running on x86 server hardware. What I know from there is: most people get confused about the difference between performance and capacity - you'll see lots of posts claiming nginx is faster than (...


4

This works for me <?php system("hostname -I"); ?>


3

I think the 'bin-path' variable has been abused; from the docs of lighttpd : "bin-path": path to the local FastCGI binary. So it should be that, not the .py script. This configuration hard-binds any .py script to doStuff.py, as you have noticed. However, I'm not sure there is a fastcgi python interface, in contrast to PHP. You may have to list your ...


3

I have the same problem on my side (I use nginx), and i found a clue to understand the issue: In fact /var/log/ is not a real folder but a symbolic link, as can be seen with ls -all: pi@raspbmc:~$ ls -all /var total 44 drwxr-xr-x 11 root root 4096 Jun 2 20:12 . drwxr-xr-x 24 root root 4096 Jun 2 20:09 .. [...] lrwxrwxrwx 1 root root ...


2

The accepted answer did not work for me and it also ignores the pre-configured packages that are available for Lighttpd. The correct way to install Python on Lighttpd for the Raspberry is: First enable cgi by sudo lighttpd-enable-mod cgi This creates a new configuration file for Lighttpd: /etc/lighttpd/conf-enabled/10-cgi.conf Edit the configuration ...


2

If you add "persistent-logs" to cmdline.txt then the /tmp and /var directories will be persistent


2

Your bin path should only be "/var/www/" or whatever directory you like and you have rights to read/write. To not only run the same script again, you could make an "index.html" which contains different forms/buttons and calls different scripts when you click them. For example: <form action = "firstScript.py" methode = "GET" > <input type = "...


2

After uninstalling lighttpd and installing it again the problem has been solved. But I still don't know why!?


2

The problem is not that you've got a dynamic IP but NAT . You need to use reverse SSH tunneling , OpenVPN in client mode or some SaaS service like Weaved , yaler or ngrok.


2

I fear you need to find out by your own. When i had this question for my RPi2, I stumbled over Siege and httperf. I followed this example to run the benchmarks - just instead of plain html pages i requested php files. There performance of the web server is also depending on the cgi modules you will choose. A plain vanilla lighttpd may be faster than a ...


2

This is a futile endeavour. The System requirements for Document Server include: CPU: dual core 2 GHz or better → while Raspberry Pi 2 & 3 have quad-core processors, they're ~ 1 GHz ARM quad core. Server spec software usually assumes Intel power per core RAM: 2 GB or more → the most RAM that a Raspberry Pi supports is 1 GB OS: 64-bit Debian, Ubuntu or ...


2

I have chosen the lighttpd option, for the following reasons: lightweight one of the easiest to install runs on my RPi2 for the last two years without any problems (24x7) needed a good and simple to use as my test device I use it as: monitor my system cpu temperature, ambient/room temperature and Humidity graph logger FTP server to exchange files with my ...


2

Since you are looking for a way to control your robot remotely via a browser, one framework to look at is node.js. Node.js is a java-script runtime environment that allows you to run java-script code both on browser and server side. There are excellent tutorials from w3schools on how to control/read the GPIO-pins of the Raspberry Pi via node.js.


1

lighttpd is in the repository - although I have never used it. If you search this site for tag [lighttpd} you will find other posts. I use NGINX which has an official tutorial.


1

You need indicate where actually the "cgi-bin" path is, by adding the line below: alias.url += ( "/cgi-bin" => "/usr/www/cgi-bin/" ) Don't forget make .cgi file executable. Then access your cgi by host/cgi-bin/xxx.cgi.


1

Key Authentication and Downgrade You have two concerning error messages: WARNING: The following packages cannot be authenticated! and Preparing to unpack .../mysql-server-5.5_5.5.52-0+deb8u1_armhf.deb ... Aborting downgrade from (at least) 10.0 to 5.5. If are sure you want to downgrade to 5.5, remove the file /var/lib/mysql/debian-*.flag and try ...


1

On the second line of your lighttpd fastcgi configuration: ".py => (" change to: "doStuff.py => (" I had the same problem then remembered this post afterwards. Making the above changed solved the issue for me. Reason: I believe the ".py" directive tells lighttpd to map all python executables to your "doStuff.py". By being more specific i.e. replacing ...


1

I think there should be only one IP address for what I want to do with the connection That's not how mobile networking works. You cannot have a static stable IP for incoming connections. This is not the same as your provider actively preventing anything, it is simply a limitation of the context. The fact that the unit is not truly "mobile" doesn't make ...


1

I solved it using this: I was not aware that Jessie does not require root to access GPIO. So I upgraded to Raspbian Jessie following the steps on this guide: https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=121880 And then I fixed GPIO permissions using this answer: Access GPIO pins without root. No access to /dev/mem. Try running as root! ...


1

You need to change the router admin interface port from 80 to something else. Given that your router is running a custom firmware specific to your ISP, that may not be possible. The proper thing to do in that scenario would be to host your Raspberry Pi in a DMZ and configure the Pi's firewall to block incoming traffic from external IP addresses on all ports ...


1

This is not a Pi problem this is a router problem. If the connection is going to the router page and not the Pi, then Pi is not involved. Factory reset is all else fails, I have had some very flaky routers in the past that worked until you tried to do anything out of the ordinary with them. Changed static ip address mapping, setting sometimes stuck ...


1

You also need to check the permissions of the directory /var/www/test to see if that is accessible for everyone: ls -l /var/www If test is owned by pi or root, the server won't be able to access the files inside it. By default lighthttpd runs as user www-data, and can't access pi's files. You could use this command to change everything in /var/www to ...


1

I achieve to do this by creating a dummy file on the folder, and making the php check if that file exists. 1.- My website has a time interval to check it ever $(document).ready(function() { setInterval(checkRefresh, 10000); }); function checkRefresh() { $.ajax({ url: "checkrefresh.php" }).done(function (response) { ...


1

I used a mix with PHP and jQuery Ajax now. I write a parameter into a Databas, if its "0", nothing will happen, if it is "1" the page relaods. var times = 0; var refreshId = window.setInterval(function(){ // check refresh! $.ajax({ type : "GET", url : "check.php", cache : false, success: function(data){ ...


1

Alternatively, without making www-data a sudoer, you can look into some gpiod software that allow you to drive GPIO pins through a socket, without root privileges.


1

Edit your /etc/sudoers sudo nano /etc/sudoers add: www-data ALL=(ALL) NOPASSWD: ALL


Only top voted, non community-wiki answers of a minimum length are eligible