FTP directories for IP cameras -> available as web page running PHP?

Status
Not open for further replies.

olliraa

Dabbler
Joined
Aug 29, 2011
Messages
11
Just trying out the latest stable version and it really is awesome :) I have managed to get all the things I need running pretty much ok, but I also need my FTP directories of my IP cameras (one username and directory/camera) to be able to be viewed from WAN as standard php-based web pages through a specified non-standard port. How could I manage this? I already have nginx installed, because I have Owncloud plugin working.

This is the last piece I need. All help highly appreciated :)

Thanks!
 
Last edited by a moderator:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Do you really want to be visited by the @RussianMafia ?

Assuming you know what you're doing, just add the relevant dataset to the jail.
 

olliraa

Dabbler
Joined
Aug 29, 2011
Messages
11
Do you really want to be visited by the @RussianMafia ?

Assuming you know what you're doing, just add the relevant dataset to the jail.

Thanks for the tip Ericloewe :) Ok, I added a new jail and now I have FreeBSD 10.x running there. I guess I just install the required services via ssh? I've used some linux servers in the past, but never actually really configured one "from scratch".

This might be a really stupid question, but should I run both ftp server and web server in the jail or somehow use the "standard" ftp server and webserver inside the jail?

Sorry, this is all new to me. All help very welcome :)
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
You don't need to run ftp in the jail. Your server already has ftp.

Setup your dataset for your cameras.

Configure FTP for that dataset.

Add that dataset as storage to your jail.

In the jail configure whatever web server config you need. I prefer nginx, but most tutorials assume Apache for the webserver.

If your application that you need to use runs on PHP, you will need to set that up. What application are you trying to run?
 

olliraa

Dabbler
Joined
Aug 29, 2011
Messages
11
You don't need to run ftp in the jail. Your server already has ftp.

Setup your dataset for your cameras.

Configure FTP for that dataset.

Add that dataset as storage to your jail.

In the jail configure whatever web server config you need. I prefer nginx, but most tutorials assume Apache for the webserver.

If your application that you need to use runs on PHP, you will need to set that up. What application are you trying to run?

Thank you soo much for this, I've never realised how I should set this up without your advice :D


Ok, I've managed to do this sofar:

1. Set up a jail
2. Get nginx and php (with gd library) working in the jail :) (running a simple php gallery for the ip cams' images)
3. Set up storage as follows:

192.168.0.101 (Freenas) myarray/ftp/ -> 192.168.0.6 (Jail) /usr/local/www/nginx

I've understood that the "storage" works like mount? I mean everything I throw in the first folder (files/create subfolders etc.) ends up in the latter (jail)?

Sorry to ask these dumb questions here. But at least I'm eager to learn new things.

Some notes about the storage:

It seems to work ok, files in the first directory are available via browser "from" the jail. However, yesterday I managed to do something wicked... Somehow the contents of the storage above got "reverted" to an earlier state, meaning that the contents was replaced with something that I had there a week ago, but already deleted :O

This has something t do with zfs, am I correct? Any clues what I might have done? I've used Freenas via the Web interface and also via ssh as root. That's got something to do with it?

I really want to be sure, that I don't do the same mistakes again.

Thanks for your patience with me!
 

olliraa

Dabbler
Joined
Aug 29, 2011
Messages
11
Did you roll back a snapshot?

Actually no - at least on purpose :)

Btw, as I'm planing to have up to 10 ip cameras = 10 usernames for ftp uploading the images (chrooted), how many datasets *should* I have? Only one all together, or one dataset/username?

I just want this to work, so I don't need any fancy stuff :)
 
Last edited:

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Please post (between CODE tags) the output of zpool history.
how many datasets *should* I have? Only one all together, or one dataset/username?
Do you want to be able to manage them, e.g. with different snapshot schedules, or storage quotas? If not, one dataset will be sufficient. You can still have subdirectories with different permissions, if necessary.
 

olliraa

Dabbler
Joined
Aug 29, 2011
Messages
11
Ok thanks :) Now the setup is really close to perfection :), but I have one more thing that I want to ask you, because I'm really not sure how to so this in a way that I don't mess anything else:

The files from the ftp users (home)folders end up nicely to the jail's storage. But... the priviledges are "wrong". I need the files in the jails storage to be accessible from web (because the jail acts as a nginx web server for displaying the security cams images). At the moment the files have these priviledges rw-------. Naturally they're not accessible via web browser. How should I set the system up in a way that all the files in the certain folders under the jails storage get the priviledges like this: rw-r--r-- ? I know basics about chmod and chown, but I'm afraid I'll mess something up if I start hammering those folders as root etc. :/

Thanks in advance, this is almost ready :)
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
That sounds like the responsibility of the software that's delivering the files.
 

olliraa

Dabbler
Joined
Aug 29, 2011
Messages
11
That sounds like the responsibility of the software that's delivering the files.

Hmm.. Could you alaborate this a bit more? I'm stumped here :/ I thought it would be something like the setacl command. I found out that the command for Freebsd is somewhat different than the same or Linux and I found a few examples for Freebsd, but I always get a error. Anyone willing to give an exact example of setting the default acl of the directory and also all the new files to be saved in that particular directory in the future?

Thanks :)

*edit*

It seems the FS for the jail is nfsv4?! Is this for real, or am I loosing it completely? That would expain the errors, I guess?
 
Last edited:

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Did you look at the advanced options for FTP? There are two named "File Permission" and "Directory Permission" that may be what you're looking for.
It seems the FS for the jail is nfsv4?!
I think of NFS as a sharing protocol, but maybe a jail sees mounted storage as an NFS share, I honestly don't know.
That would expain the errors, I guess?
Not sure what errors you're referring to, or how this would explain them.
 

olliraa

Dabbler
Joined
Aug 29, 2011
Messages
11
Did you look at the advanced options for FTP? There are two named "File Permission" and "Directory Permission" that may be what you're looking for.

I think of NFS as a sharing protocol, but maybe a jail sees mounted storage as an NFS share, I honestly don't know.

Not sure what errors you're referring to, or how this would explain them.


Totally awesome :D Thanks you so much everybody! The Advanced ftp settings made my day! I'd never ever would have found the settings without you *humble bow down* :)
 
Status
Not open for further replies.
Top