User Tools

Site Tools


operating_systems:raspbian:easydoor_configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
operating_systems:raspbian:easydoor_configuration [2019/07/11 09:35] – [Lighttpd setup] maferreiraoperating_systems:raspbian:easydoor_configuration [2019/07/16 12:34] – [Lighttpd setup] maferreira
Line 35: Line 35:
   # mkdir /media/data/root   # mkdir /media/data/root
   # touch /media/data/root/.Xauthority   # touch /media/data/root/.Xauthority
 +  # ln -s /media/data/root/.Xauthority /root/.Xauthority
   # chmod 600 /media/data/root/.Xauthority   # chmod 600 /media/data/root/.Xauthority
  
Line 187: Line 188:
 === PHP installation === === PHP installation ===
 First, you need to install PHP-FPM, which is a process manager for PHP. First, you need to install PHP-FPM, which is a process manager for PHP.
-  # apt install --no-install-recommends php7.0-fpm+  # apt install --no-install-recommends php7.0-fpm php7.0-mbstring 
 + 
 +<note warning> 
 +php7.0-mbstring is required because we use gettext to translate our website. If it is not installed, you will get a php fatal error. 
 +</note>
  
 Then, enable it the typing the following: Then, enable it the typing the following:
   # lighttpd-enable-mod fastcgi   # lighttpd-enable-mod fastcgi
   # lighttpd-enable-mod fastcgi-php   # lighttpd-enable-mod fastcgi-php
 +
 +<note tip>
 +We could edit the **php.ini** and **lighttpd.conf** files but it's cleaner using **lighttpd-enable-mod** We could edit the php.ini and lighttpd.conf files but it's cleaner using lighttpd-enable-mod command since it only enables the 2 config files that load fastgi, hence not modifying the webserver config file. 
 +</note>
  
 Now before we can go reloading Lighttpd, we will have to make changes to its configuration. By default, it is configured to work with PHP-CGI and not PHP-FPM, luckily it is easy to make these changes. Now before we can go reloading Lighttpd, we will have to make changes to its configuration. By default, it is configured to work with PHP-CGI and not PHP-FPM, luckily it is easy to make these changes.
Line 227: Line 236:
  
   $HTTP["host"] == "easydoor" { #FDQN   $HTTP["host"] == "easydoor" { #FDQN
-  server.document-root = "/home/acdsn/git/easydoor-scripts/minicentral/intercom/www/html"+  server.document-root = "/home/acdsn/git/easydoor-scripts/minicentral/intercom/www/html"
   }   }
 +
 +<note important>
 +server.errorlog is not set here because lighttpd only supports one error log file for the server
 +(it does not support a error log file for each virtual host)
 +</note>
  
 Enable the virtual host you have just created by creatign a symlink to /etc/lighttpd/conf-enabled. Enable the virtual host you have just created by creatign a symlink to /etc/lighttpd/conf-enabled.
Line 237: Line 251:
  
   127.0.0.1 easydoor   127.0.0.1 easydoor
 +
 +<note tip>
 +If you want to have access logs, you need to enable the accesslog mod. To do that, use the same command we used to enable the fastgci modules.
 +</note>
 +
 +  # lighttpd-enable-mod accesslog
 +
 +Now, set the access log file location in your **/etc/lighttpd/conf-enabled/easydoor.conf**. It should look like this:
 +  $HTTP["host"] == "easydoor" { #FDQN
 +  server.document-root    = "/home/acdsn/git/easydoor-scripts/minicentral/intercom/www/html"
 +  accesslog.filename      = "/var/log/lighttpd/easydoor-access.log"
 +  }
 +
 +Restart **lighttpd** and see if there are any errors.
  
 <note warning> <note warning>
Line 245: Line 273:
   d /var/log/lighttpd 0750 www-data www-data   d /var/log/lighttpd 0750 www-data www-data
  
-References:\\ +=== References === 
-[[https://pimylifeup.com/raspberry-pi-lighttpd/]]\\ +Install lighttp and enable PHP - [[https://pimylifeup.com/raspberry-pi-lighttpd/]]\\ 
-[[https://www.itzgeek.com/how-tos/linux/how-to-setup-virtual-hosts-in-lighttpd-server.html]]\\ +Enable PHP on lighttpd - [[https://redmine.lighttpd.net/projects/lighttpd/wiki/TutorialLighttpdAndPHP#Configuration]]\\ 
-[[https://discourse.pi-hole.net/t/lighttpd-not-starting/15565/12]]\\+Setup virtual hosts - [[https://www.itzgeek.com/how-tos/linux/how-to-setup-virtual-hosts-in-lighttpd-server.html]]\\ 
 +Virtual host log file warning - [[https://redmine.lighttpd.net/boards/2/topics/8000?r=8003#message-8003]]\\ 
 +Accesslog module activation - [[https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModAccessLog]]\\ 
 +Lighttpd fails to create log files - [[https://discourse.pi-hole.net/t/lighttpd-not-starting/15565/12]]\\
  
 ===== Strike ===== ===== Strike =====