Author Topic: .htaccess  (Read 3655 times)

Offline NZBmets

  • Prolific Indexer
  • ****
  • Posts: 260
  • Helpful: +11/-0
.htaccess
« on: 2014-03-18, 09:41:26 am »
Hello and thank you for any help ...
For "fun" I tried to install  nZEDb on to my Synology NAS...took a bit of doing but I think I'm there. As it runs on busybox there are a lot of challenges.

In any event, I have NN+ running well and I used the following guide to install: http://synology.brickman.nl/syn_howto/HowTo%20-%20install%20Newznab%20Plus.txt
This puts the NN+ files outside of root and links them with a sym link as follows:
Code: [Select]
ln -s /volume1/@appstore/newznab/www/ /volume1/web/newznab
As nZEDb is a fork, I was hopeful I could mimic this approach. It gets close.

There is a problem with the rewrites though in .htaccess although in both NN+ and nZEDb they are effectively the same.

NN+ (which works) is as follows:
Code: [Select]
RewriteEngine on
#RewriteBase /

# Do not process images or CSS files further
RewriteRule \.(css|jpe?g|gif|png|js|ico|mp3|ogg)$ - [L]

# Leave /admin and /install static
RewriteRule ^(admin|install).*$ - [L]

# Rewrite web pages to one master page
RewriteRule ^([^/\.]+)/?$ index.php?page=$1 [QSA,L]
RewriteRule ^([^/\.]+)/([^/]+)/?$ index.php?page=$1&id=$2 [QSA,L]
RewriteRule ^([^/\.]+)/([^/]+)/([^/]+)/? index.php?page=$1&id=$2&subpage=$3 [QSA,L]

nZEDb is
Code: [Select]
RewriteEngine on
#RewriteBase /

# Do not process images or CSS files further
RewriteRule \.(css|jpe?g|gif|ogg|ogv|png|js|ico|ttf|eot|woff|svg)$ - [L]

# Leave /admin and /install static
RewriteRule ^(admin|install).*$ - [L]

# Rewrite web pages to one master page
RewriteRule ^([^/\.]+)/?$ index.php?page=$1 [QSA,L]
RewriteRule ^([^/\.]+)/([^/]+)/?$ index.php?page=$1&id=$2 [QSA,L]
RewriteRule ^([^/\.]+)/([^/]+)/([^/]+)/? index.php?page=$1&id=$2&subpage=$3 [QSA,L]

What I find is some function calls fail within PHP based on how I try to correct .htaccess.  If anyone can help I'd appreciate it. There must be something different in respect to what nZEDb knows as a base.

I'm not sure if it is helpful, but the error that comes back is as follows:
Code: [Select]
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /volume1/@appstore/nZEDb/nzedb/utility/Versions.php:64 Stack trace: #0 /volume1/@appstore/nZEDb/nzedb/utility/Versions.php(64): SimpleXMLElement->__construct('/volume1/@appst...', 0, true) #1 /volume1/@appstore/nZEDb/nzedb/Sites.php(26): nzedb\utility\Versions->__construct() #2 /volume1/@appstore/nZEDb/www/pages/BasePage.php(42): Sites->__construct() #3 /volume1/@appstore/nZEDb/www/pages/Page.php(9): BasePage->BasePage() #4 /volume1/@appstore/nZEDb/www/index.php(13): Page->__construct() #5 {main} thrown in /volume1/@appstore/nZEDb/nzedb/utility/Versions.php on line 64
In its current form, the URL http://'host'/nZEDb loads the index page fine, from there is bails.  FWIW I was able to get it all installed by manipulating the htaccess around but never found the right settings for all links to work.

-----
UPDATE
-----

So what I've found is a fundamental difference between the two implementations at the root folder.

In NN+ there are no PHP files in
Code: [Select]
.../newznab/ Any PHP files exist in subfolders as is a fairly common standard.

nZEDb, however, breaks this standard and has
Code: [Select]
autoloaders.php &
Code: [Select]
nZEDbBase.php It would seem this is where the problem is coming from. If anyone can recommend how to implement a workaround.
« Last Edit: 2014-03-18, 12:34:18 pm by NZBmets »

Offline NZBmets

  • Prolific Indexer
  • ****
  • Posts: 260
  • Helpful: +11/-0
Re: .htaccess
« Reply #1 on: 2014-03-19, 03:19:30 pm »
Well I gave up - it just wasn't worth it...mostly because nZEDb is so good at what it does now that it needs a machine more suited to it.

Ubuntu 13.10 on VPS and things chug along.
For those experiencing the ascii error in TMUX, a very poor yet effective workaround in postprocessed_threaded.py until it is corrected in the master codebase is to force an encode and decode as follows (about line 234)
Code: [Select]
if my_id:
     # Trying to work around bad ascii issue
     my_id = my_id.encode('ascii', 'ignore')
     my_id = my_id.decode('utf-8')
     time_of_last_run = time.time()
     subprocess.call(["php", pathname+"/../nix/tmux/bin/postprocess_new.php", ""+my_id])
     time.sleep(.02)
     self.my_queue.task_done()

Offline kevin123

  • Overlord
  • ******
  • Posts: 456
  • Helpful: +49/-0
Re: .htaccess
« Reply #2 on: 2014-05-16, 04:54:57 pm »