## Questions regarding Lighttpd

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
rhkean@gmail.com

### Re: Questions regarding Lighttpd

I tried to patch dietpi-software last night, but it looks like I over simplified the logic or attempted too many changes at once... because it applied the LASP stack on the next reboot...

I'll try again tonight.
rhkean@gmail.com

### Re: Questions regarding Lighttpd

argh... found my oversight.... now I can't wait to get home to verify.... I'd have my wife swap out the cards, but she's not home... ACK!

I'm pretty certain that all of these "default to LASP" packages can be added to the new if-block, but I have only tested DASH and PHPSYSINFO.

I found a PHP-FPM section further down in the code that was setting the cgi.fix_pathinfo=0, but this breaks phpMyAdmin. I couldn't find any documentation to suggest why you set it to 0, so rather than add a specific WEBSERVER_LIGHTTPD test inside the WEBSERVER_MYADMINPHP block, i just set the original line equal to 1...

also, I found a potential bug in a couple of the debconf-set-selections lines of the phpMyAdmin install... per this doc: https://www.debian.org/releases/squeeze ... 03.html.en, there should only be 1 whitespace beteen <question type> and <value>... any more and it is interpreted as part of the value. so, that's fixed with this patch, as well.

Code: Select all

--- dietpi/v109/dietpi-software 2016-02-23 13:48:59.470237319 -0500
+++ dietpi/v110/dietpi-software 2016-02-23 14:07:16.800237450 -0500
@@ -481,6 +481,16 @@
#--------------------------------------------------------------
# Apply all "combo" installs that require webserver stack

+               # - Installs that require at least 1 webserver stack
+               # -   If none set, then enable LASP stack
+               if (( $LINUXDASH == 1 ||$PHPSYSINFO == 1 )); then
+                       if (( $WEBSERVER_LASP == 0 &&$WEBSERVER_LAMP == 0 && $WEBSERVER_LAAP == 0 && \ +$WEBSERVER_LESP == 0 && $WEBSERVER_LEMP == 0 &&$WEBSERVER_LEAP == 0 &&     \
+                             $WEBSERVER_LLSP == 0 &&$WEBSERVER_LLMP == 0 && $WEBSERVER_LLAP == 0 )); then + WEBSERVER_LASP=1 + fi + fi + # - Installs that require WEBSERVER_LASP if (($GRASSHOPPER == 1 )); then
WEBSERVER_LASP=1
@@ -488,12 +498,12 @@
WEBSERVER_LASP=1
elif (( $RASPCONTROL == 1 )); then WEBSERVER_LASP=1 - elif (($LINUXDASH == 1 )); then
-                       WEBSERVER_LASP=1
+#              elif (( $LINUXDASH == 1 )); then +# WEBSERVER_LASP=1 elif (($PIHOLE == 1 )); then
WEBSERVER_LASP=1
-               elif (( $PHPSYSINFO == 1 )); then - WEBSERVER_LASP=1 +# elif (($PHPSYSINFO == 1 )); then
+#                      WEBSERVER_LASP=1
elif (( $PHPIMAGEGALLERY == 1 )); then WEBSERVER_LASP=1 fi @@ -748,14 +758,18 @@ #Mysql must be running during install to allow debconf setup. service mysql start &> /dev/null - echo -e "phpmyadmin phpmyadmin/dbconfig-install boolean true" | debconf-set-selections - echo -e "phpmyadmin phpmyadmin/database-type select mysql" | debconf-set-selections + echo -e "phpmyadmin phpmyadmin/dbconfig-install boolean true" | debconf-set-selections + echo -e "phpmyadmin phpmyadmin/database-type select mysql" | debconf-set-selections echo -e "phpmyadmin phpmyadmin/app-password-confirm password dietpi" | debconf-set-selections echo -e "phpmyadmin phpmyadmin/mysql/admin-pass password dietpi" | debconf-set-selections echo -e "phpmyadmin phpmyadmin/password-confirm password dietpi" | debconf-set-selections echo -e "phpmyadmin phpmyadmin/setup-password password dietpi" | debconf-set-selections echo -e "phpmyadmin phpmyadmin/mysql/app-pass password dietpi" | debconf-set-selections - echo -e "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | debconf-set-selections + if (($WEBSERVER_LIGHTTPD > 0 )); then
+                       else
+                       fi

@@ -2478,7 +2492,7 @@
# - Php-FPM confs
cp /DietPi/dietpi/conf/php-fpm.conf /etc/php5/fpm/php-fpm.conf
cp /DietPi/dietpi/conf/php-fpm_pool.conf /etc/php5/fpm/pool.d/www.conf
-                               sed -i '/cgi.fix_pathinfo=/c\cgi.fix_pathinfo=0' /etc/php5/fpm/php.ini
+                               sed -i '/cgi.fix_pathinfo=/c\cgi.fix_pathinfo=1' /etc/php5/fpm/php.ini

# - PHP5-fpm optimizations based on total cores
sed -i "/pm.max_children = /c\pm.max_children = \$CPU_CORES_TOTAL" /etc/php5/fpm/pool.d/www.conf
rhkean@gmail.com

### Re: Questions regarding Lighttpd

pretty sure that I found a good explanation (in the form of a question) of why you were setting cg.fix_pathinfo=0
here: http://serverfault.com/a/701500

But that explanation also explains how it's not needed as of php5-fpm 5.3....
(I verified that 5.6.17 sets the security.limit_extensions by default)

Code: Select all

security.limit_extensions = .php .php3 .php4 .php5
Fourdee
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

### Re: Questions regarding Lighttpd

rhkean@gmail.com wrote:pretty sure that I found a good explanation (in the form of a question) of why you were setting cg.fix_pathinfo=0
here: http://serverfault.com/a/701500

But that explanation also explains how it's not needed as of php5-fpm 5.3....
(I verified that 5.6.17 sets the security.limit_extensions by default)

Code: Select all

security.limit_extensions = .php .php3 .php4 .php5
I cant honestly remember. I usually leave notes in the code, so its possible its not needed as you said.

Have you ever used GitHub before? I'am just curious as this would allow you to contribute to the DietPi code and it would give you full credit for any work you completed.
Here is the testing branch, you can create a fork of this, make the changes then send a pull request so I can accept the changes.
there should only be 1 whitespace beteen <question type> and <value>... any more and it is interpreted as part of the value
Intresting. Seems to work currently, which would imply this isnt true? The extra whitespaces are only for my benefit to line up the code:
I've created a git ticket for the feature of allowing webserver stack choices: https://github.com/Fourdee/DietPi/issues/205
We should really take discussions to the Git ticket so everything can be tracked whilst working on it.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.