# Questions regarding Lighttpd

**URL:** <https://dietpi.com/forum/t/questions-regarding-lighttpd/265>\
**Category:** General Discussion\
**Created:** [18 February 2016 15:03 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265 "2016-02-18T15:03:07Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhkean1](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/bb73d2/32.png) [@rhkean1](https://dietpi.com/forum/u/rhkean1)\
**Post date:** [18 February 2016 15:03 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/1 "2016-02-18T15:03:07Z")

</div>

@Fourdee

Your write up on Lighttpd (here: [https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/48](https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/48) ) states, “Recommended for advanced users only” due to the incompatibility with the other web-based software that is included with your dietpi distro…

by incompatibility, I’m assuming that you just mean that you haven’t automated the other products to use the Lighttpd stack if selected. Is that correct?

Also, is there a quick list of which other apps will trigger a Webserver Stack to be installed?  
personally, I’m interested in whether LinuxDash, PhpSysInfo, or phpMyAdmin are coded to trigger a webstack install?

I’m also curious if phpMyAdmin works with MariaDB? It’s my understanding that MariaDB is supposed to be a drop-in replacement for MySql, but I haven’t experimented with it yet.  
  
  
P.S. I noticed that there isn’t a v109 posting in the Version History section.

thanks,  
rob

---

<div class="post-metadata">

**Author:** ![Zombievirus](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/eb8c5e/32.png) [@Zombievirus](https://dietpi.com/forum/u/Zombievirus)\
**Post date:** [18 February 2016 18:29 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/2 "2016-02-18T18:29:53Z")

</div>

Yup!

A few automated installations automatically install the LASP Stack.

In your Case:

LinuxDash installs LASP  
PHPSysInfo installs LASP  
phpMyAdmin doesn’t install any Stack but it requires MySQL to be preinstalled!

Maybe FourDee can do some Code Magic and instead of automatically installing LASP Stack, ask for what Stack should be installed while installing LinuxDash or PHPSysInfo or any other Package that automatically installs LASP Stack.

DietPiCam is the only piece of software where Apache or Nginx should be enforced…

---

<div class="post-metadata">

**Author:** ![rhkean1](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/bb73d2/32.png) [@rhkean1](https://dietpi.com/forum/u/rhkean1)\
**Post date:** [18 February 2016 21:28 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/3 "2016-02-18T21:28:32Z")

</div>

thanks for the info…

you just saved me a couple re-imaging reboots and/or code combing tonight… 😃

instead, I’ll test phpMyAdmin with MariaDB. I’ve got to test if MySql gets installed automatically when you select phpMyAdmin, or if it just fails. I should also do some googling to see if MariaDB truly is a drop-in replacement.

thanks

---

<div class="post-metadata">

**Author:** ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)\
**Post date:** [19 February 2016 16:51 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/4 "2016-02-19T16:51:03Z")

</div>

> [@rhkean@gmail.com](#):
>
> @Fourdee
> 
> Your write up on Lighttpd (here: [https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/48](https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/48) ) states, “Recommended for advanced users only” due to the incompatibility with the other web-based software that is included with your dietpi distro…
> 
> by incompatibility, I’m assuming that you just mean that you haven’t automated the other products to use the Lighttpd stack if selected. Is that correct?
> 
> Also, is there a quick list of which other apps will trigger a Webserver Stack to be installed?  
> personally, I’m interested in whether LinuxDash, PhpSysInfo, or phpMyAdmin are coded to trigger a webstack install?
> 
> I’m also curious if phpMyAdmin works with MariaDB? It’s my understanding that MariaDB is supposed to be a drop-in replacement for MySql, but I haven’t experimented with it yet.  
>   
>   
> P.S. I noticed that there isn’t a v109 posting in the Version History section.  
>   
>   
> thanks,  
> rob

Hi Rob,

Any software that requires a webserver will automatically have LASP installed. If the software also requires MySql, then LAMP is installed.

The current list of programs that will install LAMP/LASP are location here: [DietPi/dietpi/dietpi-software at master · Fourdee/DietPi · GitHub](https://github.com/Fourdee/DietPi/blob/master/dietpi/dietpi-software#L484-L512)

Having an option to choose between apache2/nginx/lighttpd stacks for the above software would be great. The only issue is the sheer amount of additional testing and coding for each program using all combinations of the stacks. Its a vast job.

We choose to stick with apache2 for simplicity reasons. Not just for the coding side, but also for the end user. An example of this is LetsEncrpt, which at the time of adding to DietPi only supported Apache2 stacks.  
Also, most web based software tutorials and guide use Apache2 as the base, so this ensures the end user of DietPi (no matter their skill level) can follow the guide on their existing LAMP/LASP install.

The Lighttpd and Nginx stacks are there for advanced users who want an optimized installation and webserver stack. The user is then required to setup their website programs manually.

ps. Good spot on the release notes. Added to my “list of things to do”🙂

pps. MariaDB with phpymadmin. In theory it should work, both work in the same way, but i’ve not tried it yet.

---

<div class="post-metadata">

**Author:** ![rhkean1](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/bb73d2/32.png) [@rhkean1](https://dietpi.com/forum/u/rhkean1)\
**Post date:** [19 February 2016 19:48 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/5 "2016-02-19T19:48:11Z")

</div>

Fourdee,  
Thanks. that link was exactly what I needed. 🙂  
  
  
UPDATE:  
on the Lighttpd/MariaDB/phpMyAdmin topic…  
the short answer is yes… On my test Pi2, I’ve got Lighttpd, MariaDB and phpMyAdmin working together. There was a long of trial and error and “undoing that attempt” situations… so I’ve got to rebuild the machine again tonight and try again to see if I can accomplish the goal in 1 swoop that is automatable…

-rob

---

<div class="post-metadata">

**Author:** ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)\
**Post date:** [19 February 2016 20:01 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/6 "2016-02-19T20:01:35Z")

</div>

> [@rhkean@gmail.com](#):
>
> Fourdee,  
> Thanks. that link was exactly what I needed. 🙂  
>   
>   
> UPDATE:  
> on the Lighttpd/MariaDB/phpMyAdmin topic…  
> the short answer is yes… On my test Pi2, I’ve got Lighttpd, MariaDB and phpMyAdmin working together. There was a long of trial and error and “undoing that attempt” situations… so I’ve got to rebuild the machine again tonight and try again to see if I can accomplish the goal in 1 swoop that is automatable…
> 
> -rob

Excellent.

You can create a backup (system restore point) on your DietPi system. This will allow you to revert the root filesystem back to a previous state.

> [@(resolved) Cannot log in to the MySQL server](https://dietpi.com/forum/t/resolved-cannot-log-in-to-the-mysql-server/41/1):
>
> Hello, I’m continuing experimenting and just installed LAMP. I had previously changed HostName and Password and when trying to log into phpmyadmin interface I cannot access with root and either of the two passwords: raspberry the default one and the new one I set up. Is there a short way to solve this? I’m starting googling around… Many thanks for any hint you might give me, Virgus

```plaintext
dietpi-backup

```

As an example:  
When I do a fresh DietPi install for testing, once the basic installation process is completed (eg: nothing installed), I create a dietpi-backup before doing anything else.  
Once I’ve finished “fiddling” and testing, i simply restore the previous backup. Means I dont need to rewrite the DietPi image 🙂

---

<div class="post-metadata">

**Author:** ![rhkean1](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/bb73d2/32.png) [@rhkean1](https://dietpi.com/forum/u/rhkean1)\
**Post date:** [19 February 2016 21:10 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/7 "2016-02-19T21:10:13Z")

</div>

> [@Fourdee](#):
>
> You can create a backup (system restore point) on your DietPi system. This will allow you to revert the root filesystem back to a previous state.
> 
> [(resolved) Cannot log in to the MySQL server](https://dietpi.com/forum/t/resolved-cannot-log-in-to-the-mysql-server/41/1)
> 
> ```plaintext
> dietpi-backup
> 
> ```
> 
> As an example:  
> When I do a fresh DietPi install for testing, once the basic installation process is completed (eg: nothing installed), I create a dietpi-backup before doing anything else.  
> Once I’ve finished “fiddling” and testing, i simply restore the previous backup. Means I dont need to rewrite the DietPi image 🙂

NICE! I’ll read up on that.

Also… regarding Linux-Dash… I installed it manually the same way it’s coded in dietpi-software ([DietPi/dietpi/dietpi-software at master · Fourdee/DietPi · GitHub](https://github.com/Fourdee/DietPi/blob/master/dietpi/dietpi-software#L1087-L1108))…  
works perfectly.

UPDATE… same with phpSysInfo

---

<div class="post-metadata">

**Author:** ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)\
**Post date:** [19 February 2016 22:04 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/8 "2016-02-19T22:04:13Z")

</div>

> [@rhkean@gmail.com](#):
>
> Also… regarding Linux-Dash… I installed it manually the same way it’s coded in dietpi-software ([DietPi/dietpi/dietpi-software at master · Fourdee/DietPi · GitHub](https://github.com/Fourdee/DietPi/blob/master/dietpi/dietpi-software#L1087-L1108))…  
> works perfectly.
> 
> UPDATE… same with phpSysInfo

Awesome.

Come to think of it, it’s only the web software that we install with apt-get that would be an issue for non-apache webstacks.  
I know Owncloud is an apt-get (using opensuse repo), but I’ll have to look over the code for all of them to be sure.

---

<div class="post-metadata">

**Author:** ![rhkean1](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/bb73d2/32.png) [@rhkean1](https://dietpi.com/forum/u/rhkean1)\
**Post date:** [22 February 2016 02:43 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/9 "2016-02-22T02:43:28Z")

</div>

here’s the patch for getting phpMyAdmin to work properly with Lighttpd and MySql or MariaDB…  
basically 1 line to change on the debconf-set-selections and tweak the cgi.fix\_pathinfo line of the php.ini

I’ve tested on my Pi2, but haven’t had a chance to steal the XU4 from the family yet…

```nohighlight
--- dietpi/v109/dietpi-software 2016-02-21 21:30:25.637372620 -0500
+++ dietpi/v110/dietpi-software 2016-02-21 21:31:56.742372631 -0500
@@ -755,7 +755,11 @@
                        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
+ echo -e "phpmyadmin phpmyadmin/reconfigure-webserver multiselect lighttpd" | debconf-set-selections
+ else
+ echo -e "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | debconf-set-selections
+ fi
 
                        AGI phpmyadmin
 
@@ -2591,6 +2595,9 @@
                        if (( $WEBSERVER_NGINX == 2 )); then
                                ln -s /usr/share/phpmyadmin /var/www
                        fi
+ if (( $WEBSERVER_LIGHTTPD == 2 )); then
+ sed -i 's|\(^cgi.fix_pathinfo=\)0|\11|' /etc/php5/fpm/php.ini
+ fi
 
                        WEBSERVER_MYADMINPHP=2
                fi

```

also, I’m sure the " if (( WEBSERVER\_LIGHTTPD \> 0 )); then" should be =1 or =2, but I wasn’t sure…

---

<div class="post-metadata">

**Author:** ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)\
**Post date:** [22 February 2016 13:21 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/10 "2016-02-22T13:21:18Z")

</div>

> I’ve tested on my Pi2, but haven’t had a chance to steal the XU4 from the family yet…

This is a perfect chance to play the “I think we need another XU4” card 😉 Then explain everything possible the device can do. Works on my misses every time lol 🙂

> here’s the patch for getting phpMyAdmin to work properly with Lighttpd and MySql or MariaDB…

Nice one!

The values are:  
0 = Not installed  
1 = Selected for install  
2 = Installed

The PHPmyadmin config section runs after lighttpd has finished installation, at which stage WEBSERVER\_LIGHTTPD=2. So any of the following would work:

```plaintext
if (( $WEBSERVER_LIGHTTPD > 0 )); then
if (( $WEBSERVER_LIGHTTPD == 2 )); then

```

My XU4 is also busy doing other stuff. I cant see any issues cropping up on a device basis, but its worth a test.

---

<div class="post-metadata">

**Author:** ![rhkean1](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/bb73d2/32.png) [@rhkean1](https://dietpi.com/forum/u/rhkean1)\
**Post date:** [23 February 2016 14:53 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/11 "2016-02-23T14:53:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rhkean1](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/bb73d2/32.png) [@rhkean1](https://dietpi.com/forum/u/rhkean1)\
**Post date:** [23 February 2016 19:55 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/12 "2016-02-23T19:55:02Z")

</div>

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/i386/apbs03.html.en](https://www.debian.org/releases/squeeze/i386/apbs03.html.en), there should only be 1 whitespace beteen and … any more and it is interpreted as part of the value. so, that’s fixed with this patch, as well.

```nohighlight
--- 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
+ echo -e "phpmyadmin phpmyadmin/reconfigure-webserver multiselect lighttpd" | debconf-set-selections
+ else
+ echo -e "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | debconf-set-selections
+ fi

                        AGI phpmyadmin

@@ -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

```

---

<div class="post-metadata">

**Author:** ![rhkean1](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/bb73d2/32.png) [@rhkean1](https://dietpi.com/forum/u/rhkean1)\
**Post date:** [23 February 2016 20:01 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/13 "2016-02-23T20:01:34Z")

</div>

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](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)

```nohighlight
security.limit_extensions = .php .php3 .php4 .php5

```

---

<div class="post-metadata">

**Author:** ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)\
**Post date:** [23 February 2016 20:53 UTC](https://dietpi.com/forum/t/questions-regarding-lighttpd/265/14 "2016-02-23T20:53:46Z")

</div>

> [@rhkean@gmail.com](#):
>
> pretty sure that I found a good explanation (in the form of a question) of why you were setting cg.fix\_pathinfo=0  
> here: [security - Is the PHP option 'cgi.fix\_pathinfo' really dangerous with Nginx + PHP-FPM? - Server Fault](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)
> 
> ```plaintext
> 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 and … 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:

 ![Untitled.png](https://dietpi.com/forum/uploads/default/original/1X/2659a5483431b9a06f5ac049b7226c43f28e35e1.png)  
I’ve created a git ticket for the feature of allowing webserver stack choices: [https://github.com/Fourdee/DietPi/issues/205](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.
