Re: Server file upload question

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: Lisa Kachold
Date:  
To: Main PLUG discussion list
Subject: Re: Server file upload question
HI Lee:

On Tue, Apr 26, 2011 at 1:56 AM, <> wrote:

> Hi,
>
> Wondered if I can ask a basic server question as my experience is mostly
> limited to desktops...mostly. I'm doing this on my local host laptop as
> a test...but let's pretend local desktop client and big server. So I
> have some html and php code that uploads a flash flv video file from my
> desktop to the server, the server is going to stream the vid to other
> people. Per configuring the server were do I want to upload the vid to?
> - were should they be stored? Should it be /var/www/uploaded_vids or is
> better to store them in something more dedicated like /uploaded_vids.
> I'm aim to use LVM which seems to make it possible to easily enlarge a
> dir if the amount of uploaded vids storage needs to swell. I'm going to
> use Ubuntu Server. This is just me messing around behind a NAT firewall
> nothing too "heavy". Thanks.
>


What protocol are you planning to use to "upload"?

0) WebDAV plugin for Apache2
1) ftp
2) Php (like from a CMS like Drupal)
3) sftp/ssh

That will largely determine where you upload and serve your videos.

I recommend that you use a simple Apache2/scp model.

If you are serving from Apache2, you want to restrict to DocumentRoot (or
/var/www/html/videos) so you don't have to use symlinks, or hack the
original security structure, etc. so Apache2 can serve it.

/var/www/
/var/www/html = DocumentRoot

A script running ssh/scp could be called by cron daily to automagically put
up the videos from your desktop to your server.

If you plan to port forward or DMZ this server, you certainly don't want to
use WebDAV, and want to be sure:

0 - source/os is patched
1 - all your passwords are TRUELY RANDOM (not dictionary exploitable).
2 - no exploitable daemons are left unprotected

With CentOs 5.2 or > your install application choice will be:

Web Server
SSH Server

Next you will be able to make your directory /var/www/html/videos,

# mkdir /var/www/html/videos

then chmod/chown to www-data:www-data so the server can see it.

# chmod a+rx /var/www/html/videos | chown www-data:www-data
/var/www/html/videos

If you want a directory listing you will need to enable the Apache2
features.
ALWAYS COPY THE ORIGINAL FILES to BACKUP BEFORE EDITING:

# vi /etc/apache2/apache2.conf

<Directory /var/www/html/videos>
Options Indexes FollowSymLinks
</Directory>

# /etc/init.d/apache2 restart

Next to serve videos as videos, you will need to tell Apache2 it's okay:

This is enabled via a "mime type":

Go to /etc/apache2

# grep TypesConfig /etc/apache2/* |grep mime

Will locate your mime.types file.

A full list of mime types is here:
http://www.w3schools.com/media/media_mimeref.asp

or Video Formats:
http://www.w3schools.com/media/media_videoformats.asp

Edit the mime configuration file and enable the extensions you need.

BE SURE YOUR FILES ARE EXECUTABLE or they will not play.

If you are using gzip compression, be sure to exclude Video Mime Types:
http://slowcop.com/how-to-enable-gzip-compression-in-apache-2

To stream HTML video and SWF Flash (Adobe Coldfusion), you might want a
full-blown streaming video installation for Apache2 (ignore the proxy
installation instructions):
http://help.adobe.com/en_US/flashmediaserver/configadmin/WSE2A5A7B9-E118-496f-92F9-E295038DB7DB.html

If you want to serve music, see this link:
http://ubuntuforums.org/showthread.php?t=34359

Of course, if you want a searchable Video Entertainment solution you will
want to setup a CMS
like Drupal:

http://drupal.org/documentation/install

and Add the Video serving/uploading and YouTube files (so you can link to
things rather than download them).




>
> Lee G.
>



--
(503) 754-4452 iPhone
(623) 239-3392 Skype
(623) 688-3392 Google Voice

http://www.it-clowns.com

"It took me many years but I have gained access to the root account and have
removed the user God." -Saros
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss