Forum

about upload file to webserver

godguy
26 May 2008, 14:20
hi all:
i use hiawatha as a webserver and php write web page, i change all the php.ini parameters to allow user upload a big file (about 10M), but at last failed.
does hiawatha support user upload big file?
my hiawatha httpd.conf is:

# Hiawatha main configuration file
#
# GENERAL SETTINGS
#
ServerId = 33:33
ConnectionsTotal = 100
ConnectionsPerIP = 10
SystemLogfile = /usr/local/var/log/hiawatha/system.log
GarbageLogfile = /usr/local/var/log/hiawatha/garbage.log
# BINDING SETTINGS
# A binding is where a client can connect to.
#
Binding {
Port = 80
Interface = 10.155.20.74
}
#
Binding {
Port = 443
Interface = 10.155.20.74
ServerKey = /usr/local/etc/hiawatha/webui_serverkey.pem
UseSSL = yes
}
#
# COMMON GATEWAY INTERFACE (CGI) SETTINGS
# These settings can be used to run CGI applications.
#
CGIextension = cgi
TimeForCGI = 100
CGIhandler = /opt/ah/bin/ah_capture:php

CGIhandler = /usr/local/bin/php-cgi:php5

# DEFAULT WEBSITE
#
Hostname = 127.0.0.1
WebsiteRoot = /usr/local/var/www/hiawatha
StartFile = index.html
ExecuteCGI = yes
AccessLogfile = /usr/local/var/log/hiawatha/access.log
ErrorLogfile = /usr/local/var/log/hiawatha/error.log

# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
VirtualHost {
Hostname = 10.155.20.74
WebsiteRoot = /usr/local/var/www/hiawatha/webui
StartFile = index.php5
ExecuteCGI = yes
}


how to change it? please give me some suggestions. thanks! very thanks!!
Hugo Leisink
26 May 2008, 15:18
Look in the manualpage for the MaxRequestSize option:

Binding {
Port = 80
MaxRequestSize = 10240
...
}

godguy
26 May 2008, 15:25
thanks for your reply
1> how to find the manualpage in your webside
2> please give a link. thanks
Hugo Leisink
26 May 2008, 15:31
The manualpage is not online (will take care of that soon). After you've installed Hiawatha, use 'man hiawatha' on the commandline.
thanks for your sugg
27 May 2008, 10:51
hi:
i type 'man hiawatha', it is a wrong command, i don't know how to get the information about other parameters.
i also have a problem, WebUI read a big file(about 20K) in browser, i have add MaxRequestSize in my httpd.conf. but it is maybe some wrong for hiawatha to sendback the file content to PHP page.
how to resolve it ?
Hugo Leisink
27 May 2008, 15:12
I've created a PDF of the manual page. It can be found via http://projects.leisink.org/hiawatha.pdf.

About your other problem: can you be more specific. I don't understand your problem. Can you tell me what the errorlogfile tells you?
godguy
28 May 2008, 05:35
thanks for your link.

sorry for my unclearly descriptions!
my meaning is:
my PHP web page need read a big file from web server, i don't know hiawatha has a limition for reading a big file (20K) or not.
if has, how to change it?
Hugo Leisink
28 May 2008, 10:26
It's the PHP program that is reading the file, not Hiawatha. Hiawatha does not limit the memory size of a CGI program (which a PHP program is), but it does limit the run time of a CGI program. The default amount of time a CGI program is allowed to run is 5 seconds. If the reading and processing of this file takes more than 5 seconds, Hiawatha kills the CGI program. You can increase the amount of run time for a CGI program via TimeForCGI. Does this solve your problem? If not, can you tell me what error messages do you see on your screen and in your logfiles?
godguy
29 May 2008, 09:56
hi:
i have set the TimeForCGI timer to 90 seconds, but it also failed, i check the hiawatha error log file, the error information is:
invalid status code received from CGI

can you give me some suggestions ?

thanks!
Hugo Leisink
29 May 2008, 10:16
A CGI program can print a status header line. This line should have the following format:
Status: <HTTP error code>[ <HTTP error message>]CRLF

If seems that your CGI script is also printing a status header line, but not in a valid format. Hiawatha only needs the HTTP error code (codes like, 301, 404, 500, etc), but in your case it doesn't seems to be a number. So, you should debug your CGI program and look for this Status header line.
This topic has been closed.