claudehohl / Stikked

An advanced and beautiful pastebin written in PHP
991 stars 219 forks source link

404 Not found - lighttpd #486

Closed p4inki77er closed 6 years ago

p4inki77er commented 6 years ago

Hello,

unfortunately I am not able to get the application to work. I can only see the startpage, when i click on create it says 404 not Found How can I fix that issue?

/etc/lighttpd/10-skitted.conf

server.modules += ( "mod_fastcgi" )
server.modules += ( "mod_rewrite" )

fastcgi.server += ( ".php" =>
    ((
       "host" => "127.0.0.1",
       "port" => "9000",
        "broken-scriptfilename" => "enable"
    ))
)

$HTTP["host"] == "sub.domain.tld" {
    url.rewrite-once = (
        "^/static/(.*)$" => "/static/$1",
        "^/favicon\.ico$" => "/favicon.ico",
        "^/robots\.txt$" => "/robots.txt",
        "^/(.*)$" => "/index.php$2",
    )

    server.document-root = "/var/www/stikked/htdocs"

    #accesslog.filename = "/var/log/lighttpd/stikked.access.log"
}

php -v

PHP 5.6.33-0+deb8u1 (cli) (built: Jan  5 2018 15:46:26)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

service php5-fpm status

php5-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php5-fpm.service; enabled)
   Active: active (running) since Sa 2018-03-24 21:19:52 CET; 2h 33min ago
  Process: 16703 ExecStartPre=/usr/lib/php5/php5-fpm-checkconf (code=exited, status=0/SUCCESS)
 Main PID: 16708 (php5-fpm)
   Status: "Processes active: 0, idle: 2, Requests: 51, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/php5-fpm.service
           ├─16708 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
           ├─16713 php-fpm: pool www
           └─16714 php-fpm: pool www

Mär 24 21:19:52 v22016123028341394 systemd[1]: Started The PHP FastCGI Process Manager.

/etc/lighttpd/lighttpd.conf

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

server.document-root        = "/var/www/html"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/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          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

fastcgi.server = ( ".php" => ((
                     "bin-path" => "/usr/bin/php5-cgi",
                     "socket" => "/tmp/php.socket"
)))

# 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"

files

gstrauss commented 6 years ago

Try adding the `"check-local" => "disable" parameter:

fastcgi.server += ( ".php" =>
    ((
        "host" => "127.0.0.1",
        "port" => "9000",
        "broken-scriptfilename" => "enable",
        "check-local" => "disable"
    ))
)

Also, the name of the web server is "lighttpd"

p4inki77er commented 6 years ago

Thank you very much for your response.

I changed my /etc/lighttpd/conf-available/10-stikked.conf to

server.modules += ( "mod_fastcgi" )
server.modules += ( "mod_rewrite" )

fastcgi.server += ( ".php" =>
    ((
       "host" => "127.0.0.1",
       "port" => "9000",
       "broken-scriptfilename" => "enable",
       "check-local" => "disable"
 ))
)

$HTTP["host"] == "http://sub.domain.tld/" {
    url.rewrite-once = (
        "^/static/(.*)$" => "/static/$1",
        "^/favicon\.ico$" => "/favicon.ico",
        "^/robots\.txt$" => "/robots.txt",
        "^/(.*)$" => "/index.php$2",
    )

    server.document-root = "/var/www/stikked/htdocs"

    #accesslog.filename = "/var/log/lighttpd/stikked.access.log"
}

However I still get the same 404 error, when I try to create a new paste or click on "about" in the navbar.

The-Compiler commented 6 years ago

FWIW here's what I do:

$HTTP["host"] == "paste.the-compiler.org" {
    server.indexfiles = ( "index.php" )
    url.rewrite-once     = (
            "^/view/captcha/(.*)$" => "index.php/view/captcha/$1",
            "^/view(.*)$" => "index.php/view/$1",
            "^/lists(.*)$" => "index.php/lists/$1",
            "^/about$" => "index.php/about",
            "^/api(.*)$" => "index.php/api$1",
            "^/spamadmin(.*)$" => "index.php/spamadmin$1",
            "^/trends" => "index.php/trends",
            "^/post_encrypted(.*)$" => "index.php/post_encrypted$1",
            "^/main(.*)$" => "index.php/main$1",
            "^/cron(.*)$" => "index.php/cron$1"
    )
    server.document-root = "/usr/share/webapps/Stikked/"
    setenv.add-environment = ( "CI_ENV" => "production" )
}
p4inki77er commented 6 years ago

Thank you very much. Now it works ;)