Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

File permissions + WN/2.2.4 issues.

Quote Reply
File permissions + WN/2.2.4 issues.
Hi there,

First of all I know very little about cgi programming other than
setting globals/variables and occasionally changing bits of code
whenever a script prints text of html. Applying modifications
created by 3rd parties is no problem either.

Procedures:

• I've just installed Links 2.0 and followed the readme instructions
• Tested the admin functions, everything okay except nph-build.cgi
• Had some problem with nph-build.cgi so I browsed through the G.T.
UNIX-install board:
• I changed the name to build.cgi, no effect, changed it back to
nph-build.cgi
• I also removed instances of $nph in nph-build.cgi, still no effect,
left changes as is
• The error was something in the line of "permission denied" so I
again changed all directories in admin dir to 777 (to be sure)
• added an empty links.db.bak file to the data dir (also 777)

Result: no more permission denied and nph-build.cgi seems to work,
at least it showed no error

• I again created a new category (in fact a new directory?) and added
a link to that category, so far so good. Again build showed no error

Problems:

• After build (nph-build.cgi) I found that the html file created by the
script had a permission of 600 instead of 644.

• Other cgi scripts I use that ONLY create/modify .dat files DO work
when a directory is set to 777. Those file are read by the cgi
script that uses the "print" function to display it in the browser.
Those .dat files are never requested by the browser directly.
So it does not create static html pages. (Robboard for instance.)

• I asked tech support about this and they said the script has to CHMOD
the directories to 777 and html files to 644 in order for it to work.

Q: I suspect Links already does this by default or am I wrong?

Now for the ugly part:

• The owner/group is set to www/www which means I don't have access
to those files/directories. I can't change the CHMOD because I get
"operation not permitted" errors in my ftp program. It's the same
with a telnet connection.

• I know my ISP's web server usually DOES NOT allow scripts to create
public available directories and files although they said they
changed that policy recently.

• The web server software also expects an index.cache file in EVERY
directory, with a complete list of all files to be served. Now I can
UPDATE the index.cache files in telnet with one cmd, so that's not
the problem, although very irritating because I'd have to perform
this operation after every build. It's just that I can't access those
directories in the first place to CREATE the index.cache files.

Q: What to do about this?

Don't tell me I need to switch ISP's! I do know an index.cache file
can be created by a cgi script, because it's only a list of files
with their corresponding mime type. (text/css, text/html etc.)

If there's no solution to this problem someone may have to add this
procedure (create/update index.cache files) to Links for me which
from what I understand (limited as it is!) should not be all that
difficult.

I've included some specs taken from the perl environment variables
printed when the last error occurred, might shed some light on things:

Perl Version : 5.00503
AUTOBOOT : YES
BOOT_IMAGE : linux-2.2.15
CONSOLE : /dev/console
GATEWAY_INTERFACE : CGI/1.1
HOME : /
HOSTTYPE : i386
HTTP_ACCEPT : */*
HTTP_ACCEPT_LANGUAGE: nl
HTTP_COOKIE : DCForumStyle=
HTTP_HOST : www.angels4angels.net
HTTP_REFERER : http://www.angels4angels.net/links/admin/¬
admin.cgi?display=navigation
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)
INIT_VERSION : sysvinit-2.77
OSTYPE : Linux
PATH : /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
PREVLEVEL : N
REQUEST_METHOD : GET
RUNLEVEL : 3
SERVER_NAME : www.angels4angels.net
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : WN/2.2.4
SHELL : /bin/bash
SHLVL : 3
TERM : linux
URL_SCHEME : http


Any help/assistance greatly appreciated. Or maybe someone already
went through the whole process? Feel free to respond! :)

Quote Reply
Re: File permissions + WN/2.2.4 issues. In reply to
In Reply To:
After build (nph-build.cgi) I found that the html file created by the script had a permission of 600 instead of 644.
There are code hacks available in the Links 2.0 Discussion Forum and Links 2.0 Customization Forum that will preserve the 666 permission of the links.db file.

Search for Bobsie 666 644 permissions in the Links 2.0 Customization Forum using the And option...This FAQ should be linked again in the Resource Center again as well.

In Reply To:
Other cgi scripts I use that ONLY create/modify .dat files DO work when a directory is set to 777. Those file are read by the cgi script that uses the "print" function to display it in the browser. Those .dat files are never requested by the browser directly. So it does not create static html pages. (Robboard for instance].
Come again? There are no .dat files in Links 2.0.

In Reply To:
• I asked tech support about this and they said the script has to CHMOD the directories to 777 and html files to 644 in order for it to work.

Q: I suspect Links already does this by default or am I wrong?
Yes...Links already does this IF you set your links/pages directory to 777 (rwxrwxrwx) to begin with.

In Reply To:
The owner/group is set to www/www which means I don't have access to those files/directories. I can't change the CHMOD because I get "operation not permitted" errors in my ftp program. It's the same with a telnet connection.
You should use telnet to build your directory, which will retain the ownership of files and directories to you as the administrator and NOT WWW or NOBODY.

In Reply To:
I know my ISP's web server usually DOES NOT allow scripts to create public available directories and files although they said they changed that policy recently.
Then LINKS is not for you.

In Reply To:
The web server software also expects an index.cache file in EVERY directory, with a complete list of all files to be served. Now I can UPDATE the index.cache files in telnet with one cmd, so that's not the problem, although very irritating because I'd have to perform this operation after every build. It's just that I can't access those directories in the first place to CREATE the index.cache files.
Well...read my earlier reply...build by telnet and you should not have this problem. Remember that you need to first delete all directories and files created by LINKS before building by telnet.

In Reply To:
Don't tell me I need to switch ISP's! I do know an index.cache file can be created by a cgi script, because it's only a list of files with their corresponding mime type. (text/css, text/html etc.)
You could hack the sub build_category_pages to build index.cache files in your LINKS directory. Yet having this stringent criterion would make me switch hosts in a heartbeat. Wink

Good luck!

Regards,


Eliot Lee
Quote Reply
Re: File permissions + WN/2.2.4 issues. In reply to
There are code hacks available ... again as well.

I'll go and dig some more than!

"Come again? There are no .dat files in Links 2.0"

That's not what I meant. I was only trying to say that the only easy way a script works for me is a script that reads the files itself, then prints it to the browser. Otherwise I would have to update the index.cache files after every change, with scripts that create static files. Any script.

"Yes...Links already does this IF you set your links/pages directory to 777 (rwxrwxrwx) to begin with."

Already did that at the beginning. But as we know now, that doesn't solve it entirely.

"You should use telnet to build your directory, which will retain the ownership of files and directories to you as the administrator and NOT WWW or NOBODY."

Will Links 2 use the directories I create? I have to create a dir X using ftp (works too) or telnet, then add a dir X at the admin page? No problem...

"Then LINKS is not for you."

Well I'm not about to give up on Links. Switching to another links script doesn't solve the index.cache problem, I know because I've tried about 7 others a while ago. Links is the one I like best. I am changing hosts at the end of this year, but for now, I'll have to stick with a WN 2.2.4 server.

Michael

Quote Reply
Re: File permissions + WN/2.2.4 issues. In reply to
In Reply To:
Will Links 2 use the directories I create?
If you have the directory defined in the categories.db OR in the variables (e.g., $build_new_path) toward the top of the links.cfg file and if the directory is set to 777 (drwxrwxrwx)...then yes.

Welp...good luck..sorry my information didn't help you! Tongue

Regards,

Eliot Lee
Quote Reply
Re: File permissions + WN/2.2.4 issues. In reply to
Thnx for your assistance! Tongue

I think I've got most things worked out now. I'm about to assimilate the templates into the angesl4angels.net collective. Created and efficient directory structure first of course. No errors regarding file/folder permissions except the new directories in "New", "Cool" and "Ratings". There's no quick fix for that thanks to a weird web server! :(


See Ya,

Michael.

Quote Reply
Re: File permissions + WN/2.2.4 issues. In reply to
You're welcome.

Regards,

Eliot Lee