Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cp permission denied

Status
Not open for further replies.

Hondy

Technical User
Mar 3, 2003
864
GB
Hi

I have one more question if you don't mind?
My SH script tries to copy a file over another during the script like so:

cp /usr/local/apache2/status/UP.htm /usr/local/apache2/pagestatus.htm

when my web page tries to run this part of the script I get a permission denied error in the apache log. If i run this part of the script on its own through a console it works, what permissions do I need to give and where?

Thanks
 
You are probably a user like 'root' at the console.
Apache is either another user (' 'apache') or is 'Nobody'.

Take a look at the file with "ls -l [file]" and examine the perms on the file, specifically owner and group. Figure out if your Apache user would have rights.

You can figure out your Apache user by looking at the output of "ps waux | grep http"

D.E.R. Management - IT Project Management Consulting
 
thanks thedaver, i will do that as an exercise, sounds quite complicated!

for now I tried chmod -v 777 status.htm and that seems to have fixed it. Although I am a little confused why the new file keeps the same chmod props, I'm not complaining - its working!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top