Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: Mike on March 17, 2002, 11:57:21 PM
-
I'm trying to configure proftpd to include an upload directory, say in /home/e-smith/files/primary/files/upload. Before I start changing too many configuration files, has anyone else done this? Care to post the instructions?
Thanks
-
It's okay - I got it working. Here's the contents of my 50AnonymousPrimary config file:
{
#------------------------------------------------------------
# How to handle anonymous FTP logins: chroot to the primary files
# directory.
#------------------------------------------------------------
}
User public
Group public
UserAlias anonymous public
UserAlias ftp public
AnonRequirePassword off
UseFtpUsers on
MaxClients 10
DisplayLogin welcome.msg
DisplayFirstChdir .message
AllowAll
AllowAll
DenyAll
I also had to change permissions on the incoming directory so other people could write to its contents.
-
hey there,
i want to do an upload directory also...where do you go/ which
files do you reconfigure to do what you did..?
thanks
Ben.
-
Ben wrote:
> i want to do an upload directory also...where do you go/ which
> files do you reconfigure to do what you did..?
I will tell you what has worked for me, in the next post concurrent to this but 1st I appeal for the experts to look at this, correct my mistakes and let us make installing php and cgi scripts into something to post as a How To.
I also would ask someone here to answer the following questions I saw posted at bignosebird.com ( a location to get CGI scripts)
First, find out from your system administrator if you are allowed to run cgi scripts on your server.
(It appears we can turn this on or off at the modify Ibay level)
Second, find out where your cgi-bin directory is located.
(Answer for main and i-bays appreciated)
Third, find out how to call a cgi-bin script, i.e., http://domain.com/cgi/yourname/cgi-bin/script.cgi or /cgi-bin/script.cgi as examples.
Fourth, make sure you know how to properly FTP files between your PC and unix server. Files ending with .txt, .cgi, .pl, .html must be sent as type ASCII. Files such as .jpg, .mid, .gif must be sent as type BINARY.
Fifth, ask where PERL is located on the server. Popular locations are /usr/local/bin/perl, /usr/bin/perl, and /usr/sbin/perl make sure it is the right perl! Some systems have more than one version of perl installed. Go for Version 5.
(I notice perl scripts have the location on the top line but a # in front does this # need to be removed)
Sixth, if the script uses e-mail, such as Virtual Cards, BNBFORM, BNBBOOK, or BIRDCAST, make sure you have the sendmail program correct or that SMTP is set correctly. In the scripts, it is /usr/lib/sendmail -t
If you must change it to /usr/sbin/sendmail or some other location, be sure to have the -t option on the command line. Making the mistake of removing the -t is a sure way to kill any of these scripts!
Now on to the next message where I will tell how I got an upload script to work after a weekend of work because I did not know the answers to the above questions.
Ken Graham
-
I managed after a weekends work to get a php script to work for uploading files. Knowing how to do it should allow you to do it in a few minutes.
A word about php scripts as this is first I have heard of them - they appear to work from the html directory and you would link to them just as if they were a html page No apparent need to know where the cgi-bin directory is located.
I noticed in these archives a mention to
http://www.hotscripts.com so went there to see what I could find out more.
I then downloaded PHP Uploader Downloader from the following area
http://www.hotscripts.com/PHP/Scripts_and_Programs/File_Manipulation/Upload_Systems/
Reason for downloading above script is it had a high rating and was in zip format. Some are in tar format but I am working from a Windows workstation not a Linux workstation so needed a zip format.
After unzipping item I made a copy of updown.php
opened it with notepad and made a couple changes for paths that was a result of a lot of searching on these forums, changes were on line 4 and 5
$dl = "http://your_domain_or_ip_here/home/e-smith/files/ibays/upload/files"; //url where files are uploaded where upload is the name of your ibay
$absolute_path = "/home/e-smith/files/ibays/upload/files"; //Absolute path to where files are uploaded where upload is the name of your ibay
I then uploaded by using a FTP program in ascii mode to
/primary/html
Uploading then worked, I was able to go to http://my_IPnumber_or_my_domain/updown.php
and upload a file.
I have left off the location of my site until the experts tell me if I have any gaping security problems with the above setup.
(problems - this script shows the name of files uploaded and then also attempts to provide download capability. I will want to keep the names of the upload files confidential and also I would not want files to be able to be uploaded and downloaded without my intervention, downloading didn't work so at least in this I am okay - however I will be checking out other scripts because I may want a separate download directory for clients use in future.)
I look forward to suggestions on improving the above so we can make it into a HOW TO
Ken Graham
uploaded to
-
ken wrote:
> First, find out from your system administrator if you are
> allowed to run cgi scripts on your server.
> (It appears we can turn this on or off at the modify Ibay
> level)
Correct. And don't forget to set the appropriate permissions on all files. This info is usually included when downloading scripts.
> Second, find out where your cgi-bin directory is located.
> (Answer for main and i-bays appreciated)
Main:
script dir: /home/e-smith/files/primary/cgi-bin/
script URL: http://your_server_address/cgi-bin/
i-bays:
script dir: /home/e-smith/files/ibays/your_ibay_name/cgi-bin
script URL: http://your_server_address/your_ibay_name/cgi-bin/
(If you've made a virtual domain for that i-bay, it is also accessible at http://your_virtual_domain/cgi-bin/)
> Fifth, ask where PERL is located on the server.
/usr/bin/perl (it's 5.006 on SME 5.1.2)
> (I notice perl scripts have the location on the top line but
> a # in front does this # need to be removed)
NO. The top line should read #!/usr/bin/perl
> /usr/lib/sendmail
> /usr/sbin/sendmail
Both can be used on SME 5.1.2 (they're links to /var/qmail/bin/sendmail)
Regarding your next post: Winzip understands .tar, .tgz, and .tar.gz
-
I have managed to get an upload cgi script to work and I found it has an advantage. The php script seems to time out if more than a couple of megs are to be uploaded.
However though I tried pointing to the cgi script in a cgi-bin directory in a ibay it takes the info from the primary/cgi-bin location
I have a upload file form at http://64.114.103.192/ftfsj/psupload.html with the following
-
Seems like wrong paths are entered. Which did you use?
-
> Seems like wrong paths are entered. Which did you use?
I did have an incorrect reference pointing to the main site.
No sooner got it corrected then I found a much better (and its free) way to accept uploads. The upload speed this way vs going to a directory appears to be the same.
Using http://soupermail.sourceforge.net/ form mail program I am able to have people upload any size file to my email from their web browser, complete with form information. I have 3 forms set so the file can go to the appropriate email location. The email names are names that have no other rights so they can only accept email. No need for FTP access on the part of the users. No need to even provide the email address to anyone as I set them up for the users as an extra email account so they shouldn't be receiving much junk mail through them.
While I am only using it for file uploads it also states it supports
File Downloads
PDF generation
Database support
pgp - pretty good privacy
mailing lists
and more.
I installed it to the primary site by following direction provided. It came with a program that writes a custom configuration with correct paths for my server. This is then copied into a file and it worked.
I was warned that mime lite was missing as well as files required for database support. Here the only flaw in the instructions was that it said to use the instructions provided in the link to getting mime lite. (the instructions with mime lite did not work) What did work was to get mime lite from the link provided (the directory was hidden in the lib directory) and simply copy the mime directory exactly as provided with files within, into the cgi-bin directory of my server. Then rerun the install program. The proper files were found and a proper configuration file was created.
Files in CGI had to be CHMOD 755
Read Right Execute - administrator
Read Execute-group
Read Execute-user
I used Midnight Commander - type MC at root prompt, and used the directory info provided by Urirama to get to the cgi-bin directory to CHMOD the files
>> script dir: /home/e-smith/files/primary/cgi-bin/
I have not installed the database files as yet so can't comment on that aspect.
Many forms examples and a tutorial is provided.
A suggestion is provided in the tutorials to make sure paths are correct for tutorial items to work - I changed them to what I thought was appropriate and it didn't work - turns out they had provided the correct paths to begin with and I was in error.
I also went into the configuration file with notepad and increased timeout and maximum file size lines. Then had to redo the CHMOD command to allow the system to work.
I still have a lot to learn but I give a thumbs up to http://soupermail.sourceforge.net/
a great companion for SME Server.
If anyone wants to try a sample file upload they may email me at k_grah***am@hotmail.com for the form address. (take out the ***)