inex / birdseye

A Simple Secure Micro Service for Querying Bird (JSON API)
MIT License
46 stars 21 forks source link

Ubuntu 16.04 to 20.04 upgrade path issues #12

Open Billynkid opened 4 years ago

Billynkid commented 4 years ago

We recently decided to upgrade our RS to Ubuntu 20.04. For the most part the upgrade was painless. Went from 16.04 to 18.04 then to 20.04.

The once issue we did discover and managed to resolve was with lighttpd. Post upgrade the server was throwing;

(mod_rewrite.c.282) mod_rewrite invalid result (not beginning with '/') while processing uri: /api/protocols/bgp 2020-08-23 00:12:34: (mod_rewrite.c.282) mod_rewrite invalid result (not beginning with '/') while processing uri: /api/protocols/bgp 2020-08-23 00:12:36: (mod_rewrite.c.282) mod_rewrite invalid result (not beginning with '/') while processing uri: /api/status 2020-08-23 00:13:36: (mod_rewrite.c.282) mod_rewrite invalid result (not beginning with '/') while processing uri: /api/status 2020-08-23 00:13:46: (mod_rewrite.c.282) mod_rewrite invalid result (not beginning with '/') while processing uri:

in the lighttpd error.log file.

I was able to find the following solution on stackoverflow https://stackoverflow.com/questions/3965651/lighttpd-configuration-dots-in-my-query-string-cause-404

copying the url.rewrite-once

url.rewrite-once = ( "^/(js|images|uploads|css|sf)/(.)" => "$0", # we want to load these assets as is, without index.php "^/[a-zA-Z_-]+.(html|txt|ico)$" => "$0", # for any static .html files you might be calling in your web root, we don't want to put the index.php controller in front of them "^/sf[A-z]+Plugin." => "$0", # don't want to mess with plugin routes "^/([a-z_]+).php(.).(.)$" => "/$1.php$2.$3", # same concept as rules below, except for other applications/environments (backend.php, backenddev.php, etc) "^/([a-z]+).php([^.])$" => "/$1.php$2", # see comment right above this one "^/(.).(.*)$" => "/index.php/$1.$2", # handle query strings and the dot problem! "^/([^.]+)$" => "/index.php/$1", # general requests "^/$" => "/index.php" # the home page )

restart lighttpd and this now appears to work successfully.

Will try and document if anything else but so far so good.

Billynkid commented 4 years ago

The second issue. you also need to change the following in lighttpd.conf

include_shell "/usr/share/lighttpd/create-mime.assign.pl"

The file was renamed to create-mime.conf.pl - https://github.com/pi-hole/pi-hole/issues/2557

include_shell "/usr/share/lighttpd/create-mime.conf.pl"

Both of these issue could possibly be fixed by allowing Ubuntu to replace the lighttpd.conf file.

lucasw-UM commented 4 years ago

I had the same issues as listed above when upgrading NNENIX route servers to 20.04. However, I only did the following change to the mod_rewrite rules:

Before: "^/(css|img|js|fonts)/.*\.(jpg|jpeg|gif|png|swf|avi|mpg|mpeg|mp3|flv|ico|css|js|woff|ttf)$" => "$0", "^/(favicon\.ico|robots\.txt|sitemap\.xml)$" => "$0", "^/[^\?]*(\?.*)?$" => "index.php/$1"

After: "^/(css|img|js|fonts)/.*\.(jpg|jpeg|gif|png|swf|avi|mpg|mpeg|mp3|flv|ico|css|js|woff|ttf)$" => "/$0", "^/(favicon\.ico|robots\.txt|sitemap\.xml)$" => "/$0", "^/[^\?]*(\?.*)?$" => "/index.php/$1"