Problem with Apache, permission denied


 
Thread Tools Search this Thread
Operating Systems AIX Problem with Apache, permission denied
# 1  
Old 04-06-2011
Problem with Apache, permission denied

Just installed apache 2.2.17 and I can start up the httpd server without any errors. However when I try to access my scripts in /cgi-bin/ I'm getting the following error in error_log:

Code:
[Wed Apr 06 15:48:51 2011] [error] [client 135.70.28.21] Can't open perl script "/usr/local/apache2/cgi-bin/ldapsearch.cgi": Permission denied
[Wed Apr 06 15:48:51 2011] [error] [client 135.70.28.21] Premature end of script headers: ldapsearch.cgi

It happens for each of the scripts in my cgi-bin directory. These scripts were working with a much older version of apache, so it's not a script issue. I also do not have suexec installed. The permissions look correct.

I did update the httpd.conf file and replaced the User daemon with User nobody, and the Group daemon with Group nobody. 'nobody' is in both my /etc/passwd and /etc/group listings.

I have heard this might be an issue with loading headers, but I have installed twice now and didn't see any errors on the install.

Please help.

Moderator's Comments:
Mod Comment edit bay bakunin: Please use CODE-tags when posting code, terminal output or the like. Thank you.

Last edited by bakunin; 04-07-2011 at 08:39 AM..
# 2  
Old 04-07-2011
Just some ideas what you could check:

- permissions of the files in /usr/local/apache2/cgi-bin

- permissions of the directory /usr/local/apache2/cgi-bin itself

- contents of httpd.conf - as far as i remember separate permissions are laid down there

- check under which UID/GID/EUID/PGID the httpd process runs.

I hope this helps.

bakunin
# 3  
Old 04-07-2011
I can recall myself a verry strange error happend to me before about /var/log/httpd not having the correct permissions, you can check those as well.
# 4  
Old 04-07-2011
I was able to get this. I changed the permissions in the directory from 644 to 755 and it works. I don't quite understand why but it does work now.
# 5  
Old 04-08-2011
Quote:
Originally Posted by islanderman
I changed the permissions in the directory from 644 to 755 and it works. I don't quite understand why [...]
What you did was to set the "x" bit for the directory for owner, owners group and world. The "x" bit in directory is necessary for the "chdir()" system call to get the files inode number and thus accessing the file.

Suppose you want to access /path_to/file: without the "r" bit on the file you wouldn't be allowed to read it and therefore a "cat /path_to/file" would fail. A "ls -l /path_to/file" might still work though, because even if the access to the files contents is blocked the existence of the file is no secret to you.

If the "x"-bit on the directory "/path_to" is missing for your UID you will not be able to do a "ls -l" (or any similar command) on the directory and therefore the access to the file would be blocked for another reason: you will not be allowed to get the inode information necessary to access the file.

For further information you might want to read Perderabos file permissions tutorial.

I hope this clears things up.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Permission denied

Trying to get date into the txt file. It says Permission denied. echo $(date +%I:%M:%S_%D) >> /tmp/systemd_suspend_test_err.txt exec 2>> /tmp/systemd_suspend_test_err.txt if ; then # Do the thing you want before suspend here echo "we are suspending $(date +%I:%M:%S_%D)." elif ;... (5 Replies)
Discussion started by: drew77
5 Replies

2. UNIX for Dummies Questions & Answers

Permission denied

when i run echo "User” > /dev/tty5 why do i get permission denied? :confused: (2 Replies)
Discussion started by: chinababy
2 Replies

3. Linux

Permission denied

I am using korn shell When I type in Telnet on cmd line, I get message "cannot execute" How can I get permission to execute command ? In which dir is telnet located ? I looked in /usr/bin dir. but its not there Thanks (1 Reply)
Discussion started by: paramshamnani
1 Replies

4. Shell Programming and Scripting

Problem Permission denied cp -r

Hi I am administrator in unix I want make backup folder and file in root directory I use instruction Cp -r , But the system pear problem cp: cannot create regular file : Permission denied Can someone explain me what am I doing wrong??? please... find other instruction backup folder... (1 Reply)
Discussion started by: xactor
1 Replies

5. Solaris

Problem with nfs sharing, permission denied for writing.

Hi I have a problem with NFS sharing on solaris 10, the problem simply with write permission, after do the following command, the folder still not writable from machine 2 : on machine 1 (10.10.10.32) : share -F nfs -o rw /u01/portalrepository/ on machine 2 (10.10.10.31) : mount -F nfs... (35 Replies)
Discussion started by: Al-Mothafar
35 Replies

6. Red Hat

Permission denied

Hi guys im new to this db i have a small prob while installing websphereportal6.1i think i was installed succesfully but the error im getting is while starting server. check this out # ./serverStatus.sh -all Error loading: /usr/wps61/AppServer/java/jre/bin/classic/libjvm.so: cannot... (1 Reply)
Discussion started by: varma917989
1 Replies

7. UNIX for Dummies Questions & Answers

Permission denied problem

I am trying to tidy our server and write cron to keep it tidy. We took on a third party to do some work last year. They were given their own UID/pwd so that they would have limited access. Part of what they wrote created an archive file at the end of every day. A year on and we don't want... (1 Reply)
Discussion started by: RexJacobus
1 Replies

8. UNIX for Advanced & Expert Users

Permission denied

Hi, I can not execute a .env file $ . /Data/oracle/d03/mydbora/8.0.6/MYDB.env -bash: /Data/oracle/d03/mydbora/8.0.6/MYDB.env: Permission denied Even if : -rwxrwxrwx 1 oracle dba 2903 Mar 5 2007 /Data/oracle/d03/mydbora/8.0.6/MYDB.env Please help. Many thanks. (1 Reply)
Discussion started by: big123456
1 Replies

9. UNIX for Dummies Questions & Answers

Permission Denied

I just started computer science at UW Milwaukee. When I access the university Solaris system from PuTTY, I get permission denied when I try to access the file I wrote. Now I really have no idea what I'm doing, I just don't understand why I get permission denied in my won directory. Thank You ... (0 Replies)
Discussion started by: howeezy
0 Replies

10. UNIX Desktop Questions & Answers

BSD Permission Denied Problem

I'm new to *nixs and I decided to start with FreeBSD. I downloaded the ISO and installed it successfully, and managed to log in as root. Now everytime I try to enter into a directory ( I think thats what Im doing) such as /etc or /usr I always will get a permission denied. Any help is... (2 Replies)
Discussion started by: Phyber
2 Replies
Login or Register to Ask a Question