Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Unable to read txt file on server

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Having Problems limitting access to a web folder ..  
Author Message
karigna_no

External


Since: Nov 15, 2003
Posts: 4



(Msg. 1) Posted: Sun Nov 23, 2003 5:20 pm
Post subject: Unable to read txt file on server
Archived from groups: alt>apache>configuration (more info?)

I'm running a search page on my web server which reads a txt file and should
then sent the results back to a web page on the same machine. The cgi script
runs fine from the command line but not from the web page. A test line at
the top of the script does print fine on the web page but later in the
script where I open the file,
read and then present the results back to the web page do not. I'm using
apache 2.0.48 and the txt file has read and execute permissions set for all
groups (755).

 >> Stay informed about: Unable to read txt file on server 
Back to top
Login to vote
karigna_no

External


Since: Nov 15, 2003
Posts: 4



(Msg. 2) Posted: Sun Nov 23, 2003 5:34 pm
Post subject: Re: Unable to read txt file on server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I have some more information to my earlier question, I have the following
entry in my apache error_log:

[Sun Nov 23 09:08:10 2003] [error] [client 127.0.0.1] Permission denied at
/var/www/cgi-bin/submit.cgi line 17.,
referer: http//localhost/

line 17 is the open file line: open F, $FILENAME or die $!;

$FILENAME is declared in line 10 as /root/perlfiles/out.txt


"Anand" <karigna_no.DeleteThis@verizon.net> wrote in message
news:4n3wb.5981$7%4.30@nwrdny03.gnilink.net...
 > I'm running a search page on my web server which reads a txt file and
should
 > then sent the results back to a web page on the same machine. The cgi
script
 > runs fine from the command line but not from the web page. A test line at
 > the top of the script does print fine on the web page but later in the
 > script where I open the file,
 > read and then present the results back to the web page do not. I'm using
 > apache 2.0.48 and the txt file has read and execute permissions set for
all
 > groups (755).
 >
 ><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Unable to read txt file on server 
Back to top
Login to vote
user2520

External


Since: Oct 21, 2003
Posts: 34



(Msg. 3) Posted: Sun Nov 23, 2003 5:34 pm
Post subject: Re: Unable to read txt file on server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Anand wrote:
 > I have some more information to my earlier question, I have the following
 > entry in my apache error_log:
 >
 > [Sun Nov 23 09:08:10 2003] [error] [client 127.0.0.1] Permission denied at
 > /var/www/cgi-bin/submit.cgi line 17.,
 > referer: http//localhost/
 >
 > line 17 is the open file line: open F, $FILENAME or die $!;
 >
 > $FILENAME is declared in line 10 as /root/perlfiles/out.txt

what are the file permissions for /root/perlfiles/out.txt ?
I suppose Apache doesn't have the right to open the file.

--
Robi<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Unable to read txt file on server 
Back to top
Login to vote
karigna_no

External


Since: Nov 15, 2003
Posts: 4



(Msg. 4) Posted: Sun Nov 23, 2003 6:36 pm
Post subject: Re: Unable to read txt file on server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Robi

read and execute for all groups - 755 but that's still not enough, not sure
what else I'm missing although it's clear I am.


"Robi" <me.TakeThisOut@privacy.net> wrote in message
news:bpqij4$1s1h0d$1@ID-211961.news.uni-berlin.de...
 > Anand wrote:
  > > I have some more information to my earlier question, I have the
following
  > > entry in my apache error_log:
  > >
  > > [Sun Nov 23 09:08:10 2003] [error] [client 127.0.0.1] Permission denied
at
  > > /var/www/cgi-bin/submit.cgi line 17.,
  > > referer: http//localhost/
  > >
  > > line 17 is the open file line: open F, $FILENAME or die $!;
  > >
  > > $FILENAME is declared in line 10 as /root/perlfiles/out.txt
 >
 > what are the file permissions for /root/perlfiles/out.txt ?
 > I suppose Apache doesn't have the right to open the file.
 >
 > --
 > Robi<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Unable to read txt file on server 
Back to top
Login to vote
nospamrossz1

External


Since: Nov 23, 2003
Posts: 3



(Msg. 5) Posted: Mon Nov 24, 2003 12:11 am
Post subject: Re: Unable to read txt file on server [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Anand" <karigna_no DeleteThis @verizon.net> wrote in
news:4u4wb.4673$rS5.4646@nwrdny02.gnilink.net:

 > Robi
 >
 > read and execute for all groups - 755 but that's still not enough, not
 > sure what else I'm missing although it's clear I am.
 >
 >
 > "Robi" <me DeleteThis @privacy.net> wrote in message
 > news:bpqij4$1s1h0d$1@ID-211961.news.uni-berlin.de...
  >> Anand wrote:
   >> > I have some more information to my earlier question, I have the
 > following
   >> > entry in my apache error_log:
   >> >
   >> > [Sun Nov 23 09:08:10 2003] [error] [client 127.0.0.1] Permission
   >> > denied
 > at
   >> > /var/www/cgi-bin/submit.cgi line 17.,
   >> > referer: http//localhost/
   >> >
   >> > line 17 is the open file line: open F, $FILENAME or die $!;
   >> >
   >> > $FILENAME is declared in line 10 as /root/perlfiles/out.txt
  >>
  >> what are the file permissions for /root/perlfiles/out.txt ?
  >> I suppose Apache doesn't have the right to open the file.

Put the file somewhere else. For example, if the text file is created on
the fly, stick it in /tmp. Another good location is /var/local if the file
is more persistent.

If the file contains sensitive information, change the owner to your apache
user and set the permissions to 600.


--
Rossz

Remove 'NOSPAM' from my email address to reply directly<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Unable to read txt file on server 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
testing do not read - told ya so

Apache proxy server returns empty file (file size 0) - Hi, I've a very strange problem. We have a proxy server that is used by an application to download XSD file. For performance reasons, we cache these files and force a fresh download every 24 hours. At some moment, the proxy server returns an empty file...

Access to remote file shares via Apache nad Oracle App Ser.. - Help please. I have apache web server from Oracle 9i application server. I am trying to add an alias which will access files on a remote file server. The Oracle HTTPSService (Apache Server Service) is running as a domain memebr account which has read..

apache with subdirectories. Users unable to go to the subs. - I am running Slackware 9. I have a smc-7400vbr router and adsl modem. I use minidns for a dynamic dns . Everything seems to work ok but when someone connects to it: http://www.bclinux.ca I have linked some subdirectories with files in them. E.G. Ham Inf...

unable to start apache becase of mod_auth_mysql error - I am try to upgrade my apache install to a lamp compatible (linux, apache, mySql, PHP). When I installed RH 9 I selected the Apache (not sure of the version) but the new version I am trying to use is 2.0.47. apachectl -v Server version: Apache/2.0.47..
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

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



[ Contact us | Terms of Service/Privacy Policy ]