|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Weird Apache / CGI issue
I'm having a strange problem with a CGI script. This script had been working fine with one hosting provider, after moving to a new host it's doing some weird stuff.. It's essentially a mail subscription script. When a visitor adds their e-mail address the Apache process is to "write out" a file in a specified directory containing the e-mail address as the file name and a confirmation code as the contents of the text file. Apache is trying, however, the files that Apache is writing out are 0 bytes in length. The Apache process has full write permissions to the specified directory. Anyone seen this kind of behavior? Possible fix?
Thanks in advance, Rob |
|
#2
|
|||
|
|||
|
>> This script had been working fine with one hosting provider
Every host's setup may vary and this really tell nothing. Start here -> http://forums.devshed.com/showthrea...6492&forumid=15 |
|
#3
|
|||
|
|||
|
Quote:
Well, thanks for the reply first of all. I started there. 8^) Permissions are all correct at present. I went so far as to make all directories above the directories that need to be written to and the cgi-bin directory itself 777 just for fun, to no avail. Ideas where to go from here? What's weird is- I have pl scripts elsewhere on this server running without a hitch. I'm going to paste my virtualhost config up in here and mebbe someone can tell me if I have that messed up. NameVirtualHost 123.456.789.123 <VirtualHost 123.456.789.123> ServerAdmin webmaster@abc.com DocumentRoot /home/abc/www/htdocs/ ServerName www.abc.com ServerAlias abc.com *.abc.com Alias /postoffice/ "/var/www/html/postoffice/" ErrorLog /home/abc/www/logs/error_log TransferLog /home/abc/www/logs/access_log ScriptLog /home/abc/www/logs/script_log AddHandler cgi-script .cgi <Files *.pl> SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI </Files> ScriptAlias /cgi-bin/ "/home/abc/www/cgi-bin/" <Directory /home/abc/www/cgi-bin/> AllowOverride None Options ExecCGI Includes FollowSymLinks Order allow,deny Allow from all </Directory> </VirtualHost> I also tried an AddHandler for perl-script. Same results.. Problems? |
|
#4
|
|||
|
|||
|
>> DocumentRoot /home/abc/www/htdocs/
Remove the trailing slash >> <Files *.pl> >> SetHandler perl-script >> PerlHandler Apache::Registry >> Options ExecCGI # you don't need this for mod_perl >> </Files> Change to: AddHandler perl-script .pl PerlHandler Apache::Registry PerlSendHeader On >> <Directory /home/abc/www/cgi-bin/> <Directory "/home/abc/www/cgi-bin"> It's a good practice to quote your path although yours should work fine as is >> Options ExecCGI Includes FollowSymLinks Options None your cgi-bin is scriptalias'ed, you can't have any options there. followsymlinks is fine but are you sure some of your scripts reside elsewhere? |
|
#5
|
|||
|
|||
|
First of all thanks so much again for trying to help... I've been pulling my hair out searching the net for *days*
>>> <Files *.pl> >>> SetHandler perl-script >>> PerlHandler Apache::Registry >>> Options ExecCGI # you don't need this for mod_perl >>> </Files> The above is something I had seen on a website >>Change to: >>AddHandler perl-script .pl >>PerlHandler Apache::Registry >>PerlSendHeader On Done, not in a files directive, correct? (that's how I tried anyway) >>> <Directory /home/abc/www/cgi-bin/> >><Directory "/home/abc/www/cgi-bin"> >>It's a good practice to quote your path although yours should >>work fine as is >>> Options ExecCGI Includes FollowSymLinks >>Options None >>your cgi-bin is scriptalias'ed, you can't have any options there. >>followsymlinks is fine but are you sure some of your scripts >>reside elsewhere? I set the options to None, and am now getting a permission denied error when trying to execute scripts. The actual error from the log file follows: [Tue Jul 31 14:46:37 2001] [error] access to /home/abc/www/cgi-bin/setup.pl failed for 123.456.789.6, reason: Options ExecCGI is off in this directory Could something be jacked up with Apache itself? I mean- for this virtualhost there is a ScriptAlias directive set for that directory.. Also a few days ago I tried to turn on script logging. My script_log file remains at 0 and it is putting errors (not very detailed and sometimes none at all when failures occur) into the server's error_log Rob |
|
#6
|
|||
|
|||
|
>> The above is something I had seen on a website
That site must have got some incorrect info. Anything as a module of Apache is not considered to be CGI scripts, therefore ExecCGI is not needed. >> AddHandler perl-script .pl >> Done, not in a files directive, correct? Yes. The AddHandler line above is to tell Apache to handle .pl extension by mod_perl. >> [error] access to /home/abc/www/cgi-bin/setup.pl failed mod_perl is NOT CGI script. Your cgi-bin is scriptalias'ed so don't put anything other than CGI scripts there. Remember you are using mod_perl by extension .pl. |
|
#7
|
|||
|
|||
|
Well...
Thanks so much for trying to help. I think I know what the problem is now. I also have some php scripts on this server. I had one that was a file uploader that I hadn't looked at in a while that was working perfectly.. I went to upload something and get the following message:
Warning: MkDir failed (Disk quota exceeded) in /home/rob/www/htdocs/uploader.php on line 55 One problem.. My account has no quota associated with it. I think to myself that the last time I used the script had been before quotas were enabled on the server. To test, I copied the script to a users account who has a quota of 100 megs, 20 of which is in use. Same error. I'm assuming that perl is experiencing the same problem. I've done a ton of searches on the web trying to find any reference to this type of issue, but haven't found anything. Anyone seen this? Am I overlooking something obvious? Thanks, Rob- |
|
#8
|
|||
|
|||
|
The default maximum upload size (found in php.ini) is 2MB. Tell your host to adjust that. Or just don't use PHP script as your upload script (too many vulnerabilities), you can always use a more secure one written in Perl.
|
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Weird Apache / CGI issue |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|