LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-28-2004, 10:33 AM   #1
Randvegeta
Member
 
Registered: Jun 2003
Location: Hong Kong
Distribution: Mandrake 9.1
Posts: 72

Rep: Reputation: 15
CGI/Perl script problems.


I run a very small low profit hosting company in Hong Kong(its more of a hobby). I bought a script called Easyhost from http://cyberscript.net which allows me to create a free hosting service like Geocities or somthing.

I had the script installed and working great on my server (which I own and has cpanel installed). I have also installed this script many times before and all times it worked fine and never had any problems.

(Installation requires 3 files and the files chmoded correctly and then execute one of them and the installation is complete.)

After the script was installed and working fine, I installed another script called WHM Auto Pilot. WHM Auto Pilot requires some software for it to work so I installed ZEND as required and followed these instuctions http://www.whmautopilot.com/tutorials/recompile.htm .

After successfully installing WHM.AP my CGI/PERL scripts began to bugger up. When a new user would signup the folder that was created for that user was set at 700 making it forbiden to access. I am able to create a folder in FTP and the permissions are fine, I think it only happens when my CGI/Perl scripts try to make a dir or write a new file. I first noticed it on my free hosting script but I also noticed it on my poll script which is not not allowed to have access to write to log the IPs(so you cant vote twice)... Ive hit a stop, I'm completley stumped.

Whats wrong? How can I fix it? Does anyone know what to do? Please help me. Thanks in advance...

(Note: If you need more information, I'de be glad to submit some more.)


*All this is installed onto a Trustix server*

Last edited by Randvegeta; 12-29-2004 at 12:09 AM.
 
Old 12-29-2004, 12:08 AM   #2
Randvegeta
Member
 
Registered: Jun 2003
Location: Hong Kong
Distribution: Mandrake 9.1
Posts: 72

Original Poster
Rep: Reputation: 15
HELP

Any Help???? Please???
 
Old 12-29-2004, 01:03 AM   #3
wipe
Member
 
Registered: Jun 2004
Location: High Green
Distribution: Fedora Core 4
Posts: 180

Rep: Reputation: 30
Sounds like the umask is 0077. Try umask 002 (or something similar) and read the man page (the bit about umask). The setting is inherited from parent shell.

Regards
Simon
 
Old 12-29-2004, 02:48 AM   #4
Randvegeta
Member
 
Registered: Jun 2003
Location: Hong Kong
Distribution: Mandrake 9.1
Posts: 72

Original Poster
Rep: Reputation: 15
...

Ahh..How exactly do i do that?
 
Old 12-29-2004, 09:58 AM   #5
wipe
Member
 
Registered: Jun 2004
Location: High Green
Distribution: Fedora Core 4
Posts: 180

Rep: Reputation: 30
The umask command must be executed before the script that creates new files, ie. before the web server is started. The script is of course free to decide what permissions it gives to the files it creates (by changing the umask, for example). See the 6th posting of this thread: http://www.linuxquestions.org/questions/history/18661. It might be that the permissions of the parent directory of the user directories determine the permissions of the files and directories created under it in some cases. It's also possible that the settings of the web server (especially if extra modules are added) or script interpreter play a role here.

Simon
 
Old 12-29-2004, 10:27 AM   #6
Randvegeta
Member
 
Registered: Jun 2003
Location: Hong Kong
Distribution: Mandrake 9.1
Posts: 72

Original Poster
Rep: Reputation: 15
I see...

I see...but what i mean is... I'm a linux newbie when it comes to things i havent repeatedly done.

SO what i need is sumthin like instructions step by step kinda thing.. haha!
 
Old 12-29-2004, 12:40 PM   #7
wipe
Member
 
Registered: Jun 2004
Location: High Green
Distribution: Fedora Core 4
Posts: 180

Rep: Reputation: 30
OK, here's an example:

1. I'm looking at a [wiki]Bash[/wiki] command prompt. I type umask and press enter - a number appears showing the current setting: 0077. This means that all files created will have permissions 600 and directories will have 700.

2. I start [wiki]Apache[/wiki] with [wiki]apachectl[/wiki] (while being [wiki]root[/wiki]) and run a test script by directing my browser to it. The script creates a file with the permissions 600.

3. I stop Apache and type umask 002. Now every new file gets permissions 664.

4. I delete the created test file, start Apache and run the script again. The new file has permissions 664. All of these operations have to be done from the same terminal window (without closing it), otherwise it won't work.

I regret that I'm unable to give you detailed instructions since I'm unfamiliar with the programs in question and don't know how your system is set up.

BTW, it's OK to ask [wiki]newbie[/wiki] questions, it's one of the primary ways to get rid of newbieness.

Last edited by wipe; 12-29-2004 at 12:50 PM.
 
Old 12-29-2004, 10:06 PM   #8
Randvegeta
Member
 
Registered: Jun 2003
Location: Hong Kong
Distribution: Mandrake 9.1
Posts: 72

Original Poster
Rep: Reputation: 15
Hmm

Ok i will see if i can do what you suggest...if i cant ill have to post back and ask more newbie questions! :P
 
Old 12-30-2004, 12:24 AM   #9
Randvegeta
Member
 
Registered: Jun 2003
Location: Hong Kong
Distribution: Mandrake 9.1
Posts: 72

Original Poster
Rep: Reputation: 15
HAHAH

OF COURSE! ITS SO SIMPLE NOW!!! JUST CHANGE THE UMASK TO 0027 OMG! HOW CUD I HAVE BEEN STUMPED FOR 3 DAYS!
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl cgi Script can`t make file.Why? ZairSadiqov Linux - Software 1 11-22-2006 07:22 AM
exec a C prg in a CGI Perl script jagman Linux - Networking 2 05-31-2005 10:40 AM
trying to add cgi-bin perl script. shizzle Linux - Networking 7 05-19-2005 01:24 AM
cgi-bin error regarding perl script hamish Linux - Software 11 12-09-2004 10:16 AM
Need Help With My Perl/cgi Authentication Script dutch357 Programming 0 04-11-2003 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration