Solved

Reading a file outside of cgi-bin?

Posted on 2004-09-04
8
172 Views
Last Modified: 2013-12-25
I'm attempting to create a log parser for an online game of mine.

The game produces logs to ~/dystopia/accounts/METALOG

Our websetup is such that ~/public_html/ points to /var/www/html/bd and is setup to execute cgi.

We wrote a cgi program in C++ to read the files in /home/bd/dystopia/accounts/METALOG/... but it fails, saying that it cannot open the files...

I don't think it's a permission problem, because we're very loose with the permissions (775)

Can anyone help please?
0
Comment
Question by:Krule
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 16

Expert Comment

by:xDamox
ID: 11982353
The permission is wrong.

the permission is:

owner = Read, write and execute
group = Read, Write and execute
other = execute

you need to set the permission to: 774

hope this helps
0
 
LVL 3

Author Comment

by:Krule
ID: 11983003
Right, that was a typo, my mistake

Thats not the problem :(
0
 
LVL 4

Expert Comment

by:divt
ID: 11985403
Let me try to summarize:

The game produces logs to ~/dystopia/accounts/METALOG
Websetup is such that ~/public_html/ points to /var/www/html/bd and is setup to execute cgi.
You read the files in /home/bd/dystopia/accounts/METALOG/...

Shouldn't you read the files here?
/home/dystopia/accounts/METALOG/...

0
 
LVL 4

Expert Comment

by:divt
ID: 11985413
Also, try outputing these server environments for easier debugging:

DOCUMENT_ROOT  The file system path to the script being executed
SCRIPT_FILENAME  The full path and filename of the script being executed.

Good luck!
0
 
LVL 48

Accepted Solution

by:
Tintin earned 125 total points
ID: 11986288
xDamox.

Nothing wrong with permissions of 775, although better they are 755 or 555.

BTW, 774 is not the permissions you mention, you meant to say 771.

However, it depends on whether we are talking about the directory or the file.

Krule.

What permissions do you have on the directory *and* the files?  If they are all 775 or even 755, then there is no permission problem.

What is the exact error message you get when you try to open the files?
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question