Solved

Reading a file outside of cgi-bin?

Posted on 2004-09-04
8
165 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
The viewer will learn how to count occurrences of each item in an array.
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…

776 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