Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Sep 25, 2008 6:02 pm 
Offline
Senior Newbie

Joined: Wed Sep 24, 2008 6:38 pm
Posts: 19
I have a Linode 540 with ubuntu, lighttypd 1.4.19, php-cgi. File uploads are not working. Firefox says: "The connection to the server was reset while the page was loading."

I am trying to import a compressed exported database into phpmyadmin. This is what /var/log/lightty/access.log has:

71.170.222.197 - - [25/Sep/2008:16:56:02 -0400] "POST /phpmyadmin/import.php HTTP/1.1" 413 0 "http://www.krueckeberg.org/phpmyadmin/server_import.php?token=5d7d9370cfbd84cd1fa6e74eb0f267c8" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1"

This is what /var/log/lighttpd/error.log has.

2008-09-25 16:56:01: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-Hu0l6j No such file or directory
2008-09-25 16:56:02: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-jjFSNv No such file or directory
2008-09-25 16:56:02: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-NbEhtS No such file or directory
2008-09-25 16:56:02: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-zxv3Gq No such file or directory
2008-09-25 16:56:02: (connections.c.1102) denying upload as opening to temp-file for upload failed: /var/cache/lighttpd/uploads/lighttpd-upload-HG2Qx7 No such file or directory

The file size of the is 4,164KB. I wrote a small php script (to upload files) to help "debug" this problem. Upload only worked with small text files.
Any help is appreciated. I getting very tempted to switch to Debian.


Top
   
 Post subject:
PostPosted: Thu Sep 25, 2008 6:20 pm 
Offline
Senior Newbie

Joined: Wed Sep 24, 2008 6:38 pm
Posts: 19
Actually the file size is only 195KB.


Top
   
 Post subject:
PostPosted: Thu Sep 25, 2008 7:48 pm 
Offline
Junior Member

Joined: Tue Jul 20, 2004 11:32 am
Posts: 41
Website: http://www.insanum.com
Well it smells like a permission problem between your web server credentials and your /var/cache/lighttpd paths. But you say you got smaller uploads to work... maybe your setting of upload_max_filesize in php.ini is too small?


Top
   
 Post subject:
PostPosted: Thu Sep 25, 2008 9:00 pm 
Offline
Senior Newbie

Joined: Wed Sep 24, 2008 6:38 pm
Posts: 19
No, it was definitely not an upload_max_filesize problem. I bumped upload_max_filesize up to 20M without success. And I have post_max_size=10M.
The problem was the uploads directory did not exist in /var/cache/lighttpd/. Doing
Code:
mkdir /var/cache/lighttpd/uploads
chowm -R www-data:www-data /var/cache/lighttpd/uploads/
has seemed to fix the problem. I just don't get why the uploads subdir wasn't automatically created by lighttpd?


Top
   
 Post subject:
PostPosted: Thu Sep 25, 2008 10:03 pm 
Offline
Senior Member
User avatar

Joined: Mon Dec 10, 2007 4:30 pm
Posts: 341
Website: http://markwalling.org
Very few software products that I know of will create needed directories on the fly based on an entry in a config file. It is much more common to be required to make the directories your self, to save you from screwing up your config file and doing something you really didn't mean to do.


Top
   
 Post subject:
PostPosted: Fri Sep 26, 2008 10:05 am 
Offline
Senior Newbie

Joined: Wed Sep 24, 2008 6:38 pm
Posts: 19
I know what your saying. But something must be amiss in the installation because an upload directory will always be needed by a http server because file upload forms are part of http. The fact that I simply copied the lighttpd.conf from a prior Debian/Etch installation on a different vps could have had something to do with this problem (but I don't see how).

Anyway, the replies are much appreciated.


Top
   
 Post subject:
PostPosted: Fri Sep 26, 2008 5:56 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2003 2:28 pm
Posts: 245
kurtk wrote:
But something must be amiss in the installation because an upload directory will always be needed by a http server because file upload forms are part of http.

Nope.

The PUT method (to replace a URL) is defined by the HTTP 1.1, but most servers don't support it at all (except to deny it). The POST method sends an entity to the server, but how that entity is processed is determined by the URL: could be a file upload, could be a form values, could be a Python script to run, could be ignored completely: all equally valid and all completely outside the scope of HTTP.

Forms are part of HTML, and the INPUT type 'file' is intended for uploads, but there's no requirement that the server accept such uploads, nor should there be (remember: I can send arbitrary requests to your server, regardless of what forms you may or may not present me.) As someone who has run many servers that didn't accept file uploads, I'd be pretty unhappy with an HTTP daemon that enabled them automatically.

_________________
The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world.
-- seen on the net


Top
   
 Post subject:
PostPosted: Fri Sep 26, 2008 6:58 pm 
Offline
Senior Newbie

Joined: Wed Sep 24, 2008 6:38 pm
Posts: 19
What you say makes sense. So I changed php.ini so that
upload_tmp_dir="/home/lighttpd/uploads"

Set the directory's group to www-data and gave it rw permissions. I had php process a http file form. It worked fine.

Thanks for info.


Top
   
 Post subject:
PostPosted: Fri Sep 26, 2008 9:21 pm 
Offline
Senior Member
User avatar

Joined: Mon Dec 10, 2007 4:30 pm
Posts: 341
Website: http://markwalling.org
HTTP != HTML

HTTP is a communication protocol. HTML is a way of expressing the layout and content of a document for interpretation by a browser.

SteveG wrote:
kurtk wrote:
But something must be amiss in the installation because an upload directory will always be needed by a http server because file upload forms are part of http.

Nope.

The PUT method (to replace a URL) is defined by the HTTP 1.1, but most servers don't support it at all (except to deny it). The POST method sends an entity to the server, but how that entity is processed is determined by the URL: could be a file upload, could be a form values, could be a Python script to run, could be ignored completely: all equally valid and all completely outside the scope of HTTP.

Forms are part of HTML, and the INPUT type 'file' is intended for uploads, but there's no requirement that the server accept such uploads, nor should there be (remember: I can send arbitrary requests to your server, regardless of what forms you may or may not present me.) As someone who has run many servers that didn't accept file uploads, I'd be pretty unhappy with an HTTP daemon that enabled them automatically.


Top
   
 Post subject:
PostPosted: Fri Sep 26, 2008 9:52 pm 
Offline
Senior Newbie

Joined: Wed Sep 24, 2008 6:38 pm
Posts: 19
Yikes. I didn't even realize I had written HTTP instead of HTML.


Top
   
 Post subject:
PostPosted: Sat Sep 27, 2008 6:05 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2003 2:28 pm
Posts: 245
mwalling wrote:
HTTP != HTML
HTTP is a communication protocol. HTML is a way of expressing the layout and content of a document for interpretation by a browser.


Yes, I know. That's why I discussed them in two separate paragraphs :-)

_________________
The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world.

-- seen on the net


Top
   
 Post subject:
PostPosted: Sat Sep 27, 2008 7:17 pm 
Offline
Senior Member
User avatar

Joined: Mon Dec 10, 2007 4:30 pm
Posts: 341
Website: http://markwalling.org
I know, I was repeating what you said for his benefit :)
kurtk wrote:
I had php process a http file form.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group