DreamHost Forum
install uber uploader - Printable Version

+- DreamHost Forum (https://discussion.dreamhost.com)
+-- Forum: Web Development (/forum-18.html)
+--- Forum: Web Applications and One-Click Installs (/forum-11.html)
+--- Thread: install uber uploader (/thread-102891.html)

Pages: 1 2 3 4 5


install uber uploader - sst45jeff - 03-16-2008 10:05 PM

Can someone help with these install steps?
I am new at this and not sure how the paths are to be set. could you post an example showing how these following paths are to be set.
Or point me to a post that shows how to install. I cant seem to find one.
Thanks

Step 1. Set the $TEMP_DIR value in 'ubr_upload.pl' AND 'ubr_ini.php'. DO NOT MAKE THIS DIRECTORY PUBLIC!
eg. $TEMP_DIR = '/tmp/ubr_temp/';
eg. $TEMP_DIR = '/var/tmp/ubr_temp/';
eg. $TEMP_DIR = '/usr/home/roger/ubr_temp/';

Step 2. Set the $_CONFIG['upload_dir'] value in 'ubr_default_config.php'. May or may not be public.
eg. $_CONFIG['upload_dir'] = '/tmp/ubr_uploads/';
eg. $_CONFIG['upload_dir'] = '/var/www/html/ubr_uploads/';
eg. $_CONFIG['upload_dir'] = '/usr/local/www/htdocs/ubr_uploads/';
eg. $_CONFIG['upload_dir'] = $ENV{'DOCUMENT_ROOT'} . '/ubr_uploads/';

Step 3. Set the correct path values for the scripts in 'ubr_ini.php'.
eg. PATH_TO_UPLOAD_SCRIPT = '/cgi-bin/ubr_upload.pl';
eg. PATH_TO_LINK_SCRIPT = 'ubr_link_upload.php';
eg. PATH_TO_SET_PROGRESS_SCRIPT = 'ubr_set_progress.php';
eg. PATH_TO_GET_PROGRESS_SCRIPT = 'ubr_get_progress.php';
eg. PATH_TO_JS_SCRIPT = 'ubr_file_upload.js';

Step 4. Upload ubr_pload.pl to your cgi-bin directory. The path will be /var/www/cgi-bin or /usr/local/apache/cgi-bin


install uber uploader - rlparker - 03-17-2008 01:14 AM

Quote:Can someone help with these install steps?
I am new at this and not sure how the paths are to be set. could you post an example showing how these following paths are to be set.
Jeff, the problem is that there is no "correct" way for the paths to be set - the correct settings depend upon how you want uber-uploader to be configured. This is actually a very good thing, for security purposes (different uber-uploader installations are likely to be configured differently on different servers and by different users), but that *does* presume that you understand how to determine the way you want your uber-uploader installation to be set up and how to translate that to the proper values for the necessary settings in the .pl, config, and ini files.
Quote:Step 1. Set the $TEMP_DIR value in 'ubr_upload.pl' AND 'ubr_ini.php'. DO NOT MAKE THIS DIRECTORY PUBLIC!
eg. $TEMP_DIR = '/tmp/ubr_temp/';
eg. $TEMP_DIR = '/var/tmp/ubr_temp/';
eg. $TEMP_DIR = '/usr/home/roger/ubr_temp/';
This is where you determine what directory is to be used by uber-uploader to store it's temporary files while uploading and processing. The correct path here will depend upon where you want that directory to be. In the first example, it simply uses the system's '/tmp" directory, which all users on your server can use for temporary storage.

The second example shows another potential storage location - the system's /var/tmp directory, which is another place outside your own "user" space where you can place temporary files. Either of these places will work on DreamHost, but will be outside your own user space.

The third example demonstrates how you might set up the temporary directory to be within a user's space, but that path is not right for a setup here on DreamHost. If you want to put that temporary directory in your own user space, but not have it directly accessible from the web, you could use a path assignment like this:

$TEMP_DIR = '/home/yourusername/ubr_temp/',

...where "your user name" is the user name of your machine user and "ubr_temp" is what you want the directory to be named (the default is fine). Wink
Quote:Step 2. Set the $_CONFIG['upload_dir'] value in 'ubr_default_config.php'. May or may not be public.
eg. $_CONFIG['upload_dir'] = '/tmp/ubr_uploads/';
eg. $_CONFIG['upload_dir'] = '/var/www/html/ubr_uploads/';
eg. $_CONFIG['upload_dir'] = '/usr/local/www/htdocs/ubr_uploads/';
eg. $_CONFIG['upload_dir'] = $ENV{'DOCUMENT_ROOT'} . '/ubr_uploads/';
The logic here is the same as in the first setting, except that this is the directory where the uploaded files will be stored, so you have some decisions to make about how you want to set that up.

There are probably two considerations here that are likely to be important to you - (1) Do you want the directory to be directly accessible from the web or not, and (2) do you feel comfortable having the directory in a "common" space outside your own user space?

Because system "tmp" spaces are likely to be purged at any time, and you can not assure that files there will remain there for any given period of time, you probably do not want to use the first example given (that is in the system 'tmp" directory, and DH can empty, or purge, that directory as they see fit).

The next two given examples are typical of how you would place that upload directory in publicly accessible web space in configurations commonly encountered in various web hosting environments, but are *not* correct for the DreamHost environment.

The final example is one that *will* work on DreamHost - it uses an environment variable to set a directory called "ubr_uploads" beneath the document root.

You can also express this value in an absolute manner by simply using the full path for where you want the directory to go. For instance, to put it in your web site space where it is publicly accessible you might set it up as:

$_CONFIG['upload_dir'] = '/home/yourusername/yourdomainname.tld/uploads'; or
$_CONFIG['upload_dir'] = '/home/yourusername/yourdomainname.tld/ubr_uploads'; or
$_CONFIG['upload_dir'] = '/home/yourusername/yourdomainname.tld/whatever';

If you want to set it up in a directory that is *not* directly accessible from the web, you could put it outside your web directory like this:

$_CONFIG['upload_dir'] = '/home/yourusername/whatever'; or
$_CONFIG['upload_dir'] = '/home/yourusername/uploads';
Quote:Step 3. Set the correct path values for the scripts in 'ubr_ini.php'.
eg. PATH_TO_UPLOAD_SCRIPT = '/cgi-bin/ubr_upload.pl';
eg. PATH_TO_LINK_SCRIPT = 'ubr_link_upload.php';
eg. PATH_TO_SET_PROGRESS_SCRIPT = 'ubr_set_progress.php';
eg. PATH_TO_GET_PROGRESS_SCRIPT = 'ubr_get_progress.php';
eg. PATH_TO_JS_SCRIPT = 'ubr_file_upload.js';
This is just more of the same kind of logic employed above - you are telling the program where to find the various scripts that are needed for it to work, and the values you put here need to match how you have uber-uploader installed on your server. At it's simplest, and to clearly show what is happening here without going into a detailed discussion of how to describe paths, I'll just provide an example that presumes you have installed all the files except ubr_upload.pl into your main web directory, and have uploaded ubr_upload.pl into a directory called cgi-bin that is inside (beneath) your main web directory (your domain) - more discussion of the cgi-bin follows. Wink

So you can clearly see what is happening, I'll use the "full paths" that will be applicable on a DreamHost shared server with the default arrangement of your main web directory being the name of your domain (which is how DreamHost sets up your web domain directories unless you change them). This presumes that you have already established correctly where you want the temporary upload directory and the upload directory to be, and have assigned those paths as described above.

PATH_TO_UPLOAD_SCRIPT = 'home/yourusername/yourdomainname.tld/cgi-bin/ubr_upload.pl';
PATH_TO_LINK_SCRIPT = 'home/yourusername/yourdomainname.tld/ubr_link_upload.php';
PATH_TO_SET_PROGRESS_SCRIPT = 'home/yourusername/yourdomainname.tld/ubr_set_progress.php';
PATH_TO_GET_PROGRESS_SCRIPT = 'home/yourusername/yourdomainname.tld/ubr_get_progress.php';
PATH_TO_JS_SCRIPT = 'home/yourusername/yourdomainname.tld/ubr_file_upload.js';

As a final part of the example, let's now assume you have decided you want the uber-uploader to live in it's own directory, so that it is at yourdomain.tld/uploader/ (we'll leave the cgi-bin directly under you domain's main directly as in the previous example - and we'll talk more about that in a bit). Then your values for these variables would look like this:

PATH_TO_UPLOAD_SCRIPT = 'home/yourusername/yourdomainname.tld/uploader/cgi-bin/ubr_upload.pl';
PATH_TO_LINK_SCRIPT = 'home/yourusername/yourdomainname.tld/uploader/ubr_link_upload.php';
PATH_TO_SET_PROGRESS_SCRIPT = 'home/yourusername/yourdomainname.tld/uploader/ubr_set_progress.php';
PATH_TO_GET_PROGRESS_SCRIPT = 'home/yourusername/yourdomainname.tld/uploader/ubr_get_progress.php';
PATH_TO_JS_SCRIPT = 'home/yourusername/yourdomainname.tld/uploader/ubr_file_upload.js';
Quote:Step 4. Upload ubr_pload.pl to your cgi-bin directory. The path will be /var/www/cgi-bin or /usr/local/apache/cgi-bin
Steps 4 through 15 are just telling you where to upload the various files that are part of the uber-uploader system, and, hopefully, the preceding discussion has helped make it clear where you need to differ from the example instructions on DreamHost.

A word here about cgi-bin: Since DreamHost uses suEXEC (another topic for another day) you do not have a "specified" cgi-bin directory like you do on many other systems - you can run cgi scripts from any directory. That said, it is often easier to keep straight what is happening with applications that have cgi components, and follow generic supplied instructions that assume you *do* have a "cgi-bin' directory in your environment, if you create one and put the stuff the instructions say to put in 'cgi-bin' into it. For our example installation on DreamHost, we will do just that and create a cgi-bin directory in you "main" web directory (usually yourdomain.tld) like we described above.

Once you have created that directory, *that* is where you will upload ubr_pload.pl.

The other files are uploaded to wherever you decided uber-uploader is going to live in your website (and where you described those files as being in the previous steps). In our "teaching examples" above, that would be either in the main directory of your website (the first set of example locations/paths) or in the "uploader" directory benath (or inside) that directory (as in the second set of examples above).

In the uber-uploader installation instructions, the descriptions of where to upload the various files are accurate and descriptive - it's the "The path will be ... or ..." amplifications that are confusing to DreamHost users - because their webserver is not laid out that way, and those will *not* be the paths. Think of it this way ...

Whenever those instructions say, "The path will be /var/www/cgi-bin or /usr/local/apache/cgi-bin", replace that with "The path will be /home/yourusername/yourdomain.tld/cgi-bin"

And whenever those instructions say,"The path will be /var/www/html or /usr/local/apache/htdocs", replace that with "The path will be /home/yourusername/yourdomain.tld/ or /home/yourusername/yourdomain.tld/whatever_directory_you_installe_uber_uploader_files_in".

Now, is this the *only* way to do it? - NO, this is an example that works

Do I have to use those full paths? - NO, if you understand how to use relative paths and environment variables, and want to make the install more portable, knock yourself out. This was done this way to try to make what is happening clear to those who don't understand such things.

Can I set it up differently? - Of course! Smile
Quote:Or point me to a post that shows how to install. I cant seem to find one.
Actually, the uber-uploader installation instructions are very complete and accurate, but they assume you understand how a web server is organized, how *your* webserver is organized, and the basics of unix filesystems and paths.

If you re-read those instructions carefully, and review this post, hopefully you will see how it all comes together. If you run into a particular problem, or have a specific question, post back and I'll try to help you further (and so will others, I'm sure).

--rlparker


install uber uploader - sst45jeff - 03-18-2008 06:41 PM

Thanks for the excellent explanation, I thought that was the proccess for the paths but I just couldnt get my mind wrapped around it completly.
Thank you, I am sure many others will also benefit from your post.

Okay I have everything configured and uploaded but I cant see my upload file that I put at '/home/yourusername/uploads';

I used this command
'www.yoursite.com/uploader/ubr_file_upload.php'
in my browser per the instructions and uploaded a file.
I am using dreamweaver.
I can only see my domain which is why I think I cant see my upload file ?

I am also wondering about some of the other configuration options.
Do I just put enable & disable into the code or 1 & 0 where there is # already ?


install uber uploader - rlparker - 03-18-2008 09:37 PM

You're welcome, and I'm glad you found it helpful.
Quote:Okay I have everything configured and uploaded but I cant see my upload file that I put at '/home/yourusername/uploads';
That is, actually how it should be. Note that /home/yourusername/uploads is *not* directly accessible from the web (it is *beside* , not within, /home/yourusername/yourdomain.tld). /home/yourusername/uploads is where you might put the uploaded files if you did not want them visible from the web (for instance, so you could see them via an FTP program, but others could not view or download them).

If you wanted the uploaded files to be directly accessible from the web, you might have defined the upload directory as /home/yourusername/yourdomain.tld/uploads - which would result in you being able to see the uploaded files with a web browser.
Quote:Do I just put enable & disable into the code or 1 & 0 where there is # already ?
Well, the "#" is a comment tag, so I would not put anything in its place at all; you would simply delete that "#" sign to "uncomment" the line (and make it "active" ).

As for setting the other configuration options, you should use the "1" and "0", as appropriate for the given option (the comment part should describe how to set it). Wink

--rlparker


install uber uploader - sst45jeff - 03-18-2008 11:24 PM

I did intend to put the upload here so it would not be visible from the web:
/home/yourusername/uploads is where you might put the uploaded files if you did not want them visible from the web (for instance, so you could see them via an FTP program, but others could not view or download them).

I cant see it with my ftp file manager in dreamweaver. Is there a way that I can get it to show in dreamewaver or am I going to have to get a diffrent ftp program for seeing the files outside of my domain file ?

Well, the "#" is a comment tag, so I would not put anything in its place at all; you would simply delete that "#" sign to "uncomment" the line (and make it "active" ).

As for setting the other configuration options, you should use the "1" and "0", as appropriate for the given option (the comment part should describe how to set it).

Sorry I didnt meen the comment tag "#".
I meant there was a number in the place where you would enable or disable the config option.

This is what the code looks like: $_CONFIG['multi_upload_slots'] = 1;

This is what the install info shows: ubr_default_config.php multi_upload_slots CS Enable/Disable multiple upload slots

So I am asking do I put a "0" in to enable or disable ?
Does the "1" mean it is enabled or disabled ?

Or do I put in the word "enable" in place of the "1"

Thanks for your help.
I am very new at this and just learning all the diffrent things that seem to be implied because I dont have any formal training.


install uber uploader - rlparker - 03-18-2008 11:37 PM

Quote:I cant see it with my ftp file manager in dreamweaver. Is there a way that I can get it to show in dreamewaver or am I going to have to get a diffrent ftp program for seeing the files outside of my domain file ?
I'm not sure how DreamWeaver's ftp file manager works nowdays (I haven't used DreamWeaver since version 3!), so I'm not sure how you set it up (or even if you can) to see "uptree" of the web base directory in the directory structure.

A "real" FTP client is a desirable addition to your toolbox in any case, and I recommend that you grab one and learn to use it rather than relying completely on how DreamWeaver does things. Sure, DreamWeaver may be fine for most things, but having a "full service" FTP client available is very useful for those things that DreamWeaver does not do well (or at all). Wink
Quote:Sorry I didn't mean the comment tag "#".
I meant there was a number in the place where you would enable or disable the config option... So I am asking do I put a "0" in to enable or disable ? Does the "1" mean it is enabled or disabled ?
AH! I understand now. Yes, you should use *either* a "1" or a "0" to enable or disable an option (this is a common programming convention).

"1" - means that the option in "enabled" (true)
"0" - mena that the option is "disabled" (false)

That said, you have to carefully read the option - for instance some programmers will have an option called "disable_something_or_other", so for that to be true you have to "enable" that option with a "1", though the effect would be to actually disable something.

It's better to think of the "1" as "true" and the "0" as "false" to avoid any confusion over whether setting an option to "true actually enables or disables something. Wink

--rlparker


install uber uploader - sst45jeff - 03-19-2008 12:33 AM

I downloaded File Zilla and I still cant figure out how to see the files outside of my domain in the root directory.


install uber uploader - rlparker - 03-19-2008 12:36 AM

When you first connect with an ftp client, unless you specify other wise, you will find yourself in the /home/yourusername directory.

Your domain(s) directories should be "in" that directory ... what do you see when you first connect via fctp?

--rlparker


install uber uploader - sst45jeff - 03-19-2008 12:39 AM

I am in my domain directory when it first connects.


install uber uploader - rlparker - 03-19-2008 12:44 AM

That means yo must have set a "starting directory" in the connection information.

If you just set the server to "yourdomain.com" and put no other directory info there, you should end up in your *user* directory.

--rlparker