dimanche 24 avril 2016

Lighttpd - Put www folder in usb external flash drive

I have a raspberry pi with raspbian jessie lite and lighttpd, php, mysql all running fine. The www folder is in /var/www/html. I want to use a folder on my usb flash drive (/mnt/usbstorage/share/www). The drive is mounted, visible and accessible through samba access. The share folder and subfolders have read, write, execute access for all. i opened the "/etc/lighttpd/lighttpd.conf" and pointed the public folder to the desired location as such:

server.modules = (
    "mod_access",
    "mod_alias",
    "mod_compress",
    "mod_redirect",
  # "mod_rewrite",
)

server.document-root        = "/mnt/usbstorage/share/www"
server.upload-dirs          = "/mnt/usbstorage/share/uploads"
server.errorlog             = "/mnt/usbstorage/share/logs/lighttpd-error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80


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

compress.cache-dir          = "/mnt/usbstorage/share/lighttpd-cache"
compress.filetype           = ( "application/javascript", "text/css", "text/htm$

# 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.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

The server no longer works.

lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled)
Active: failed (Result: exit-code) since Sun 2016-04-24 12:07:01 UTC; 4min 31s ago
Process: 12125 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
Process: 12456 ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
Main PID: 12125 (code=exited, status=255)

Apr 24 12:07:01 raspberrypi lighttpd[12456]: 2016-04-24 12:07:00: (configfil...)
Apr 24 12:07:01 raspberrypi systemd[1]: lighttpd.service: control process ex...5
Apr 24 12:07:01 raspberrypi systemd[1]: Failed to start Lighttpd Daemon.
Apr 24 12:07:01 raspberrypi systemd[1]: Unit lighttpd.service entered failed....
Hint: Some lines were ellipsized, use -l to show in full.

My question is What is what did i do wrong? What is the proper way to point to a public folder in lighttpd?




Aucun commentaire:

Enregistrer un commentaire