Jump to content
  • 0
Sign in to follow this  
SmartDuck

Lighttpd problems

Question

I don't know if this is an Bodhi issue or ubuntu. But I'm stuck... I'm trying to setup a lighttpd webserver with php and cgi or fastcgi. Tried a lot of things:

- reinstalled all packages lighttpd, php7.0, php7.0-fpm, php7.0-cgi, php7.0-cli, php7.0-gd

- check the rights on the dirs and files

- checked the owner of the files

etc...

Php script are executed only in the root dir, still keeping a 403 error on subfolders, looks like the module is never loaded for lighttpd....  lighttpd-enable-module only gives the message Ignoring unknown module: fastcgi-php

 

My lighttpd.config:

server.port = 80
server.modules = (
        "mod_access",
        "mod_accesslog",
        "mod_fastcgi"
)
server.document-root = "/var/www/html/"
server.errorlog   = "/var/log/lighttpd/error.log"
server.username = "www-data"
server.groupname = "www-data"
server.pid-file = "/var/run/lighttpd.pid"

accesslog.filename = "/var/log/lighttpd/access.log"

## Enable/Disable Directory Listings
dir-listing.encoding = "utf-8"
dir-listing.activate = "enable"
dir-listing.hide-dotfiles = "enable"

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi")

## Enable PHP and Python
fastcgi.server = ( ".php" => ((
	"bin-path" => "/usr/bin/php-cgi",
	"socket" => "/tmp/php.socket"
))) 

index-file.names = ( "index.php", "index.html" )

##  MimeType handling
## -------------------
##
## Use the "Content-Type" extended attribute to obtain mime type if
## possible
##
mimetype.use-xattr        = "disable" 

##
## mimetype mapping
##
mimetype.assign             = (
  ".pdf"          =>      "application/pdf",
  ".zip"          =>      "application/zip",
  ".mp3"          =>      "audio/mpeg",
  ".gif"          =>      "image/gif",
  ".jpg"          =>      "image/jpeg",
  ".jpeg"         =>      "image/jpeg",
  ".png"          =>      "image/png",
  ".css"          =>      "text/css",
  ".html"         =>      "text/html",
  ".htm"          =>      "text/html",
  ".js"           =>      "text/javascript",
  ".asc"          =>      "text/plain",
  ".c"            =>      "text/plain",
  ".cpp"          =>      "text/plain",
  ".log"          =>      "text/plain",
  ".conf"         =>      "text/plain",
  ".text"         =>      "text/plain",
  ".txt"          =>      "text/plain",
  ".dtd"          =>      "text/xml",
  ".xml"          =>      "text/xml",
  ".mpeg"         =>      "video/mpeg",
  ".mpg"          =>      "video/mpeg",
  ".mov"          =>      "video/quicktime",
  ".avi"          =>      "video/x-msvideo",
  ".wmv"          =>      "video/x-ms-wmv",
# make the default mime type application/octet-stream.
  ""              =>      "application/octet-stream",
)

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Thanks for the help.

I will go for the sample config and start from there to get the server working.

 

Solved it partly by setting the rights to 755 on the subfolders. The server is not public only for testing purposes.

Share this post


Link to post
Share on other sites
  • 0

IMNSHO it is not a distro problem, and I would work with the lighttpd devs, or get on their forums, if not their IRC channel.  Two possible leads here and here, The latter has been written by the fine folks at Arch. You might be able to fix that 403 Error (I'd omit the last comma after "octet-stream" but I doubt that that is the showstopper). Pay close attention to the arch wiki and some warnings that make more sense to folks well-versed in Python or httpd/web server setup; I am neither. Good luck.

 

An alternate approach would be to use the sample configuration provided in the first link, then start tweaking it to suit your specific project. Have one of us here access your website to see if it is operational and functional.

Share this post


Link to post
Share on other sites
  • 0

Have one of us here access your website to see if it is operational and functional.

Realistically, he could access the site from a phone, tablet, or computer connected via the cellular network, if he needed an external connection test.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×