Log in

No account? Create an account
'Twas brillig, and the slithy toves did gyre and gimble in the wabe [entries|archive|friends|userinfo]

[ website | Beware the Jabberwock... ]
[ deviantArt | the-boggyb ]
[ FanFiction | Torkell ]
[ Tumblr | torkellr ]

[Random links| BBC news | Vulture Central | Slashdot | Dangerous Prototypes | LWN | Raspberry Pi]
[Fellow blogs| a Half Empty Glass | the Broken Cube | The Music Jungle | Please remove your feet | A letter from home]
[Other haunts| Un4seen Developments | Jazz 2 Online | EmuTalk.net | Feng's shui]

NAS Adventures, take two [Friday 7th February 2014 at 8:02 pm]

[Feeling |accomplishedaccomplished]
[Playing |Final Battle with Bowser ~ Super Mario Galaxy Original Soundtrack]

I've given up on the previous NAS - trying to put together a toolchain is proving to be too much hassle, and while I could blow away the custom firmware and put a stock Debian install on it the internets suggest that the Debian kernel doesn't support DMA at which point your performance drops through the floor. Plus it has a dead hard disk and a noisy fan.

So over Christmas I picked up my dad's other old NAS, a Netgear ReadyNAS Duo v1. Like the Thecus it's also Debian-based, but Netgear are running a real full-fat Debian install. And they provide an official addon to enable root SSH access at which point I can log in, download Debian's already-built toolchain, and use that. Simples!

Plus it also has two working hard disks and a much quieter fan :)

Anyway, now that I have a NAS that is actually usable I've been playing around with running PHP on it. I did try PHP on the Thecus, but it came with some prehistoric version of it (Craig's comment upon seeing the phpinfo output was "where did the other half go?") and the only database it supported was sqlite. Netgear on the other hand ship PHP 5.2 which is almost up-to-date, along with MySQL 5. They even publish a set of instructions at which point the whole exercise is again incredibly easy.

Until I tried installing Craig's Home Portal package, which relies on mod_rewrite at which point everything fell over. See, it was going to go wrong somewhere!

It took a lot of poking around and bashing of config files, but I eventually worked out the problem. See, if you create a HTTP share through the admin webpages it sticks an Options Indexes in the location definition. This disables all server options except for Indexes, at which point mod_rewrite sulks. See, mod_rewrite requires that either FollowSymLinks or SymLinksIfOwnerMatch is enabled, otherwise "you cannot use the rewrite engine... for security reasons". Except the way it handles this is to reject all requests with a 403 Forbidden error.

Fixing this merely requires enabling the missing options, though this is a bit tricky because you can't just put set them in a .htaccess file. Unfortunately the other logical solution of modifying the existing config doesn't work because the admin webpages will blow your customisation away without warning. The solution is to not enable HTTP access to the share through the admin pages, but instead to create a new config file in /etc/frontview/apache/addons/. Put something like the following in it:

Alias /mywebsite /c/mywebsite
<Location "/mywebsite">
  Options Indexes FollowSymLinks SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
Then restart the webserver with /etc/init.d/frontview restart and it should all work (it does for me!).

Next challenge: trying to wring more performance out of PHP! It's a bit sluggish, probably because it only has a 400MHz Sparc processor.
Link | Previous Entry | Share | Next Entry[ 3 pennies | Penny for your thoughts? ]

[User Picture]From: tau_iota_mu_c
Wednesday 12th February 2014 at 1:24 pm (UTC)
I should not admit that I've been using debian on my thecus N4100Eco for a year now, should I?

Probably vastly different hardware anyway. I've spent far too much time on piddly little things like getting a userspace interface to the gpio module (that's not in upstream, so I have to port some code a guy wrote a couple of years ago to a modern kernel) to light the disk LEDs on the front panel. Well, it's IMPORTANT to know which disk to pull in a failure!

Thecus make really shitty firmware spaghetti^Wscripts.
(Reply) (Thread)
[User Picture]From: tau_iota_mu_c
Wednesday 12th February 2014 at 1:27 pm (UTC)
Make that a n4200eco. SO confusing.
(Reply) (Parent) (Thread)
[User Picture]From: boggyb
Wednesday 12th February 2014 at 10:05 pm (UTC)
I did consider installing Debian on the N2100, but it seemed to be too much hassle to do what I wanted (determine why it claimed only one HDD was present - this eventually turned out to be due to magic smoke escaping) especially given the DMA issues. I still have it, so I may resurrect it at some point and have another crack at building a toolchain for it.
(Reply) (Parent) (Thread)