Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 30th, 2001, 04:56 PM
Vap1d- Vap1d- is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 7 Vap1d- User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old July 30th, 2001, 10:29 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> 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

Reply With Quote
  #3  
Old July 31st, 2001, 10:59 AM
Vap1d- Vap1d- is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 7 Vap1d- User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by freebsd
>> 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


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?

Reply With Quote
  #4  
Old July 31st, 2001, 02:03 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> 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?

Reply With Quote
  #5  
Old July 31st, 2001, 03:29 PM
Vap1d- Vap1d- is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 7 Vap1d- User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old August 1st, 2001, 12:35 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> 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.

Reply With Quote
  #7  
Old August 14th, 2001, 02:40 PM
Vap1d- Vap1d- is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 7 Vap1d- User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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-

Reply With Quote
  #8  
Old August 14th, 2001, 04:53 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Weird Apache / CGI issue


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway