Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 16.04 to 20.04 upgrade path issues #12

Open
Billynkid opened this issue Aug 22, 2020 · 2 comments
Open

Ubuntu 16.04 to 20.04 upgrade path issues #12

Billynkid opened this issue Aug 22, 2020 · 2 comments

Comments

@Billynkid
Copy link

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, backend_dev.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
Copy link
Author

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 - pi-hole/pi-hole#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
Copy link

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"

@jvobelnet jvobelnet mentioned this issue Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants